//villa-severka.sk

function kontrola(form){
if(form.osoby.value == "") {
	alert ("Nezadali ste počet osôb \nPlease insert number of persons");
	form.osoby.focus();
	return false;
}else if(form.priez.value == "" ){
	alert("Nezadali ste  priezvisko \nPlease insert your surname");
	form.priez.focus();
	return false;
}else if(form.meno.value == "" ){
	alert("Nezadali ste  meno \nPlease insert your first name");
	form.meno.focus();
	return false;
}else if(form.ulica.value == "" ){
	alert("Nezadali ste ulicu \nPlease insert your street");
	form.ulica.focus();
	return false;
}else if(form.mesto.value == "" ){
	alert("Nezadali ste mesto \nPlease insert your town");
	form.mesto.focus();
	return false;
}else if (form.email.value == "" || form.email.value.indexOf('@')== -1 || form.email.value.indexOf('.')== -1){
	alert("Nezadali ste  emailovú adresu \nPlease insert valuable email address");
	form.email.focus();
	return false;
}else if(form.tel.value == "" ){
	alert("Nezadali ste  telefonický kontakt \nPlease insert your phone number");
	form.tel.focus();
	return false;
}else if(form.as_pict.value == "" ){
	alert("Nezadali ste kod \nPlease insert code from image");
	form.as_pict.focus();
	return false;

}

else {
decision= confirm("Sú tieto údaje správne	(Are these data right)?\n\n" +
"Datum od (Date FROM):\t" + form.datod.value + "\n" +
"Datum do (Date TO):\t" + form.datdo.value + "\n" +
"Meno (Name):\t\t" + form.meno.value + " " + form.priez.value+"\n" +
"Apartman (Apartament):\t " + form.apart.value + "\n"  +
"Počet osob/deti(Number of persons/children):\t " + form.osoby.value + "/"+ form.osoby5.value + "\n"  +
"Telefón (Phone):\t" + form.tel.value + "\n" +
"Email(Email):\t\t" + form.email.value + "\n" + 
"Adresa(Address):\t" + form.ulica.value + ","+ form.mesto.value + 
","+ form.psc.value + ","+ form.stat.value +"\n" +
"Potvrdenie objednavky( Confirm reservation through): " + form.potvrd.value + "\n" +
"Poznámka (Special requests):\t" + form.pozn.value +"\n" +
"Kod z obrazka (Code from image): " + form.as_pict.value
);

if (!decision	) { return false;}
else {form.submit();}
}

}


//centered windows
function vix(ifile,ititle, ix,iy) {
  var win;
  win = window.open("","","width=200,height=200,resizable=1");
  win.document.open();
  
  
  win.document.write("<html><head><title>"+ititle+"</title>");
  //win.document.write('<link rel="stylesheet"  type="text/css" href=".css" />');
  win.document.write("</head><body style='background-color:#000;margin:0;padding:0;' ><div style='text-align:left'>");
  win.document.write("<img src='"+ifile+"' width='"+ix+"' height='"+iy+"'></div></body></html>");
  
  var NS = (navigator.appName=="Netscape")?true:false; 
  
  iWidth = (NS)?win.innerWidth:win.document.body.clientWidth; 
  iHeight = (NS)?win.innerHeight:win.document.body.clientHeight; 
  iWidth = win.document.images[0].width - iWidth; 
  iHeight = win.document.images[0].height - iHeight; 
  win.resizeBy(iWidth, iHeight);
  win.focus();
  win.document.close();
}


//centered windows
function vix_sc(ifile,ititle,ix,iy) {
  var win;
  win = window.open("","","width=200,height=200,resizable=1");
  win.document.open();
  
  
  win.document.write("<html><head><title>"+ititle+"</title>");
  //win.document.write('<link rel="stylesheet"  type="text/css" href=".css" />');
  win.document.write("</head><body style='background-color:#000;margin:0;padding:0;' ><div style='text-align:left'>");
  win.document.write("<img src='"+ifile+"' width='"+ix+"' height='"+iy+"'></div></body></html>");
  
  var NS  = (navigator.appName=="Netscape")?true:false; 
  
  iWidth  = (NS)?win.innerWidth:win.document.body.clientWidth; 
  iHeight = (NS)?win.innerHeight:win.document.body.clientHeight; 
  iWidth  = win.document.images[0].width - iWidth; 
  iHeight = iHeight; //win.document.images[0].height -  
  win.resizeBy(iWidth, iHeight);
  win.focus();
  win.document.close();
}



//popup window centered
function pw(surl, snazov) { 
 window.open( "db/wi.htm?"+surl+"?"+snazov, "", "resizable=1,height=200,width=200"); 
} 



function vi(ifile,ix,iy,ititle) {

  var win;
  win = window.open("","","width="+ix+",height="+iy+", scrollbars=no, toolbar=no,resizable=yes");
  win.document.open();
  
  win.resizeTo(ix+20,iy+20); //kvoli oknu a liste v nom
  win.document.write("<html><head><title>"+ititle+"</title>");
  //win.document.write('<link rel="stylesheet"  type="text/css" href="rkspirit_poprad.css" />');
  win.document.write("</head><body style='background-color:#FFFFFF;' ><div style='text-align:left'>");
//  win.document.write('<span style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
  win.document.write("<img src="+ifile+" width="+ix+" height="+iy+"></div></body></html>");
//  win.document.write("width"+ix+"; height="+iy);
    win.focus();
  win.document.close();
  
}


function popupw(page, w, h) { 
  var z;
  w+=45;
  h+=20;
  z=window.open(page, "W", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+", left=20, top=130"); 
  if (window.focus) {z.focus()}
} 


