var prox;
var proy;
var proxc;
var proyc;
var isIe=(document.all)?true:false;

function setSelectState(state)
{
    var objl=document.getElementsByTagName('select');
    for(var i=0;i<objl.length;i++)
    {
        objl[i].style.visibility=state;
    }
}

//关闭窗口
function closeWindow()
{
    if(document.getElementById('back')!=null)
    {
        document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
    }
    if(document.getElementById('mesWindow')!=null)
    {
        document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
    }
    if(isIe)
    {
        setSelectState('');
    }
}
/*--打开Div--*/
/*参数说明：id是div的ID、divWidth是弹出层的宽度、divHeight是弹出层的高度*/
function show(id,divWidth,divHeight)
{
    closeWindow();
    var bWidth = parseInt(document.body.scrollWidth);
    var bHeight;
    if(isIe)
    {
		bHeight=parseInt(document.body.scrollHeight);
        setSelectState('');
    }else bHeight=parseInt(document.body.scrollHeight);
    var back=document.createElement("div");
    back.id="back";
    var styleStr="top:0px;left:0px;position:absolute;background:#D9D9D9;width:"+bWidth+"px;height:"+bHeight+"px;";
    styleStr+=(isIe)?"filter:alpha(opacity=40);":"opacity:0.40;";
    back.style.cssText=styleStr;
    document.body.appendChild(back);
    var o = document.getElementById(id);
        o.style.display = "block";
        o.style.width = "1px";
        o.style.height = "1px";
        prox = setInterval(function(){openx(o,divWidth,divHeight)},10);
  
} 

/*--打开x--*/
function openx(o,openWidth,openHeight)
{
    
        var cx = parseInt(o.style.width);
        if(cx < openWidth)
        {
            o.style.width = (cx + Math.ceil((openWidth-cx)/1)) +"px";
        }
        else
        {
            clearInterval(prox);
            proy = setInterval(function(){openy(o,openHeight)},10);
        }
    }    
function openy(o,c){/*--打开y--*/    
    
    var cy = parseInt(o.style.height);
    if(cy < c)
    {
        o.style.height = (cy + Math.ceil((c-cy)/10)) +"px";
    }
    else
    {
        clearInterval(proy);            
    }
}    
  
/*--关闭Div--*/
function closeed(id)
{
 closeWindow();
    clearInterval(prox);
    clearInterval(proy);
    clearInterval(proxc);
    clearInterval(proyc);        
    var o = document.getElementById(id);
    if(o.style.display == "block")
    {
        proyc = setInterval(function(){closey(o)},10);            
    }        
}  
/*--关闭y--*/  
function closey(o)
{    
    var cy = parseInt(o.style.height);
    if(cy > 0)
    {
        o.style.height = (cy - Math.ceil(cy/10)) +"px";
    }
    else
    {
        clearInterval(proyc);                
        proxc = setInterval(function(){closex(o)},10);
    }
} 
/*--打开x--*/   
function closex(o)
{
    clearInterval(proxc);
    o.style.display = "none";
}
//--------------------------------
function    getAbsPoint(e)   
{   
     var    x    =    e.offsetLeft,    y    =    e.offsetTop;   
     while(e=e.offsetParent) 
     { 
        x    +=    e.offsetLeft;   
        y    +=    e.offsetTop;
     } 
     alert("x:"+x+","+"y:"+y);   
}  


   function    getAbsPoint1(obj)   
   {   
      var    x,y;   
      oRect    =    obj.getBoundingClientRect();   
     x=oRect.left   
     y=oRect.top   
     alert("("+x+","+y+")")   
   }  
 


//--------------------------------
function jsb5(str){
	if(document.getElementById(str).style.display=="none"){
		document.getElementById(str).style.display="";
	}
	else{
		document.getElementById(str).style.display="none";
	}
	     
}
