
// Archivo JScript
function Request(url,e,params)
{
    
    var xmlHttp;
    try
    {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
             xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(E)
        {
            xmlHttp = false;
        }
    }

    if(!xmlHttp && typeof XMLHttpRequest!='undefined')
    {
        xmlHttp = new XMLHttpRequest();
    }
    
    xmlHttp.onreadystatechange=function()
    {
         
        if(xmlHttp.readyState==4)
        {
            
           
            var h1 = document.createElement("h1");
            h1.innerHTML = xmlHttp.responseText;
            var x = h1.getElementsByTagName("script"); 
	        for( var i=0; i < x.length; i++) 
	        {
		        eval(x[i].text);
	        }
	        
            e(xmlHttp.responseText);
        }
    }

    xmlHttp.open("Post",url,true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(params);  
}

function res()
{    
   var myWidth=0;
   var myHeight=0;
  
    if( typeof( window.innerWidth ) == 'number' ) {
    
      
      myWidth = window.innerWidth;
      myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
       
       
         myWidth = document.documentElement.clientWidth;
         myHeight = document.documentElement.clientHeight;
      
     } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        
        myWidth = document.body.clientWidth+10;
        myHeight = document.body.clientHeight;
     }
     
     myWidthFs = myWidth;
     myHeightFs = myHeight;
            
   
	if (myWidth/ myHeight > 1.8) 
	{
		myWidth = myHeight* 1.8
	}
	
    
    if (screen.availWidth<640) {
      if (myWidth<=320) {
          myWidth=320;
      }
    }
    
    else if (myWidth<1012) {
      myWidth=1020;
      
    }
   
     if(myWidth>1260) {    myWidth=1260;    }
  
    if (myWidth>myWidthFs)
        myWidthFs = myWidth;
    
    if (myHeight>myHeightFs)
        myHeightFs = myHeight;
    //1260
	
	
	
    Request('/ccode/res.aspx',Respuesta,'parpanc='+Math.ceil(myWidth)+'&parpalt='+Math.ceil(myHeight)+'&parpancFS='+Math.ceil(myWidthFs)+'&parpaltFS='+Math.ceil(myHeightFs));
}

function Respuesta(s)
{

    if(s=='RELOAD') location.reload(true);//window.open(document.location,'_self');
	
}	


function RespuestaVacia(s){}


res();