
// reads url parameters in the form of ?variable1=mama, is called directly on load to make variable global!!!
DOM = (document.getElementById) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
var loaded = 0;	// to avoid stupid errors of Microsoft browsers
Konqueror = (navigator.userAgent.indexOf("Konqueror") > -1) ? 1 : 0;
// We need to explicitly detect Konqueror
// because Konqueror 3 sets IE4 = 1 ... AAAAAAAAAARGHHH!!!
Opera5 = (navigator.userAgent.indexOf("Opera 5") > -1 || navigator.userAgent.indexOf("Opera/5") > -1 || navigator.userAgent.indexOf("Opera 6") > -1 || navigator.userAgent.indexOf("Opera/6") > -1) ? 1 : 0;
NS=(navigator.userAgent.indexOf("Netscape") > -1 ) ? 1 : 0;
var active=0;



function popUp(menuName,on) {

if (loaded) {	// to avoid stupid errors of Microsoft browsers
	if (on && active!=menuName) {
		if (DOM) {
			document.getElementById(menuName).style.visibility = "visible";
		} else if (NS4) {
			document.layers[menuName].visibility = "show";
		} else {
			
			document.all[menuName].style.visibility = "visible";
			}
		active=menuName;
	} else if (active==menuName || menuName=='flash') {
		if (DOM) {
			document.getElementById(menuName).style.visibility = "hidden";
		} else if (NS4) {
			document.layers[menuName].visibility = "hide";
		} else {
			document.all[menuName].style.visibility = "hidden";
			}
		active=0;
		}
	}
}
function getLayer(name) {
  // Returns a handle to the named layer.
  if (document.layers)
    return(document.layers[name]);
  else if (document.all) {
    layer = eval('document.all.' + name + '.style');
    return(layer);
  }
  else
    return(null);
}






function browser(ie,ns) {
	 if(document.layers) {
		document.write(ns);
	} else if(document.all)
		document.write(ie);
	else
		document.write(ie); 
}




function center_all(menuName) {
if (NS) {
	document.getElementById(menuName).style.left = (window.innerWidth-800)/2;
} else if (DOM) { 
	document.getElementById(menuName).style.left = (document.body.clientWidth-800)/2;
} else if (NS4) {
	document.layers[menuName].left = (screen.availWidth-800)/2;
} else {
	document.all[menuName].style.pixelLeft=(screen.availWidth-800)/2;
	}
}

 function newW(url,width,height)
{
   k=window.open(url,'newWw','toolbar=no,menubar=no,scrollbars=no, resizable=yes,status=no,location=no,directories=no,top=20, left=80,height='+height+',width='+width);
   k.focus();
}

 function newW2(url,width,height)
{
   k=window.open(url,'newWw2','toolbar=no,menubar=no,scrollbars=yes, resizable=yes,status=no,location=no,directories=no,top=20, left=80,height='+height+',width='+width);
   k.focus();
}

function zdjecieW(url,width,height)
{
   k=window.open(url,'newWw','toolbar=no,menubar=no,scrollbars=no, resizable=yes,status=no,location=no,directories=no,top=20, left=80,height='+height+',width='+width);
   k.focus();
}

