// BOFHnet rjs@biuro.net.pl

function adClose (div){
	if (document.getElementById)
		document.getElementById(div).style.display = "none";
	else
		document.all.ad.style.visibility = "hidden";
}
function adShow (div){
	if (document.getElementById)
		document.getElementById(div).style.display = "block";
	else
		document.all.ad.style.visibility = "visible";
}
function setCookie(name, value){
	document.cookie= name + "=" + escape(value);
}
function getCookie(name){
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
	{
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
	{
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}

function displayTag (sTag, sDisplay)
{
	aTag = document.getElementsByTagName(sTag);
	for (i=0; i<aTag.length; i++)
	        aTag[i].style.visibility = sDisplay;
}
function showTopLayer(div){
	displayTag("select", "hidden");
	adShow(div);
}
function hideTopLayer(div){
	adClose(div)
	displayTag("select", "visible");
}
//topLayer
var e ;
if (e= document.getElementById('topLayer') && document.getElementById('topLayer').className=="ad")
{
	if (!getCookie('topLayer')){
	    setCookie('topLayer', 'tak');
	    adShow ('topLayer');
	} 
}
function showWindow(sDiv, sClass, sTitle){
	var iHash = sDiv.indexOf('#');
	if (iHash>=0)
        sDiv = sDiv.substr(iHash+1);
	else
	    sDiv = '';
	oDiv = document.getElementById(sDiv);
	oWindow = document.getElementById('SFwindow');
	oContent = document.getElementById('SFwindowContent');
	oTitle = document.getElementById('SFwindowTitle');
	if (oDiv && oWindow && oContent){
	    oContent.innerHTML = oDiv.innerHTML;
	    oWindow.style.display = 'block';
    	displayTag("select", "hidden");
    	oTitle.innerHTML = sTitle;
	    oWindow.className = sClass;
	}
}
function hideWindow(){
    oWindow = document.getElementById('SFwindow');
    oContent = document.getElementById('SFwindowContent');
	oTitle = document.getElementById('SFwindowTitle');
    if (oWindow){
        if (oContent)
            oContent.innerHTML = '';
       	oTitle.innerHTML = '';
        oWindow.style.display = 'none';
       	displayTag("select", "visible");
        oWindow.className = '';
    }
}
