<!-- 
function ustawPole(nazwa,wartosc){
	if(pole = document.getElementById(nazwa))
	{
		pole.value=wartosc;
		return true;
	}
}

function changeLang(url) {
	box = document.getElementById("lang");
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = url+"lang=" + destination;
}

function toggleVisibilityOn(id) {
 elem = document.getElementById(id);
 elem.style.visibility = 'visible';
 }

function toggleVisibilityOff2(id) {
 elem = document.getElementById(id);
 elem.style.visibility = 'hidden';
 }

function toggleVisibilityOff(id) {
	window.setTimeout("toggleVisibilityOff2("+id+")",2000);
 }

	
function select(name,type)
{
	if(type==1)
	{
		var opt = document.getElementById(name).childNodes;
		for(var i = 0 ; i < opt.length ; i++)
		{
			if(opt[i].value!=null)
			{
				opt[i].selected=true;
			}
		}
	}
	else
	{
		var opt = document.getElementsByTagName('option');
		for(var i = 0 ; i < opt.length ; i++)
		{
			if(opt[i].getAttribute("name")==name)
			{
				opt[i].selected=true;
			}
		}
	}
}



function do_select(name)
{
	switch (name)
	{
		case 'groups':
			select('grupy',1);
			break;
		case 'public':
			select('public',2);
			break;
		case 'nonpublic':
			select('nonpublic',2);
			break;
	}
}

function toggleVisibilityById(id) {
	if (document.getElementById(id) == null) return;
	if (document.getElementById(id).style.display == '') {
		document.getElementById(id).style.display = 'none';
} else {
		document.getElementById(id).style.display = '';
	}
	return false;
}


function hideByID(id) {
	document.getElementById(id).style.display = 'none';
	return false;
}

function unhideByID(id) {
	document.getElementById(id).style.display = '';
	return false;
}

function hideElementsByName(t,id) {
	var tags = document.getElementsByTagName(t);
	for (var i = 0; i < tags.length; i++) {
		if(tags[i].getAttribute("name")==id)
		{
				tags[i].style.display = 'none';
		}
	}
	return false;
}

function unhideElementsByName(t,id) {
	var tags = document.getElementsByTagName(t);
	for (var i = 0; i < tags.length; i++) {
		if(tags[i].getAttribute("name")==id)
		{
			tags[i].style.display = '';
		}
	}
	return false;
}

function czyZaznaczono(nazwa,komunikat)
{
	var tags = document.getElementsByTagName('input');
	for (var i = 0; i < tags.length; i++) {
		if(tags[i].getAttribute("name")==nazwa)
		{
				if(tags[i].checked)
				{
					return true;
				}
		}
	}
	if(komunikat!=null)
	{
		alert(komunikat);
	}
	return false;
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function preload(imgObj,imgSrc){
    eval(imgObj+' = new Image()')
    eval(imgObj+'.src = "'+imgSrc+'"')}

function none(){}


// DRUKUJ

function drukuj(){
if (!window.print){
alert("Musisz mieć NS4.x lub IE5,\naby użyć przycisku drukowania!")
return
}
window.print()
window.close()
//history.go(-1)
}



// OKNO
function okno(url) {
    window.open( url, 'Okno', 'width=720,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}
function oknoBar(url) {
    window.open( url, 'Okno', 'width=720,height=600,toolbar=1,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}

//  PODMIANA WARSTW

function toggle_fold(nr,ilosc)  { 
  for (i=1; i<ilosc+1; i++){ eval ("f" + i + ".style.display = 'none'"); }
	eval("f" + nr + ".style.display = ''");
	eval("f" + nr + ".style.position.top = '100'");	
	}
	

function toggle_div3(nr,ilosc) {
  for (i=1; i<ilosc+1; i++){document.getElementById(i).style.display= "none"; }
			document.getElementById(nr).style.display= "";			
}

function toggle_div4(nr,ilosc) {
  for (i=1; i<ilosc+1; i++){document.getElementById(i).style.visibility= "hidden"; }
			document.getElementById(nr).style.visibility= "visible";			
}


function toggle_div1(nr,ilosc) {
  for (i=1; i<ilosc+1; i++){
	eval ("d" + i + ".style.display = 'none'");}
	eval("d" + nr + ".style.display = ''");
}

 function toggle_div(nr,ilosc)  { 
  for (i=1; i<ilosc+1; i++){ eval ("d" + i + ".style.display = 'none'"); }
	eval("d" + nr + ".style.display = ''");
	eval("d" + nr + ".style.position.top = '100'");	
	}

function toggle_div_main_1(nr,ilosc) {
  for (i=1; i<ilosc+1; i++){
			eval("document.nd" + i + ".src = nd" + i + "_off.src");
			document.getElementById(i).style.display= "none";
//			eval("document.d" + i + ".style.display = 'none'");
			}
			document.getElementById(nr).style.display= "";			
  eval("document.nd" + nr + ".src = nd" + nr + "_on.src");
}

function toggle_img(nr,ilosc) {
  for (i=1; i<ilosc+1; i++){
			eval("document.np" + i + ".src = np" + i + "_off.src");}
  eval("document.np" + nr + ".src = np" + nr + "_on.src");
}


function toggle_imgnone(nr,ilosc)  { 
  for (i=1; i<ilosc+1; i++){
			eval("document.np" + i + ".src = np" + i + "_off.src");}
	}


function toggle_none(nr,ilosc)  { 
	window.setTimeout("toggle_div("+ nr +","+ilosc+")",2000);
	}


// LOSOWA PODMIAN ZDJEC W NAGLOWKU

var time = 10000;
function Podmiana() {
  var nr = Math.floor(Math.random() * images) + 1;
	document.photo.src = eval("photo0"+nr+".src");
	window.setTimeout('Podmiana()',time);}



//E-MAILS
function secret(nr) {
switch (nr) {
   case 1: var array=[98,105,117,114,111,64,109,97,114,116,46,103,100,97,46,112,108]; break; //biuro

   
   default: var array=[98,105,117,114,111,64,109,97,114,116,46,103,100,97,46,112,108]; break; //biuro
}
var encrypted='' 
for (var i=0; i<array.length; i++)
encrypted+=String.fromCharCode(array[i])
document.write('<a href="mailto:'+encrypted+'">'+encrypted+'</a>')
}

// MAIL
function msg() {
document.mailer.action = "mailto:" 
mailtoandsubject = ((document.mailer.mailtoperson.options[document.mailer.mailtoperson.selectedIndex].value) + '?subject=' + document.mailer.subject.value);
}

// STYLE MENU
function getObj(id){
  if (document.all) obj = eval ('document.all.' + id);
  else obj = document.getElementById(id);
  return obj;

	}



function setStyle(item,style){

  obj = getObj(item + '_A');  obj.className = style;

  obj = getObj(item + '_TD'); obj.className = style;

	}





//PODMIANA GALERII

function galeria(content){

gallery_content = content;

if (iedom) cross_scroll.style.left=0

	 else ns_scroll.left=0

actualwidth=''

fillup() 

}



// AUTOMATYCZNA PREZENTACJA ZDJEC



function openImage(name,width,height,text){

var autoclose = true

var title =  "INPRO S.A.-mieszkania i apartamenty-Trójmiasto"

winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20

winH = (ns4)? window.innerHeight : document.body.offsetHeight

var windowW=width+100

var windowH=height+150

var windowX = (winW-windowW)/2

var windowY = (winH-windowH)/2



//    NFW = window.open("","popFrameless","fullscreen,width="+windowW+",height="+windowH)

    NFW = window.open("","popFrameless","width="+windowW+",height="+windowH)     

    NFW.blur()

    window.focus()       

    NFW.resizeTo(windowW,windowH)

    NFW.moveTo(windowX,windowY)

    var frameString=""+

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><head><title>"+title+"</title>"+

"<meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-2\">"+

"<link rel=stylesheet type=text/css href=/css/1024.css>"+

"</head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><br><table width=100% cellpadding=2 cellspacing=0 border=0 align=center><tr><td align=center><br><br>"+

"<img src=i/"+name+".jpg width="+width+" height="+height+" border=1 lowsrc=../i/lowsrc.jpg></td></tr><tr><td valign=top><div class=galeria_opis>"+

text+"<div class=navigation>&laquo;&nbsp;<a href=\"javascript:window.close()\" class=none>powrót</a></div></div></td></tr></table></body></html>"

    NFW.document.open();

    NFW.document.write(frameString)

    NFW.document.close()

  

  NFW.focus()   

  if (autoclose){

    window.onunload = function(){NFW.close()}

  }

}





// AUTOMATYCZNA PREZENTACJA ZDJEC

// URL



function openImageURL(name,width,height,text){

var autoclose = true

var title =  "INPRO S.A.-mieszkania i apartamenty-Trójmiasto"

winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20

winH = (ns4)? window.innerHeight : document.body.offsetHeight

var windowW=width+100

var windowH=height+150

var windowX = (winW-windowW)/2

var windowY = (winH-windowH)/2



//    NFW = window.open("","popFrameless","fullscreen,width="+windowW+",height="+windowH)

    NFW = window.open("","popFrameless","width="+windowW+",height="+windowH)     

    NFW.blur()

    window.focus()       

    NFW.resizeTo(windowW,windowH)

    NFW.moveTo(windowX,windowY)

    var frameString=""+

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><head><title>"+title+"</title>"+

"<meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-2\">"+

"<link rel=stylesheet type=text/css href=/css/1024.css>"+

"</head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><br><table width=100% cellpadding=2 cellspacing=0 border=0 align=center><tr><td align=center><br><br>"+

"<img src="+name+" width="+width+" height="+height+" border=1 lowsrc=../i/lowsrc.jpg></td></tr><tr><td valign=top><div class=galeria_opis>"+

text+"<div class=navigation>&laquo;&nbsp;<a href=\"javascript:window.close()\" class=none>powrót</a></div></div></td></tr></table></body></html>"

    NFW.document.open();

    NFW.document.write(frameString)

    NFW.document.close()

  

  NFW.focus()   

  if (autoclose){

    window.onunload = function(){NFW.close()}

  }

}



// AUTOMATYCZNA PREZENTACJA PANORAM



function openPanorama(name,width,height,text){

var autoclose = true

var title =  "INPRO S.A.-mieszkania i apartamenty-Trójmiasto"

winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20

winH = (ns4)? window.innerHeight : document.body.offsetHeight

var windowW=width+100

var windowH=height+120

var windowX = (winW-windowW)/2

var windowY = (winH-windowH)/2



//    NFW = window.open("","popFrameless","fullscreen,width="+windowW+",height="+windowH)

    NFW = window.open("","popFrameless",'width="+windowW+",height="+windowH, scrollBars=1')

//    window.open( url, 'Okno', 'width=720,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');     

    NFW.blur()

    window.focus()      

    NFW.resizeTo(windowW,windowH)

    NFW.moveTo(windowX,windowY)

    var frameString=""+

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><head><title>"+title+"</title>"+

"<meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-2\">"+

"<link rel=stylesheet type=text/css href=../s.css>"+

"</head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><table width=100% cellpadding=2 cellspacing=0 border=0 align=center><tr><tr><td align=center><br><br>"+

"<nobr><img src=i/"+name+".jpg width="+width+" height="+height+" border=0 hspace=20></nobr></td></tr><tr><td valign=top><div class=galeria_opis2>"+text+"<div class=navigation2>&laquo;&nbsp;<a href=\"javascript:window.close()\" class=none>powrót</a></div></div></td></tr></table></body></html>"

    NFW.document.open();

    NFW.document.write(frameString)

    NFW.document.close()

  

  NFW.focus()   

  if (autoclose){

    window.onunload = function(){NFW.close()}

  }

}



//DROP MENU



/***********************************************

* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)

* This notice MUST stay intact for legal use

* Visit http://www.dynamicdrive.com/ for full source code

***********************************************/



var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)

var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)



/////No further editting needed



var ie4=document.all

var ns6=document.getElementById&&!document.all



if (ie4||ns6)

document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')



function getposOffset(what, offsettype){

var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;

var parentEl=what.offsetParent;

while (parentEl!=null){

totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;

parentEl=parentEl.offsetParent;

}

return totaloffset;

}





function showhide(obj, e, visible, hidden, menuwidth){

if (ie4||ns6)

dropmenuobj.style.left=dropmenuobj.style.top=-500

dropmenuobj.widthobj=dropmenuobj.style

dropmenuobj.widthobj.width=menuwidth

if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")

obj.visibility=visible

else if (e.type=="click")

obj.visibility=hidden

}



function iecompattest(){

return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

}



function clearbrowseredge(obj, whichedge){

var edgeoffset=0

if (whichedge=="rightedge"){

var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15

dropmenuobj.contentmeasure=dropmenuobj.offsetWidth

if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)

edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth

}

else{

var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset

var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18

dropmenuobj.contentmeasure=dropmenuobj.offsetHeight

if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?

edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight

if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)

edgeoffset=dropmenuobj.y

}

}

return edgeoffset

}



function populatemenu(what){

if (ie4||ns6)

dropmenuobj.innerHTML=what.join("")

}





function dropdownmenu(obj, e, menucontents, menuwidth){

if (window.event) event.cancelBubble=true

else if (e.stopPropagation) e.stopPropagation()

clearhidemenu()

dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv

populatemenu(menucontents)



if (ie4||ns6){

showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")

dropmenuobj.y=getposOffset(obj, "top")

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"

dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"

}



return clickreturnvalue()

}



function clickreturnvalue(){

if (ie4||ns6) return false

else return true

}



function contains_ns6(a, b) {

while (b.parentNode)

if ((b = b.parentNode) == a)

return true;

return false;

}



function dynamichide(e){

if (ie4&&!dropmenuobj.contains(e.toElement))

delayhidemenu()

else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))

delayhidemenu()

}



function hidemenu(e){

if (typeof dropmenuobj!="undefined"){

if (ie4||ns6)

dropmenuobj.style.visibility="hidden"

}

}



function delayhidemenu(){

if (ie4||ns6)

delayhide=setTimeout("hidemenu()",disappeardelay)

}



function clearhidemenu(){

if (typeof delayhide!="undefined")

clearTimeout(delayhide)

}



/******************************************************************/

function unhideByID(id) {

	document.getElementById(id).style.display = '';

	return false;

}



function hideByID(id) {

	document.getElementById(id).style.display = 'none';

	return false;

}

function zmienStan(id)
{
	toggleVisibilityById(id);
	var value;
	if (document.getElementById(id).style.display == '') {
		value = 'visible';
	} else {
		value = 'hidden';
	}
	return false;
}

/******************************************************************/

function verify() {
var themessage = "Prosimy o uzupełnienie wymaganego pola: ";
if (document.form.nadawca.value=="")
	 {themessage = themessage + "Imię i nazwisko ";}

if (document.form.email.value=="" && document.form.fax.value=="" && document.form.adres_ulica.value=="")
	 {themessage = themessage + "e-mail, faks lub adres korespondencyjny";}

//if (document.form.wyslac.length==0)
//	 {themessage = themessage + "Inwestycja";}

//if (document.form.inwestycja[].value=="")
//	 {themessage = themessage + "Jak± inwestycj± s± Państwo zainteresowani?";}
	 
//if (document.form.wyslac.value=="poczta" && document.form.adres_ulica.value=="")
//{themessage = themessage + "adres korespondencyjny";}

//if (document.form.wyslac.value=="email")
//{themessage = themessage + "adres e-mail na który wysłać dokumenty";}

//if (document.form.wyslac.value=="faks" && document.form.fax.value=="")
//{themessage = themessage + "numer faksu na który wysłać dokumenty";}

if (themessage == "Prosimy o uzupełnienie wymaganego pola: ") {
document.form.submit();
}
else {
alert(themessage);
return false;
   }
}

function checkEmail(from) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form.email.value)){
return (true)
}
alert("Niepoprawny adres e-mail, prosimy o poprawienie.")
return (false)
}

function verifyPropozycjaCeny() {
var themessage = "Prosimy o uzupełnienie wymaganego pola: ";
	if (document.form.cena.value=="")
	{
		themessage = themessage + "proponowana cena,  ";
	}
	if (document.form.nadawca.value=="")
	{
		themessage = themessage + "Imię i nazwisko, ";
	}
	if (document.form.telefon.value=="")
	{
		themessage = themessage + "telefon, ";
	}
	if (document.form.email.value=="")
	{
		themessage = themessage + "e-mail, ";
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form.email.value)))
	{
		themessage = themessage + "e-mail, ";
	}
	if (document.form.zgoda2.checked==false)
	{
		themessage = themessage + "zgoda na przetwarzanie danych osobowych, ";
	}
	if (document.form.dopisz.checked==true && document.form.zgoda1.checked==false)
	{
		themessage = themessage + "zgoda na otrzymywanie informacji handlowych, ";
	}
	if (themessage == "Prosimy o uzupełnienie wymaganego pola: ")
	{
		return true;
	}
	else
	{
		alert(themessage);
		return false;
	}
}


// FLASH NAVIGACJA

function Skocz(n){
 document.FlashMap.TGotoLabel("_level0",n);
 setTimeout('document.FlashMap.Stop();',1000)
}
