/**  
 *  页面加载等待页面  
 *  
 * @author gxjiang  
 * @date 2010/7/24  
 *  
 */  
 var height = window.screen.height-250;   
 var width = window.screen.width;   
 var leftW = 300;   
 if(width>1200){   
    leftW = 500;   
 }else if(width>1000){   
    leftW = 350;   
 }else {   
    leftW = 100;   
 }

 var _html = "<div id='loading' style='position:absolute;left:0;width:100%;height:" + height + "px;top:0;background:#E0ECFF;opacity:0.8;filter:alpha(opacity=80);'><div style='position:absolute;  cursor1:wait;left:" + leftW + "px;top:200px;width:auto;height:16px;padding:12px 5px 10px 30px; background:#fff url(js/easyui/default/images/pagination_loading.gif) no-repeat scroll 5px 10px;border:2px solid #ccc;color:#000;'>   正在加载，请等待...</div></div>";

 window.onload = function() {
     var _mask = document.getElementById('loading');
     _mask.parentNode.removeChild(_mask);

     //按钮全选效果
     $("#CheckAll").click(function () {
         if (this.checked) {
             $(this).attr("title", "反选");
             $("[name=items]:checkbox").attr("checked", true);
         } else {
             $(this).attr("title", "全选");
             $("[name=items]:checkbox").attr("checked", false);
         }
     });
 }


 document.write(_html);

 function _getCheckBoxCollectionValue(checklist) {

     var retval = '';
     if (checklist) {
         if (!checklist.length) {
             if (checklist.checked) {
                 retval = encodeURI(checklist.value) + '';
             }
         } else {
             var hasValue = false;
             for (var i = 0; i < checklist.length; i++) {
                 if (checklist[i].checked) {
                     hasValue = true;
                     retval += encodeURI(checklist[i].value) + ',';
                 }
             }
             if (hasValue) {
                 retval = retval.substring(0, retval.length - 1);
             }
         }
     }
     return retval;
 }

 function _alertCheckBoxCollection(checklist, alertString) {
     var collectionValue = _getCheckBoxCollectionValue(checklist);
     if (collectionValue.length == 0) {
         alert(alertString);
         return true;
     }
     return false;
 }

