function show11(element, divelement, newbg, oldbg, count, index, newcolor, olecolor)
 {
	    for (var i = 1; i <= count; i++) {
	        if (i == index) {
	            document.getElementById(divelement + i).style.display = "block";
	            document.getElementById(element + i).style.color = newcolor;
	            document.getElementById(element + i).style.backgroundImage = "url('" + newbg + "')";
	        }
	        else {
	            document.getElementById(divelement + i).style.display = "none";
	            document.getElementById(element + i).style.color = olecolor;
				document.getElementById(element + i).style.backgroundImage = "url('" + oldbg + "')";
	        }
	    }
}

    //获取浏览器类型
    function getBrowserOS()
    {
       if(navigator.userAgent.indexOf('MSIE')>-1)return 'MSIE';
       if(navigator.userAgent.indexOf('Firefox')>-1)return 'Firefox';
       if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 'Safari';   
       if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 'Camino';
       if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 'Gecko';
       if(navigator.userAgent.indexOf('Opera')>-1)return 'Opera';
       return 'Other';
    }



    //获取值
    DragUtil.getSortIndex = function() {
        var col_array = ['col_div1', 'col_div2'];
        var sortIndex = '';
        for (var i = 0; i < col_array.length; i++) {
            sortIndex += col_array[i] + ":";
            var childs = document.getElementsByClassName('hiddvalue', col_array[i]);
            for (var j = 0; j < childs.length; j++) {
                if (!Element.hasClassName(childs[j], 'no_drag')) {
                    sortIndex += childs[j].value + ',';
                }
            }
            sortIndex += "\n";
        }
        return sortIndex;
    }

    function GetData() {

    }



    function Showupdate(a1, a2, a3) {
        EditPage = document.getElementById('divshow');

        var scrollPos;
        if (typeof window.pageYOffset != 'undefined') {
            scrollPos = window.pageYOffset;
        }
        else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
            scrollPos = document.documentElement.scrollTop;
        }
        else if (typeof document.body != 'undefined') {
            scrollPos = document.body.scrollTop;
        }

        EditPage.style.top = scrollPos + 20 + "px";
        EditPage.style.zIndex = 101;
        EditPage.style.display = '';


        //添加一个层，用于挡住以前的东西
        BackDiv = document.createElement('DIV');
        var xScroll, yScroll;
        if (window.innerHeight && window.scrollMaxY) {
            xScroll = document.body.scrollWidth;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        BackDiv.style.cssText = 'position:absolute;background-color: #ffffff;  top: 0px; left:0px; width: ' + xScroll + 'px; height:' + yScroll + 'px;';
        BackDiv.id = 'divback';

        //设置页面透明
        if (getBrowserOS().toUpperCase() == 'FIREFOX') {
            BackDiv.style.MozOpacity = '0.8';
        }
        else {
            BackDiv.style.filter = "alpha(opacity=80)";
        }
        document.body.appendChild(BackDiv);


        EditTitle = document.getElementById('lbltitle');
        EditTitle.innerHTML = a1;

    }
    function EditClose() {
        EditPage = document.getElementById('divshow');
        BackDiv = document.getElementById('divback');

        EditPage.style.display = 'none';
        //设置页面透明
        BackDiv.parentNode.removeChild(BackDiv);

    }

    function MM_jumpMenu(targ, selObj, restore) { //v3.0
        eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
        if (restore) selObj.selectedIndex = 0;
    }




//<!--模块管理折叠菜单script开始-->
function changeLeft(objid,size)
{
	var contextPath = document.location.pathname; 
	
  	var index =contextPath.substr(1).indexOf("/"); 
  	var array=contextPath.split("/");
  	
  	if(array.length >2){
  		contextPath="";
  	}else{
  	contextPath = contextPath.substr(0,index+1); 
  }
  	delete index; 
	//alert(parseInt(size));
		for (var i=1;i<=parseInt(size);i++){  //这个循环可以保证每次之展开一个菜单
		if(objid!="left"+i){
			document.getElementById("left"+i+"_ul").style.display="none";
			document.getElementById("left"+i+"_Direction").src=contextPath+"images/icon113.gif";
		}
	}
	
	if(document.getElementById(objid+"_ul").style.display=="none")
	{
		document.getElementById(objid+"_ul").style.display="block";
		document.getElementById(objid+"_Direction").src=contextPath+"images/down2.gif";
	}
	else
	{
		document.getElementById(objid+"_ul").style.display="none";
		document.getElementById(objid+"_Direction").src=contextPath+"images/icon113.gif";
	}

}
//<!--模块管理折叠菜单script结束-->


//<!--我的好友折叠菜单script开始-->

function changeLeft2(objid,size)
{

	var contextPath = document.location.pathname; 
	
  	var index =contextPath.substr(1).indexOf("/"); 
  	var array=contextPath.split("/");
  	
  	if(array.length >2){
  		contextPath="";
  	}else{
  	contextPath = contextPath.substr(0,index+1); 
  }
  	
  	delete index; 

	
	
		for (var i=1;i<=parseInt(size);i++){  //这个循环可以保证每次之展开一个菜单
		
		if(objid!="left1"+i){
		
			document.getElementById("left1"+i+"_ul").style.display="none";
			document.getElementById("left1"+i+"_Direction").src=contextPath+"images/icon5.gif";
		}
	}
	
	if(document.getElementById(objid+"_ul").style.display=="none")
	{
		document.getElementById(objid+"_ul").style.display="block";
		document.getElementById(objid+"_Direction").src=contextPath+"images/down.gif";
	}
	else
	{
		document.getElementById(objid+"_ul").style.display="none";
		document.getElementById(objid+"_Direction").src=contextPath+"images/icon5.gif";
	}

}

// <!--我的好友折叠菜单script结束-->

//<!--模块拖动记录管理开始-->
//timerID = setInterval("count()",9000);
function setcount() {
    //alert('123');
    DragUtil.getSortIndex();
}
DragUtil.getSortIndex = function()
{
    var col_array = [ 'col_div1' , 'col_div2'];
    var sortIndex = '';
    for(var i = 0; i < col_array.length ; i++)
    {
        sortIndex += col_array[i] + ":";
        var childs = document.getElementsByClassName('hiddvalue' , col_array[i]);
        for(var j = 0 ; j < childs.length ; j++)
        {
            if(!Element.hasClassName(childs[j] , 'no_drag'))
            {
                sortIndex += childs[j].value + ',' ;
            }
        }
        sortIndex += ".\n";
    }
    //return sortIndex;
        xmlHttp = createXMLHttpRequest();
        xmlHttp.open("POST","/include/ModuleAjax.aspx?Value="+sortIndex,true);
        xmlHttp.send(null);
}
function createXMLHttpRequest()
 {
    if(window.ActiveXObject)
     {
         xmlHttp = new  ActiveXObject("microsoft.XMLHTTP")
     }
    else if (window.XMLHttpRequest)
     {
        xmlHttp = new XMLHttpRequest(); 
     }
         return xmlHttp;
 }

//<!--模块拖动记录管理开始-->


//<!--/*模块删除*/-->
  function clase(menu){     
    xmlHttp = createXMLHttpRequest();
    xmlHttp.open("POST","/include/ModuleAjax.aspx?display_none_Value="+menu,true);
    xmlHttp.send(null);    
       var hehe=document.getElementById('drag_'+menu);
      hehe.style.display='none';
      if(document.getElementById("cbCheck"+menu+"")){
        document.getElementById("cbCheck"+menu+"").checked=false;
      }
  }
//<!--/*模块删除*/-->

        var toJquery=jQuery.noConflict();  
        toJquery(document).ready(function(){
            toJquery("#cbAll").click(function(){                
                toJquery("input[name=cbCheck]").attr("checked",toJquery(this).attr("checked"));
            })
            toJquery("#btYingyong").click(function(){
              if(confirm('确定应用?')){
                var SelectModule="";
                toJquery("input[name=cbCheck]").each(function(i,n){
                    //alert(i);
                    if(toJquery(n).attr("checked")){
                        SelectModule+=toJquery(n).val()+",";
                    }
                });
                //alert(SelectModule)
                if(SelectModule==""){
                    alert('请选择显示模块');
                    return false;
                }
                toJquery.post("include/ModuleAjax.aspx?PostModule="+new Date(),{ModuleStr:escape(SelectModule)},function(data){
                    if(data=='ok'){
                     window.location.reload();
                    }
                })
               }
            })
            toJquery("#btQuite").click(function(){
                  if(confirm('确定取消？')){
                     window.location.reload();
                }
            }) 
            
            toJquery("#lnkHuifu").click(function(){
                if(confirm('确定恢复默认布局')){
                    var SelectModule="";
                    toJquery("input[name=cbCheck]").each(function(i,n){
                        SelectModule+=toJquery(n).val()+",";
                    });                   
                    toJquery.post("include/ModuleAjax.aspx?HuifuPostModule="+new Date(),{ModuleStr:escape(SelectModule)},function(data){
                        if(data=='ok'){
                         window.location.reload();
                        }
                    })
                }
            })
            
        })     
