function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function Ajax() 
{
    var request = false;
        try {
            request = new ActiveXObject('Msxml2.XMLHTTP');
        }
        catch (err2) {
            try {
                request = new ActiveXObject('Microsoft.XMLHTTP');
            }
            catch (err3){
				try {
					request = new XMLHttpRequest();
				}
				catch (err1) 
				{
					request = false;
				}
            }
        }
    return request;
}


function Abrelink(p,p2,p3,p4,p5,p6){
    xhr = Ajax();
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200){ 
                    var cont = xhr.responseText; 
					 Arr = cont.split("|"); 
				     if (Arr[1] == '0') {
					   NewWindow(Arr[0]+'?pg='+p,'Acesso','580','268','yes');
					   }else{ 
					     if( p2=='L'){
					      document.location=Arr[0]; 
						 }else{ NewWindow(Arr[0]+'?pg='+p,p3,p4,p5,'yes');}
					 }
              }else{
                 xhr.status; }
         }
    }; 
   xhr.open( "GET", "acessolink.asp?dummy="+ Date() +"&Pagina="+p+"&bloqueio="+p6,true); 
   xhr.send(null); 
}