var isIe=(document.all)?true:false;
var stopFlag=1;
var itvA;
function setSelectState(state)
{
   var objl=document.getElementsByTagName('select');
   for(var i=0;i<objl.length;i++)
      objl[i].style.visibility=state;
}

function slowShowGround(obj,endInt)
{
if(stopFlag==1)
{
  if(isIe)
    {
       obj.filters.alpha.opacity+=20;
       if(obj.filters.alpha.opacity<endInt)
       setTimeout(function(){slowShowGround(obj,endInt)},2);
    }
  else
    {
       var al=parseFloat(obj.style.opacity);al+=0.01;
       obj.style.opacity=al;
       if(al<(endInt/100))
       setTimeout(function(){slowShowGround(obj,endInt)},2);
    }
}

}

function cancleXP(lightobj,overobj)
{
     stopFlag=0; 
	 document.getElementById(overobj).filters.alpha.opacity=0;
     document.getElementById(lightobj).style.display='none';
     document.getElementById(overobj).style.zIndex=-1;
	 window.clearInterval(itvA);
     if(isIe)
       setSelectState('');
}

function closeXP(lightobj,overobj)
{
   // document.body.style.height='100%';
	stopFlag=1;
    var objL=document.getElementById(lightobj);
    var objO=document.getElementById(overobj);
    if(isIe)
      setSelectState('hidden');
    objL.style.display='block'
	var canSeenWidth=document.body.clientWidth;
	var canSeenHeight=document.body.clientHeight;
	var canSeenWfield=document.body.scrollWidth;
	var canSeenHfield=document.body.scrollHeight;
	objL.style.left=document.body.scrollLeft+canSeenWidth/2-parseInt(objL.style.width)/2+'px';
	objL.style.top=document.body.scrollTop+canSeenHeight/2-parseInt(objL.style.height)/2+'px';
	itvA=window.setInterval(function(){followScroll(objL)},100);
	objO.style.height=canSeenHfield+'px';
	objO.style.width=canSeenWfield+'px';
	objO.style.zIndex=90;
	slowShowGround(objO,60);
}
function followScroll(obj)
{
    //alert(1);
	var canSeenWidth=document.body.clientWidth;
	var canSeenHeight=document.body.clientHeight;
	obj.style.left=document.body.scrollLeft+canSeenWidth/2-parseInt(obj.style.width)/2+'px';
    obj.style.top=document.body.scrollTop+canSeenHeight/2-parseInt(obj.style.height)/2+'px';
	//document.getElementById('mytext').value=document.documentElement.scrollLeft+" "+document.documentElement.scrollTop
}