<!--

var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());
var cookie_expire_date = new Date(today.getTime() + (8 * 7 * 86400000)); 

function ShowAddLinkAnchor(id, z) { 

	if(document.getElementById(z).style.display=='none'){

		 val = ''; 

		 eval("document.img_" + z + ".src='img/minus.gif';");
		 
	}else{

		 val = 'none';

		 eval("document.img_" + z + ".src='img/plus.gif';");
		 
	}
	
	eval("document.getElementById('A1A" + id + "').style.display='" + val + "';"); 
	eval("document.getElementById('A2A" + id + "').style.display='" + val + "';"); 
	eval("document.getElementById('A3A" + id + "').style.display='" + val + "';"); 
	eval("document.getElementById('" + z + "').style.display='" + val + "';"); 
}

function ShowFormBL(){
	document.getElementById('bl1').style.display='none';
	document.getElementById('bl2').style.display='';
}

function Potwierdz(theLink, theSqlQuery, id){ 

	eval("document.getElementById('TR" + id +"').setAttribute('bgcolor','red');"); 

	if (typeof(window.opera) != 'undefined') return true; 
 
	var is_confirmed = confirm(theSqlQuery); 

	if (is_confirmed){

		eval("document.getElementById('TR" + id +"').setAttribute('bgcolor','#ff6600');"); 

		theLink.href += '&is_js_confirmed=1'; 

	}else eval("document.getElementById('TR" + id +"').setAttribute('bgcolor','#E3E9F1');"); 

	return is_confirmed; 

}

function CLTab(a, b){

	eval("document.getElementById('o" + b + "').style.display='none';");
	eval("document.getElementById('a" + b + "').style.display='none';");
	eval("document.getElementById('u" + b + "').style.display='none';");
	eval("document.getElementById('" + a + b + "').style.display='';");
	
	eval("document.getElementById('tabo" + b + "').className = '';");		
	eval("document.getElementById('taba" + b + "').className = '';");	
	eval("document.getElementById('tabu" + b + "').className = '';");	
	eval("document.getElementById('tab" + a + b + "').className = 'active';");
		
}

function DeleteAndBlock(idp){
	document.forms['bad'].DeleteAndBlock.value = idp;
	document.forms['bad'].submit();
}

function DeleteSL(idl){
	document.forms['deleteslf'].deletesl.value = idl;
	document.forms['deleteslf'].submit();
}

function DeleteSLN(idl, p){
	var answer = confirm("Czy napewno chcesz usunąć " + p + "% stron linkujących?");
	if (answer){
		document.forms['deleteslf'].deleteslproc.value = p;
		document.forms['deleteslf'].deletesl.value = idl;
		document.forms['deleteslf'].submit();
	}
}

function DeleteIDB(idb){
	document.forms['fdb'].DeleteIDB.value = idb;
	document.forms['fdb'].submit();
}

function Notification(idp, url, typ){
	document.forms['not'].WWW.value = url;
	document.forms['not'].IDP.value = idp;
	document.forms['not'].TYP.value = typ;
	document.forms['not'].OPIS.value = '';
	document.getElementById('zglos').style.display='';
}

function InstallTest(idp){
	document.forms['installtest'].TestInstallIDP.value = idp;
	document.forms['installtest'].submit();	
}
function Delete(id){
	document.forms['delete'].deleteidp.value = id;
	document.forms['delete'].submit();	
}
function DeleteLinkAnchor(idl, ida){
	document.forms['deleteanchor'].idl.value = idl;
	document.forms['deleteanchor'].deleteida.value = ida;
	document.forms['deleteanchor'].submit();	
}
function DeleteLink(idl){
	document.forms['delete'].deleteidl.value = idl;
	document.forms['delete'].submit();	
}
function GetNewFile(id, id2){
	document.forms['download'].zipidp.value = id;
	document.forms['download'].zipidp2.value = id2;
	document.forms['download'].ziptype.value = 2;
	document.forms['download'].submit();	
}
function GetFile(id, id2){
	document.forms['download'].zipidp.value = id;
	document.forms['download'].zipidp2.value = id2;
	document.forms['download'].ziptype.value = 1;
	document.forms['download'].submit();	
}
function GetFile2(id){
	document.forms['download'].zipidp.value = id;
	document.forms['download'].ziptype.value = 1;
	document.forms['download'].submit();	
}
function UpDown(from, to, idl){
	document.forms['updown'].from.value = from;
	document.forms['updown'].to.value = to;
	document.forms['updown'].updownidl.value = idl;
	document.forms['updown'].submit();	
}

function ltyp(lid, v){
	eval("document.getElementById('LTYP-" + lid + "').value = '" + v + "';");
}

function lbold(lid, v){
	eval("document.getElementById('FORMAT-" + lid + "').value = '" + v + "';");
}

function lrank(lid, v){
	eval("document.getElementById('RANK-" + lid + "').value = '" + v + "';");
}

function desc2sh(fid, id){

	if(document.getElementById(fid).checked==true) eval("document.getElementById('trdesc2" + id + "').style.display='';"); 
	else eval("document.getElementById('trdesc2" + id + "').style.display='none';"); 

}

function Przelacz(nazwa, i, ile){

	for(n=0;n<ile;n++){

		eval("document.getElementById('SP" + nazwa + n + "').style.fontWeight = 'normal';");

		eval("document.getElementById('SP" + nazwa + n + "').style.color = '#666666';");
	}

	eval("document.getElementById('SP" + nazwa + i + "').style.fontWeight = 'bold';");

	eval("document.getElementById('SP" + nazwa + i + "').style.color = 'blue';");

	eval("document.getElementById('CH" + nazwa + i + "').checked = true;");

}

function ShowLink(z) { 
	if(document.getElementById(z).style.display=='none'){
		 val = ''; 
		 eval("document.img_" + z + ".src='img/minus.gif';");	 
		 Set_Cookie("link"+z , "1" , cookie_expire_date , "/" , false );
		 eval("document.getElementById('" + z + "').style.display='" + val + "';"); 
		 eval("s" + replaceAll(z, "t", "" ) + ".recalculate();");	
		 eval("il" + replaceAll(z, "t", "" ) + ".recalculate();");	
		 eval("ilall" + replaceAll(z, "t", "" ) + ".recalculate();");
	}else{
		 val = 'none';
		 eval("document.img_" + z + ".src='img/plus.gif';");
		 Delete_Cookie("link"+z, "/", false); 
		 eval("document.getElementById('" + z + "').style.display='" + val + "';"); 
	}	
}

function ShowSite(z) { 
	if(document.getElementById(z).style.display=='none'){
		 val = ''; 
		 eval("document.img_" + z + ".src='img/minus.gif';");		 
		 Set_Cookie("site"+z , "1" , cookie_expire_date , "/" , false );
	}else{
		 val = 'none';
		 eval("document.img_" + z + ".src='img/plus.gif';");	 
		 Delete_Cookie("site"+z, "/", false); 
	}	
	eval("document.getElementById('" + z + "').style.display='" + val + "';"); 
}

function Install(z) { 

	if(document.getElementById(z).style.display=='none'){

		 val = ''; 

		 eval("document.img_" + z + ".src='img/install2.gif';");

	}else{

		 val = 'none';

		 eval("document.img_" + z + ".src='img/install.gif';");

	}

	eval("document.getElementById('" + z + "').style.display='" + val + "';"); 

}

 function Get_Cookie(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   return unescape(document.cookie.substring(len,end));
} 
 function Set_Cookie(name,value,expires,path,domain,secure) {
    var cookieString = name + "=" +escape(value) +
       ( (expires) ? ";expires=" + expires.toGMTString() : "") +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ( (secure) ? ";secure" : "");
    document.cookie = cookieString;
}

function Delete_Cookie(name,path,domain) {
   if (Get_Cookie(name)) document.cookie = name + "=" +
      ( (path) ? ";path=" + path : "") +
      ( (domain) ? ";domain=" + domain : "") +
      ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function replaceAll( str, from, to ) {
    var idx = str.indexOf( from );


    while ( idx > -1 ) {
        str = str.replace( from, to );
        idx = str.indexOf( from );
    }

    return str;
}
//-->