
var x = 40;
var y = 70;

function closePopUp(obj)
{
	
	obj = document.getElementById(obj);
	obj.style.visibility = 'hidden';
	
}

function setVisible(obj,prod)
{
       
		obj = document.getElementById(obj);
       if (obj == undefined) {
    	   return false
       }
		obj.style.visibility = 'visible';
       
}

function placeIt(obj)
{
       obj = document.getElementById(obj);
       if (obj == undefined) {
    	   return false
       }
       
       if (document.documentElement)
       {
    	   
               theLeft = document.documentElement.scrollLeft;
               theTop = document.documentElement.scrollTop;
               
       }
       else if (document.body)
       {
    	   
               theLeft = document.body.scrollLeft;
               theTop = document.body.scrollTop;
               
       }
       theLeft += x;
       theTop += y;
       obj.style.left = theLeft + 90 + 'px' ;
       obj.style.top = theTop + (-40) + 'px' ;
       //setTimeout("placeIt('layer1');",90);
       
       //placeIt('layer1');
}

function placeIt2(obj)
{
       obj = document.getElementById(obj);
       if (obj == undefined) {
    	   return false
       }
       
       
       if (document.documentElement)
       {
    	   
               theLeft = document.documentElement.scrollLeft;
               theTop = document.documentElement.scrollTop;
               
       }
       else if (document.body)
       {
    	   
               theLeft = document.body.scrollLeft;
               theTop = document.body.scrollTop;
               
       }
       theLeft += x;
       theTop += y;
       obj.style.left = theLeft + 200 + 'px' ;
       obj.style.top = theTop + (-60) + 'px' ;
       //setTimeout("placeIt2('zoom');",90);
       
       
       //placeIt('layer1');
}

function placeIt3IExplorer(obj)
{
       obj = document.getElementById(obj);
       obj2 = document.getElementById('apDivHeader1');
    	   
       if (obj == undefined || obj2 == undefined) {
    	   return false
       }
       
       
       if (document.documentElement)
       {
    	   
               theLeft = document.documentElement.scrollLeft;
               //theTop = document.documentElement.scrollTop;
               
       }
       else if (document.body)
       {
    	   
               theLeft = document.body.scrollLeft;
               //theTop = document.body.scrollTop;
               
       }
       theLeft += x;
       //theTop += y;
       obj.style.left = (document.documentElement.clientWidth/2) + 270  + 'px' ;
       obj2.style.left = (document.documentElement.clientWidth/2) + 290  + 'px' ;
       
       //obj.style.left = (document.documentElement.clientWidth/2)  + 'px' ;
       //obj2.style.left = (document.documentElement.clientWidth/2) + 'px' ;
       
       //obj.style.top = theTop + (-60) + 'px' ;
       //setTimeout("placeIt3IExplorer('apDivHeader2');",90);
       
       
       //placeIt('layer1');
}

//window.onScroll = setTimeout("placeIt('layer1');",90);
//setTimeout("placeIt3IExplorer('apDivHeader2');",0);

function desplazaPopUps()
{
	
	setTimeout("placeIt('layer1');",90);
	setTimeout("placeIt2('zoom');",90);
	//alert(document.documentElement. clientWidth);
	
	//placeIt("layer1");
		
}

if( BrowserDetect.browser.toString() == "Explorer" )
{
	
	//window.onscroll = desplazaPopUps();
	
}
//En Firefox primero se debe de ajustar el layer1, y posteriormente ambos.
if( BrowserDetect.browser.toString() == "Firefox" )
{
	
	window.onscroll = setTimeout("placeIt('layer1');",90);
	window.onscroll = desplazaPopUps();
	
}


//window.onScroll = setTimeout("placeIt('layer1');",90);
//window.onscroll = setTimeout("placeIt2('zoom');",90);
//window.onscroll = desplazaPopUps();


//window.onscroll = placeIt('layer1');
//-->
