function mOvr(src,clrOver) {
  if (!src.contains(event.fromElement)) {
	   src.style.cursor = 'hand';
		 src.bgColor = clrOver;
	}
}

function mOut(src,clrIn) {
  if (!src.contains(event.toElement)) {
	   src.style.cursor = 'default';
		 src.bgColor = clrIn;
	}
}

function mClk(src) {
    if(event.srcElement.tagName=='TD'){
      src.children.tags('A')[0].click();
		}
}

function menu_alte(targ,selObj,restore){
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
}

function menu() {
   location=document.form_menu.select_menu.options[document.form_menu.select_menu.selectedIndex].value
}

function Aktywne(what){
     if(!document.layers){
          what.style.backgroundColor='#E1E6EB'
          what.style.color='#000000'
     }
}

function NieAktywne(what){
     if(!document.layers){
         what.style.backgroundColor='#EEF0F2'
         what.style.color='#4D5E74'
     }
}

nn = (document.layers) ? true:false;
ie = (document.all) ? true:false;
ie5 = false;
if (ie)  if (navigator.userAgent.indexOf('MSIE 5')>0 || navigator.userAgent.indexOf('MSIE 6')>0)      ie5 = true;

var xInfo = 0, yInfo = 0;
function setPositon(evt){
     if(nn){
          xInfo=evt.pageX;yInfo=evt.pageY;
     }
     if(ie){
          xInfo=event.x;yInfo=event.y;}
     if(ie5){
          xInfo=event.x+document.body.scrollLeft;yInfo=event.y+document.body.scrollTop;
     }
     xInfo+=-415; yInfo+=15;
}
if (nn)  document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = setPositon;


function layerMove(layerName, x, y){
     if(nn){document.layers[layerName].left=x;document.layers[layerName].top=y;
     }
     else if(ie){
     document.all[layerName].style.left=x;document.all[layerName].style.top=y;
     }
}

function layerShow(layerName){
     if (ie||nn){
          with(ie?document.all[layerName].style:document[layerName])visibility='visible';
     }
}

function layerHide(layerName){
     if (ie||nn){
          with(ie?document.all[layerName].style:document[layerName])visibility='hidden';
     }
}

function infoLayerName(infoNr){
     return "inf"+infoNr;
}

function showInfo(infoNr){
     id=infoLayerName(infoNr); layerShow(id); layerMove(id, xInfo, yInfo);
}

function hideInfo(infoNr){
     id=infoLayerName(infoNr); layerHide(id);
}

function makeInfo(tableWidth){
     for (i=1; i<=infoQty; i++){
          id=infoLayerName(i);  str="<DIV class=\"inf\" ID=\""+id+"\"><table width=\""+tableWidth+"\" border=0 cellspacing=0 cellpadding=10 class=\"ramka_2px_kolor_02_na_bialym\"><tr><td class=\"kolor_02\"><b>"+info[i]+"</b></td></tr></table></DIV>";
          document.write(str);
     }
}

function newSimpleWindow(theURL,winName,features){
     window.open(theURL,winName,features);
}

var win= null;
function newWindow(mypage,myname,w,h,scroll)
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ="height="+h+",";
	settings +="width="+w+",";
	settings +="top="+wint+",";
	settings +="left="+winl+",";
	settings +="scrollbars="+scroll+",";
	settings +="resizable=yes";
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function newBigWindow(url){
     var Height = screen.availHeight-75;
     window.open(url,'','width=620,height='+ Height+', left=10, top=10, scrollbars=yes, resizable=yes, menubar=no');
}

function newMaxWindow(url){
     var width = screen.availWidth - 30;
     var height = screen.availHeight - 30;
     window.open(url, '', 'width=' + width + ', height=' + height + ', left=0, top=10, scrollbars=yes, resizable=yes');
}

function McH_over (objName){
     var obj=McH_seekObj(objName);
     if (obj && document.images){ obj.src = eval (objName + "OVER.src");}
}

function McH_off (objName){
     var obj=McH_seekObj(objName);
     if (obj && document.images){ obj.src = eval (objName + "OFF.src");}
}

function McH_seekObj(name, docDir){
	var place,i,obj;
 	place=name.indexOf("?"); 
	if(!docDir) docDir=document;
	if( place > 0 && parent.frames.length) {
		docDir=parent.frames[name.substring(place+1)].document;
		name=name.substring(0,place);
	}
	if(!(obj=docDir[name]) && docDir.all) obj=docDir.all[name]; 
	for (i=0 ; !obj && i < docDir.forms.length ; i++) obj=docDir.forms[i][name];
	for (i=0 ; !obj && docDir.layers && i < docDir.layers.length ; i++) obj=McH_seekObj(name,docDir.layers[i].document);
	return obj;
}

noweOkienko = null;
function okienko(src, w, h){
	if(window.screen){
		aw=screen.availWidth;
		ah=screen.availHeight;
	}
	else{
		aw=640;
		ah=450;
	}
	if(noweOkienko==null || noweOkienko.closed){
		ustawienia=
		"left=" + (aw-w)/2 + ","
		+"top=" + (ah-h)/2 + ","
		+"screenX=" + (aw-w)/2 + ","
		+"screenY=" + (ah-h)/2 + ","
		+"width=" + w + ","
		+"height=" + h + ","
		+"innerWidth=" + w + ","
		+"innerHeight=" + h + ","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=no,"
		+"menubar=no,"
		+"scrollbars=no,"
		+"resizable=no"
		noweOkienko = window.open("",'Obrazek',ustawienia);
	}
	noweOkienko.document.open();
	noweOkienko.document.clear();
	noweOkienko.document.write(
	"<html><head>\n"
	+"<style><!--\n"
	+"body{background-repeat:no-repeat}\n"
	+"--></style>\n"
	+"</head>\n"
	+"<body background=\"" + src + "\">\n"
	+"</body></html>"
	);
	noweOkienko.document.close();
	noweOkienko.focus();
}

function which_Browser() {
	d=document;
	this.agt=navigator.userAgent.toLowerCase();
	this.major=parseInt(navigator.appVersion);
	this.dom=(d.getElementById);
	this.ns=(d.layers);
	this.ns4up=(this.ns && this.major>=4);
	this.ns6=(this.dom&&navigator.appName=="Netscape");
	this.op=(window.opera);
	if(d.all)this.ie=1;else this.ie=0;
	this.ie4=(d.all&&!this.dom);
	this.ie4up=(this.ie&&this.major>=4);
	this.ie5=(d.all&&this.dom);
	this.ie6=(d.nodeType);
	this.sf=(this.agt.indexOf("safari")!=-1);
	this.win=((this.agt.indexOf("win")!=-1)||(this.agt.indexOf("16bit")!=-1));
	this.winme=(this.agt.indexOf("win 9x 4.90")!=-1);
	this.xpsp2=(this.agt.indexOf("sv1")!=-1);
	this.mac=(this.agt.indexOf("mac")!=-1);
}
var oBw=new which_Browser(); 

function toggleInstructions() {
	if(oBw.ie5||oBw.ns6) {
    	Istate = top.document.getElementById('instructions').style.display;
    		if (Istate=='none') {
      			Istate='block';
    		}
    		else {
      			Istate='none';
    		}
    	top.document.getElementById('instructions').style.display=Istate;
  	}
}

function toggleInstructionsOn() {
	if(oBw.ie5||oBw.ns6){  //Disable function in unsupported browsers
    	Istate = top.document.getElementById('instructions').style.display;
    		if (Istate=='none') {
      			Istate='block';
    		}
    		else {
      			Istate='block';
    		}
    	top.document.getElementById('instructions').style.display=Istate;
	}
}

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function hidelayer(lay) {
	if (ie4) {document.all[lay].style.visibility = "hidden";}
	if (ns4) {document.layers[lay].visibility = "hide";}
	if (ns6) {document.getElementById([lay]).style.display = "none";}
}

function showlayer(lay) {
	if (ie4) {document.all[lay].style.visibility = "visible";}
	if (ns4) {document.layers[lay].visibility = "show";}
	if (ns6) {document.getElementById([lay]).style.display = "block";}
}