nn4=(document.layers) ? true : false;
ie4=(document.all) ? true : false;Nowe=null;

function setHidden(me) {
	me.style.visibility='hidden';
}

function ri(w,s,zmienne) {
		if (Nowe) {
			if (ie4) Nowe.close();
			else if (nn4) Nowe.closed;
			Nowe=null
		};
		Nowe=window.open("ri.php?"+zmienne, "popUp","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=s,height=w,screenX=150,screenY=150,top=150,left=150");
		Nowe.resizeTo(w,s);
		Nowe.focus();
	}
	
function oblicz_cene(w,s,zmienne) {
	if (Nowe) {
		if (ie4) Nowe.close();
		else if (nn4) Nowe.closed;
		Nowe=null
	};
	Nowe=window.open("oblicz_cene.php?"+zmienne, "popUp","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=s,height=w,screenX=150,screenY=150,top=150,left=150");
	Nowe.resizeTo(w,s);
	Nowe.focus();
}
function otworz_popup(w,s,src) {
            if (Nowe) {
                if (ie4) Nowe.close();
            	else if (nn4) Nowe.closed;
                Nowe=null
            };
            Nowe=window.open("popup_image.php?p="+src, "popUp","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=50,left=50");                
            Nowe.focus();
        }


function otworz_popup_mapa(ido, lang) {
            if (Nowe) {
                if (ie4) Nowe.close();
            	else if (nn4) Nowe.closed;
                Nowe=null
            };
            Nowe=window.open("gmapka.php?ido="+ido+"&lang="+lang, "popUp","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=620,height=505,screenX=150,screenY=150,top=50,left=50");                
            Nowe.focus();
        }
        
function dymek(tekst, wersjaKolorystyczna) {
    return overlib( tekst,
//                    BGCOLOR,'#F37B00',
//                    BGCOLOR,'#FFFFFF',
//                    FGCOLOR,'#13557e',
//                    TEXTCOLOR,'#ffffff',
                    BGCOLOR,'#000000',
                    FGCOLOR,'#FFFFFF',
                    TEXTCOLOR,'#000000',
                    HAUTO,
                    VAUTO);    
}

function NewWindow(mypage,myname,w,h,scroll) {
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  	settings = 'height=' +h+',width=' +w+',top=' +TopPosition+',left=' +LeftPosition+',scrollbars=' +scroll+ ',resizable';
	win = window.open(mypage,myname,settings)
	if(win.window.focus) {
		win.window.focus();
	}
}

function makeLink(){
	var url = window.prompt("podaj adres URL", "http://");
	var link = window.prompt("podaj tekst linku");
	var newWindow = window.confirm("czy otiwerac link w nowym oknie?");
	return '<a href="'+url+'" '+(newWindow ? 'target="_top"' : '')+' >'+link+'</a>';
}

var d = document;

function hideC(id) {	
	id = (id?id:"kpconsole");	
	var layer = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	layer.style.display = 'none';
}

function showC(id) {
	id = (id?id:"kpconsole");
	var layer = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	layer.style.display = 'block';
}