//	POZOR: KODOVANI CP1250 !!

//image preload
function newImages(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


function preloadImages() {
	if (document.images) {
		textmenu_1 = newImages(domena+"graphic/menu_1-over.gif");
		textmenu_2 = newImages(domena+"graphic/menu_2-over.gif");
		textmenu_3 = newImages(domena+"graphic/menu_3-over.gif");
		textmenu_4 = newImages(domena+"graphic/menu_4-over.gif");
		textmenu_5 = newImages(domena+"graphic/menu_5-over.gif");
	}
}


function check_form_1() {
	// kontrola formularovych dat - hledam
	// zadny kontakt
	if(self.document.forms.hledam.telefon.value== '' && self.document.forms.hledam.email.value== '') {
		alert('Prosím zanechte nám na sebe nějaký kontakt !');
		document.hledam.telefon.focus();
		return false;
	}
	
	//spatny email
	re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
	if(self.document.forms.hledam.email.value.search(re)!= '0' && self.document.forms.hledam.email.value!= '') {
    	alert('Zkontrolujte správnost emailu !');
    	document.hledam.email.focus();
		return false;
	}
	
	return true;
}

function check_form_2() {
	// kontrola formularovych dat - poslat nabidku na email
	// zadny prijemce
	if(self.document.forms.poslat.komu.value== '') {
		alert('Prosím zadejte emailovou adresu, na kterou si přejete nabídku zaslat.');
		document.poslat.komu.focus();
		return false;
	}
	//spatny prijemce
	re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
	if(self.document.forms.poslat.komu.value.search(re)!= '0' && self.document.forms.poslat.komu.value!= '') {
    	alert('Zkontrolujte správnost emailové adresy příjemce!');
    	document.poslat.komu.focus();
		return false;
	}
	
	// zadny odesilatel
	if(self.document.forms.poslat.email.value== '') {
		alert('Prosím zadejte Vaši emailovou adresu.');
		document.poslat.email.focus();
		return false;
	}
	//spatny odesilatel
	if(self.document.forms.poslat.email.value.search(re)!= '0' && self.document.forms.poslat.email.value!= '') {
    	alert('Zkontrolujte správnost Vaší emailové adresy!');
    	document.poslat.email.focus();
		return false;
	}
	
	return true;
}

function check_form_3() {
	// kontrola formularovych dat - ocenovani
	// zadne jmeno
	if(self.document.forms.ocenovani.jmeno.value== '') {
		alert('Prosím uveďte své jméno !');
		document.ocenovani.jmeno.focus();
		return false;
	}
	// zadny kontakt
	if(self.document.forms.ocenovani.telefon.value== '' && self.document.forms.ocenovani.email.value== '') {
		alert('Prosím zanechte nám na sebe nějaký kontakt !');
		document.ocenovani.telefon.focus();
		return false;
	}
	
	//spatny email
	re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
	if(self.document.forms.ocenovani.email.value.search(re)!= '0' && self.document.forms.ocenovani.email.value!= '') {
    	alert('Zkontrolujte správnost emailu !');
    	document.ocenovani.email.focus();
		return false;
	}
	
	return true;
}

function ShowImg(name) {
 	var rozmery = null
	rozmery = "HEIGHT=768,WIDTH=1000";
	newWindow = window.open("","",rozmery)
	newWindow.moveTo("0","0");
	if (newWindow != null) {

		var newContent = "<html><head><title>" + name + "</title></head>";
			newContent += '<script src="js/js.js" type="text/javascript" language="JavaScript1.5" charset="utf-8"></script>';
			newContent += '<body LEFTMARGIN="0" TOPMARGIN="0">';
			//newContent += '<div class="slideshow_box">SSSS</div>';
			newContent += "<img src='" + name + "' onclick='self.close()' style=cursor:pointer name='foto' title='zavřít okno' onload='resize()'>";
			newContent += "</html>";
			newWindow.document.write(newContent)
			newWindow.document.close()
	}
}
function resize() {
	rx = document.foto.width+5;
	ry = document.foto.height+55;
	if ( rx > screen.width ) rx = screen.width;
	if ( ry > screen.height ) ry = screen.height;
	if ( rx < 200 ) rx = 200;
	if ( ry < 150 ) ry = 150;
	window.resizeTo(rx, ry); // resize window for specific image size
}



