<!-- //

function goTo (l) {
	location.href=l;
}

function hideElement(id) {
	var o = document.getElementById(id);
	if(o.style) {
		o.style.display = 'none';
	}
}
function showElement(id) {
	var o = document.getElementById(id);
	if(o.style) {
		o.style.display = '';
	}
}


var from = escape(document.referrer);
var query = location.search;
var colorDepth = window.screen.colorDepth;
var res = window.screen.width + "," + window.screen.height;
document.write("<img src='statystyka/zlicz.php?referer=" + from + "&query=" + query + "&kolory=" + colorDepth + "&rozdzielczosc=" + res + "' align='middle' style='display:none'>");

var okno = null;
function SetCookie(cookieName,cookieValue,nDays) {
 			var today = new Date();
			var expire = new Date();
			if (nDays==null || nDays==0) nDays=1;
				expire.setTime(today.getTime() + 3600000*24*nDays);
			 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
function sprawdzemail(adres)
{
	a = adres.value.search(/@/i);
	a1 = adres.value.substring(0,a);
	a2 = a1.length;
	a = a + 1;
	b = adres.value.indexOf(".");
	b1 = adres.value.substring(a,b);
	b2 = b1.length;
	b = b + 1;
	c = adres.value.length;
	c1 = adres.value.substring(b,c);
	c2 = c1.length;
	if(adres.value.indexOf("@") != "-1" && adres.value.indexOf(".") != "-1" && a2 >= 1 && b2 >= 1 && c2 >= 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function sprawdzemail2(adres)
{
	a = adres.search(/@/i);
	a1 = adres.substring(0,a);
	a2 = a1.length;
	a = a + 1;
	b = adres.indexOf(".");
	b1 = adres.substring(a,b);
	b2 = b1.length;
	b = b + 1;
	c = adres.length;
	c1 = adres.substring(b,c);
	c2 = c1.length;
	if(adres.indexOf("@") != "-1" && adres.indexOf(".") != "-1" && a2 >= 1 && b2 >= 1 && c2 >= 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}
function popup(typ,jezyk,waluta,skad,rent)
{
	width = 355;
	height = 480;
	ScrWidth = 800;
	ScrHeight = 600;
	if(window.screen)
	{
		ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
	}
	PosX = Math.round((ScrWidth - width) / 2);
	PosY = Math.round((ScrHeight - height) / 2);
	switch(typ){
		case 'logowanie':
		okno = window.open("logowanie.php?jezykID="+jezyk+"&waluta="+waluta+"&skad="+skad, "logowanie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'e_haslo':
		okno = window.open("edycja_hasla.php?jezykID="+jezyk+"&waluta="+waluta+"&skad="+skad, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'e_dane':
		okno = window.open("edycja_danych.php?jezykID="+jezyk+"&waluta="+waluta+"&skad="+skad, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'e_waluta':
		okno = window.open("edycja_waluty.php?jezykID="+jezyk+"&waluta="+waluta+"&skad="+skad, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'e_kredyt':
		okno = window.open("edycja_kredyt.php?jezykID="+jezyk+"&waluta="+waluta+"&skad="+skad, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'dojazd_komunikacja':
		okno = window.open("dojazd_komunikacja.php?id="+skad+"&jezykID="+jezyk, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'dojazd_autem':
		okno = window.open("dojazd_autem.php?id="+skad+"&jezykID="+jezyk, "edycja_hasla", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'wyslij_znajomemu':
		okno = window.open("wyslij_znajomemu.php?id="+skad+"&jezykID="+jezyk, "wyslij_znajomemu", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'wyslij_zapytanie':
		okno = window.open("wyslij_zapytanie.php?id="+skad+"&jezykID="+jezyk, "wyslij_znajomemu", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'wyslij_zapytanie2':
		okno = window.open("wyslij_zapytanie.php?id="+skad+"&akcja=wyslij&telefon="+waluta+"&jezykID="+jezyk, "wyslij_znajomemu", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'drzwi_otwarte':
		okno = window.open("drzwi_otwarte.php?id="+skad+"&jezykID="+jezyk, "drzwi_otwarte", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'dodaj_do_aktowki':
		okno = window.open("dodaj_do_aktowki.php?akcja=dodaj&id="+skad+"&jezykID="+jezyk, "dodaj_do_aktowki", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'nieruchomosci_w_okolicy':
		okno = window.open("okoliczne_nieruchomosci.php?id="+skad+"&jezykID="+jezyk+"&rent="+rent, "nieruchomosci_w_okolicy", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=550,left=" + PosX + ",top=" + PosY);
		okno.focus();
		break;
		case 'nieruchomosci_w_okolicy2':
		nieruchomosci_w_okolicy2 = window.open("okoliczne_nieruchomosci2.php?id="+skad+"&jezykID="+jezyk, "nieruchomosci_w_okolicy2", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=550,left=" + PosX + ",top=" + PosY);
		nieruchomosci_w_okolicy2.focus();
		break;
	}

}


function PowiekszZdjecie(url, width, height)
{
	var okno = null;
	if(okno) okno.close();
	ScrWidth = 640;
	ScrHeight = 480;
	if(window.screen)
	{
		ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
	}
	PosX = Math.round((ScrWidth - width) / 2);
	PosY = Math.round((ScrHeight - height) / 2);
	okno = window.open("galeria.php?sciezka="+url, "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width=" + (width+19) + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
	okno.focus();
}

function MM_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}

function flash(id, kolor, czas, kolor2, czas2)
{
	if (document.getElementById)
	{
		document.getElementById(id).style.color = kolor;
		setTimeout('flash("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas);
	}
	else if (document.all)
	{
		document.all[id].style.color = kolor;
		setTimeout('flash("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas);
	}
}
var preload = new Array
preload[0] = new Image()
preload[1] = new Image()
preload[0].src = "l/i/lista/pomoc.gif";
preload[1].src = "l/i/lista/pomoc_r.gif";
function flashimg(id, kolor, czas, kolor2, czas2,id_obrazu, plik1, plik2)
{
	if (document.getElementById)
	{


		preload.src=plik1;
		document.getElementById(id).style.color = kolor;
		document.getElementById(id_obrazu).src=plik1;
		setTimeout('flashimg("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ',"'+id_obrazu+'","'+plik2+'","'+plik1+'")', czas);
	}
	else if (document.all)
	{
		document.all[id].style.color = kolor;
		document.all[id_obrazu].src=plik1;
		setTimeout('flashimg("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ',"'+id_obrazu+'","'+plik2+'","'+plik1+'")', czas);
	}
}

function formatNumber(number)
{
	var num = new NumberFormat();
	num.setInputDecimal('.');
	num.setNumber(number); // obj.value is '-1000.247'
	num.setPlaces('0', false);
	num.setCurrencyValue('$');
	num.setCurrency(false);
	num.setCurrencyPosition(num.LEFT_OUTSIDE);
	num.setNegativeFormat(num.LEFT_DASH);
	num.setNegativeRed(false);
	num.setSeparators(true, ' ', ',');
	return num.toFormatted();

}
function maxlength(el, maxSize)
{
	if (!el.onblur) el.onblur = el.onclick = el.onmousedown = el.onmouseup = el.keypress = el.onkeydown = el.onkeyup = el.onmouseover = el.onmouseout = el.onfocus;
	if (el.value.length < maxSize) el.maxlengthvalue = null;
	else if (el.value.length == maxSize) el.maxlengthvalue = el.value;
	else el.maxlengthvalue = el.value = (el.maxlengthvalue ? el.maxlengthvalue : el.value.substring(0, maxSize));
}
function Trim(STRING){
	STRING = LTrim(STRING);
	return RTrim(STRING);
}

function RTrim(STRING){
	while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
	}
	return STRING;
}


function LTrim(STRING){
	while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
	}
	return STRING;
}

function $(id) {

	return document.getElementById(id);
}

function pokaz_chmurke(e,i,off,rep){
	if (typeof(i) == 'string') {
		i = document.getElementById(i);
		i.style.position = 'absolute';
	}
	else {
		i=i.getElementsByTagName('div');
		i=i[0];
	}
	if (!i.innerHTML) return;
	if (off) {
		i.style.display="none";
	//	document.body.style.cursor="";
	} else {
		if (rep) {
		i.style.top=e.clientY-document.getElementById('page').offsetTop+document.documentElement.scrollTop+3+"px";
		i.style.left=e.clientX-document.getElementById('page').offsetLeft+document.documentElement.scrollLeft+3+"px";
		
		} else {
		i.style.top=e.clientY+document.documentElement.scrollTop+3+"px";
		i.style.left=e.clientX+document.documentElement.scrollLeft+3+"px";
		}
		i.style.display="block";
	}
}

function 	ConvertDistrict(t)
{

	switch(t){
		case"Bialoleka":{return "Białołęka"};
		case"Targowek":{return "Targówek"};
		case"Rembertow":{return "Rembertów"};
		case"Wesola":{return "Wesoła"};
		case"Praga Polnoc":{return "Praga Północ"};
		case"Praga Poludnie":{return "Praga Południe"};
		case"Zoliborz":{return "Żoliborz"};
		case"Srodmiescie":{return "Śródmieście"};
		case"Mokotow":{return "Mokotów"};
		case"Wlochy":{return "Włochy"};
		case"Ursynow":{return "Ursynów"};
		case"Wilanow":{return "Wilanów"};
		case"Poludniowy Wschod":{return "Południowy Wschód"};
		case"Polnocny Wschod":{return "Północny Wschód"};
		case"Polnocny Zachod":{return "Północny Zachód"};
		case"Poludniowy Zachod":{return "Południowy Zachód "};
		default: return t;
	};
}
function showOtherCities(direction, label){
	var t='';
	switch(direction){
		case'N-E':{
			t+= '<br/>'+label+'<br/><input type="checkbox" name="OtherCities" id="Marki"  value="Marki" checked  /><label for="Marki">Marki</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Radzymin" value="Radzymin" checked  /><label for="Radzymin">Radzymin</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Zabki" value="Ząbki" checked  /><label for="Zabki">Ząbki</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Zielonka" value="Zielonka" checked  /><label for="Zielonka">Zielonka</label> <br/>';
		}break;
		case'S-E':{
			t+= '<br/>'+label+'<br/><input type="checkbox" name="OtherCities" id="Jozefow" value="Józefów" checked  /><label for="Jozefow">Józefów</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Konstancin" value="Konstancin-Jeziorna" checked  /><label for="Konstancin">Konstancin - Jeziorna</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Otwock" value="Otwock" checked  /><label for="Otwock">Otwock</label> <br/>';
		}break;
		case'S-W':{
			t+= '<br/>'+label+'<br/><input type="checkbox" name="OtherCities" id="Piaseczno" value="Piaseczno" checked /><label for="Piaseczno">Piaseczno</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="test" value="Testowy" checked  /><label for="test">testowy</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Pruszkow" value="Pruszków" checked  /><label for="Pruszkow">Pruszków</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Raszyn" value="Raszyn" checked  /><label for="Raszyn">Raszyn</label> <br/>';
		}break;
		case'N-W':{
			t+= '<br/>'+label+'<br/><input type="checkbox" name="OtherCities" id="Legionowo" value="Legionowo" checked /><label for="Legionowo">Legionowo</label><br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Lomianki" value="Lomianki" checked  /><label for="Lomianki">Łomianki</label> <br/>';
			t+= '<input type="checkbox" name="OtherCities" id="Zielonka" value="Ożarów Mazowiecki" checked  /><label for="Zielonka">Ożarów Mazowiecki</label> <br/>';
		}break;
		default:'';break;
	}
	return t;
}
// -->
