/* -------------------------- */
/*   XMLHTTPRequest Enable    */
/* -------------------------- */
var clientwidth=screen.width;
var clientheight=screen.height;

var winleft=clientwidth/2;
var wintop=clientheight/2;


function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
} else {
request_type = new XMLHttpRequest();
}
return request_type;
}
var http = createObject();
/* -------------------------- */
/*        gH()                */
/* -------------------------- */
function gH(n) 
{
	nocache = Math.random();
	http.open('get', '/ajax.php?&show_rek=17289&urle='+n+'&nocache ='+nocache);
	http.onreadystatechange = oW;
	http.send(null);
}

function oW() 
{
	if(http.readyState == 4) 
	{
	
	var response = http.responseText;
	var parts=new Array();
	parts = response.split(/\|/);
	var loc=new Array();
	loc=parts[0].split(/#/);
	//alert(response); return;
			
			var one=parseInt(loc[3]);
			var two=parseInt(loc[4]);
			var thre=parseInt(loc[5]);
			
			var pos=one+two;
			var tim=0;
			
			if(thre>pos) tim=thre;
			else tim=pos;
			
			var hid = document.createElement("hidden");
			hid.id = "timer";
			hid.value=(tim/1000);
			window.document.body.appendChild(hid);
			
	
		//alert('1 ссылка : '+parts[1]+'\n2 ссылка : '+parts[2]+'\n3 ссылка : '+parts[3]+'\n4 ссылка : '+parts[4]+'\n5 ссылка : '+parts[5]+'\n6 ссылка : '+parts[6]+'\n7 ссылка : '+parts[7]+'\n8 ссылка : '+parts[8]+'\n9 ссылка : '+parts[9]+'\n10 ссылка : '+parts[10]); return;
		
		
		if(parts[1]!="und")
		{
		var nparts=new Array();	
		nparts = parts[1].split(/\*/);
			if(nparts[0]=='0'){
			var lwin=winleft-10;
			var twin=wintop-10;
			p1 = window.open(nparts[1],'wind1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=50,left='+lwin+',top='+twin+',alwaysLowered=yes');
			window.focus();}
			else 
			{
			var iframe = document.createElement("iframe");
			iframe.id = "fr6";
			iframe.frameborder = 1;
			iframe.style.top = '1500px';
			iframe.style.left = '170px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+nparts[1]+"";
			window.document.body.appendChild(iframe);
			setTimeout("cl6()", loc[5])
			}
		}
		else
		{
		var hid1 = document.createElement("hidden");
		hid1.id = "hid1";
		window.document.body.appendChild(hid1);
		}
		
		
		
		
		if(parts[2]!="und")
		{
		var nparts=new Array();	
		nparts = parts[2].split(/\*/);
			if(nparts[0]=='0'){
			var lwin=winleft-30;
			var twin=wintop-30;
			p2 = window.open(nparts[1],'wind2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=50,left='+lwin+',top='+twin+',alwaysLowered=yes');
			window.focus();}
			else 
			{
			var iframe = document.createElement("iframe");
			iframe.id = "fr7";
			iframe.frameborder = 1;
			iframe.style.top = '1500px';
			iframe.style.left = '375px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+nparts[1]+"";
			window.document.body.appendChild(iframe);
			setTimeout("cl7()", loc[5])
			}
		}
		else
		{
		var hid2 = document.createElement("hidden");
		hid2.id = "hid2";
		window.document.body.appendChild(hid2);
		}
		
		
		if(parts[3]!="und")
		{
			var nparts=new Array();	
			nparts = parts[3].split(/\*/);
			if(nparts[0]=='0'){
			var lwin=winleft-50;
			var twin=wintop-50;
			p3 = window.open(nparts[1],'wind3','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=50,left='+lwin+',top='+twin+',alwaysLowered=yes');
			window.focus();}
			else 
			{
			var iframe = document.createElement("iframe");
			iframe.id = "fr8";
			iframe.frameborder = 1;
			iframe.style.top = '1500px';
			iframe.style.left = '580px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+nparts[1]+"";

			window.document.body.appendChild(iframe);
			setTimeout("cl8()", loc[5])
			}
		}
		else
		{
		var hid3 = document.createElement("hidden");
		hid3.id = "hid3";
		window.document.body.appendChild(hid3);
		}
		
		
		if(parts[4]!="und")
		{
			var nparts=new Array();	
			nparts = parts[4].split(/\*/);
			if(nparts[0]=='0'){
			var lwin=winleft-70;
			var twin=wintop-70;
			p4 = window.open(nparts[1],'wind4','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=50,left='+lwin+',top='+twin+',alwaysLowered=yes');
			window.focus();}
			else 
			{
			var iframe = document.createElement("iframe");
			iframe.id = "fr9";
			iframe.frameborder = 1;
			iframe.style.top = '1500px';
			iframe.style.left = '785px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+nparts[1]+"";
			window.document.body.appendChild(iframe);
			setTimeout("cl9()", loc[5])
			}
		}
		else
		{
		var hid4 = document.createElement("hidden");
		hid4.id = "hid4";
		window.document.body.appendChild(hid4);
		}
		
		
		if(parts[5]!="und")
		{
			var nparts=new Array();	
			nparts = parts[5].split(/\*/);
			if(nparts[0]=='0'){
			var lwin=winleft-90;
			var twin=wintop-90;
			p5 = window.open(nparts[1],'wind5','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=50,left='+lwin+',top='+twin+',alwaysLowered=yes');
			window.focus();}
			else 
			{
			var iframe = document.createElement("iframe");
			iframe.id = "fr10";
			iframe.frameborder = 1;
			iframe.style.top = '1500px';
			iframe.style.left = '990px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+nparts[1]+"";
			window.document.body.appendChild(iframe);
			setTimeout("cl10()", loc[5])
			}
		}
		else
		{
		var hid5 = document.createElement("hidden");
		hid5.id = "hid5";
		window.document.body.appendChild(hid5);
		}
		
		var smleft=clientwidth/2-loc[1]/2;
		var smtop=clientheight/2.3-loc[2]/2;
		//alert('left - '+smleft+' top - '+smtop);
		pLoad = window.open(loc[0],'load','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+loc[1]+',height='+loc[2]+',left='+smleft+',top='+smtop+',alwaysRaised=yes');
		
		
		framecode = "<frameset  BORDER='0'><frame src='"+loc[9]+"'></frameset>";
	
	var hidd = document.createElement("hidden");
	hidd.id = "ahr";
	hidd.value=loc[9];
	window.document.body.appendChild(hidd);

		setTimeout("pl(framecode)", pos);	
		setTimeout("b()", loc[3]);
		setTimeout("zap()", tim);
		
			
		if(parts[6]!="und")
		{
			
			var iframe = document.createElement("iframe");
			iframe.id = "fr1";
			iframe.frameborder = 1;
			iframe.style.top = '1700px';
			iframe.style.left = '170px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+parts[6]+"";
			window.document.body.appendChild(iframe);
			pLoad.focus();
			setTimeout("cl1()", loc[5])
		}
		if(parts[7]!="und")
		{
			
			iframe = document.createElement("iframe");
			iframe.id = "fr2";
			iframe.frameborder = 1;
			iframe.style.top = '1700px';
			iframe.style.left = '375px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+parts[7]+"";
			window.document.body.appendChild(iframe);
			pLoad.focus();
			setTimeout("cl2()", loc[5])
		}
		if(parts[8]!="und")
		{
			
			iframe = document.createElement("iframe");
			iframe.id = "fr3";
			iframe.frameborder = 1;
			iframe.style.top = '1700px';
			iframe.style.left = '580px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+parts[8]+"";
			window.document.body.appendChild(iframe);
			pLoad.focus();
			setTimeout("cl3()", loc[5])
		}
		if(parts[9]!="und")
		{
			
			iframe = document.createElement("iframe");
			iframe.id = "fr4";
			iframe.frameborder = 1;
			iframe.style.top = '1700px';
			iframe.style.left = '785px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+parts[9]+"";
			window.document.body.appendChild(iframe);
			pLoad.focus();
			setTimeout("cl4()", loc[5]);
		}
		if(parts[10]!="und")
		{
			
			iframe = document.createElement("iframe");
			iframe.id = "fr5";
			iframe.frameborder = 1;
			iframe.style.top = '1700px';
			iframe.style.left = '990px';
			iframe.height = loc[8]+'px';
			iframe.width = loc[7]+'px';
			iframe.style.position = "absolute";
			iframe.style.display = loc[6];
			iframe.scrolling = "auto";
			iframe.src = ""+parts[10]+"";
			window.document.body.appendChild(iframe);
			pLoad.focus();
			setTimeout("cl5()", loc[5])
		}
		
	}
}

function b()
{
pLoad.focus();	
h1=document.getElementById('hid1');
h2=document.getElementById('hid2');
h3=document.getElementById('hid3');
h4=document.getElementById('hid4');
h5=document.getElementById('hid5');

if(!h1) p1.close(); else document.body.removeChild(h1);
if(!h2) p2.close(); else document.body.removeChild(h2);
if(!h3) p3.close(); else document.body.removeChild(h3);
if(!h4) p4.close(); else document.body.removeChild(h4);
if(!h5) p5.close(); else document.body.removeChild(h5);
}



function pl(aaa)
{
	pLoad.focus();
	var t = document.getElementById("timer");
	var ahr = document.getElementById("ahr");
	pLoad.document.open();
	pLoad.document.write(aaa);
	pLoad.document.close();	
	document.body.removeChild(t);
	document.body.removeChild(ahr);

}
function zap()
{
var s='';
for ( i=0; i < document.links.length; i++ ){
s +='<a href="' + document.links[i].href + '">\n';}
document.getElementById('pars').value=s;
//document.pr.submit();
}

function cl1()
{

var t = document.getElementById("fr1");	
document.body.removeChild(t);
}
function cl2()
{
var t = document.getElementById("fr2");	
document.body.removeChild(t);
}
function cl3()
{
var t = document.getElementById("fr3");	
document.body.removeChild(t);
}
function cl4()
{
var t = document.getElementById("fr4");	
document.body.removeChild(t);
}
function cl5()
{
var t = document.getElementById("fr5");	
document.body.removeChild(t);
}
function cl6()
{
var t = document.getElementById("fr6");	
document.body.removeChild(t);
}
function cl7()
{
var t = document.getElementById("fr7");	
document.body.removeChild(t);
}
function cl8()
{
var t = document.getElementById("fr8");	
document.body.removeChild(t);
}
function cl9()
{
var t = document.getElementById("fr9");	
document.body.removeChild(t);
}
function cl10()
{
var t = document.getElementById("fr10");	
document.body.removeChild(t);
}
function delVIP()
{
if(confirm('Вы действительно хотите безвозвратно удалить данного пользователя? \nДанную операцию нельзя вернуть!'))
location.href="/admin.php?mod=regvip&delvip="+document.getElementById('vip_users').value;
}
function perevodVIP()
{
location.href="/admin.php?mod=regvip&perevodvip="+document.getElementById('vip_users').value;
}
function closeVIP()
{
location.href="/admin.php?mod=regvip";
}
function addVIP()
{
location.href="/admin.php?mod=regvip&makevip="+document.getElementById('all_users').value;
}

