function test1(sdr1) {
  sdr1.style.backgroundColor = "#F8EDBF"
  sdr1.style.cursor = 'hand'    
}
function test2(sdr1) {
  sdr1.style.backgroundColor = "" 
  sdr1.style.cursor = 'hand'  
}
function test4(src) {
//	RequestInfo(src,620,460);
	document.location.href=src;
}

function RequestInfo(adr, w, h) {    
    if (w == 0) w = screen.availWidth * (2/3);
    if (h == 0) h = screen.availHeight * (1/3);
    okno = window.open("","okno","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,dependent=1,hotkeys=0,scrollbars=1,titlebar=0,z-lock=1,width="+w+",height="+h+",left="+(screen.availWidth - w) / 2+",top="+(screen.availHeight - h) / 2);
    okno.resizeTo(w, h + 30);
    okno.document.write("<HEAD><TITLE>Wczytuję serwis...</TITLE></HEAD>");
    okno.document.write('<font size="2" face="Verdana"><CENTER><BIG><B>Wczytuję serwis. Proszę czekać...</B></BIG></CENTER></font>');
    okno.focus();
    okno.location.href=""+adr;
};

function wydrukOferta(src) {
  RequestInfo('/'+src, 580, 450);
}

function checkform (form) {
	
	if(document.forms[form].rodzaj.selectedIndex == 0) {
		alert("Prosze wybrac typ nieruchomości.                           ");
		document.forms[form].rodzaj.focus();
		return false;
	}
	else if(document.forms[form].miasto.value=="") {
		alert("Prosze podac miasto.                           ");
		document.forms[form].miasto.select();
		return false;
	}
	else if(document.forms[form].cena.value=="") {
		alert("Prosze podac cenę.                           ");
		document.forms[form].cena.select();
		return false;
	}
	else if(document.forms[form].imie_i_nazwisko.value=="") {
		alert("Prosze podac swoje imię i nazwisko.                           ");
		document.forms[form].imie_i_nazwisko.select();
		return false;
	}
	else if(document.forms[form].telefon_kontaktowy.value=="") {
		alert("Prosze podac telefon kontaktowy.                           ");
		document.forms[form].telefon_kontaktowy.select();
		return false;
	}
	else if(document.forms[form].email.value=="") {
		alert("Prosze podac adres email.                           ");
		document.forms[form].email.select();
		return false;
	}
      	else if(document.forms[form].email.value!="" && document.forms[form].email.value.indexOf('@', 0) == -1) {
		alert("Prosze podac prawidlowy adres e-mail.                           ");
		document.forms[form].email.select();
		return false;
	}
	else if(document.forms[form].email.value!="" && document.forms[form].email.value.indexOf('.', 0) == -1) {
		alert("Prosze podac prawidlowy adres e-mail.                           ");
		document.forms[form].email.select();
		return false;
	}
	return true ;
}

