/* Creation date: 07.7.2003 ã. */
function openWindow(period,villa)
{
var period;
var villa;
  calcwindow=window.open('http://www.intovarna.com/availability.php?period='+period+'&villa='+villa+'','','width=220,height=700,toolbar=0,menubar=0,scrollbars=1,status=0,resizable=0,screenx=0,screeny=0,left=0,top=0');
}

//--------------------------------- Currency rates and Weather information-------------------------------------
var dollar = 1.34300;
var pound = 2.18630;
var frank = 1.32258;
var d="us";
var p="gb";
var f="sf";
//-----------------------------------------------------------------------------------------------------------


function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}
} 
if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);
} 
}
}

function check_form(f) { // f is the form (passed using the this keyword)
if(f.name.value.length < 1 || f.name.value == "" ){
alert("You entered less than one character in the name field.");
f.name.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.name.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}

// check the first email address ( the exclamation means "not" )
else if(!check_email(f.email.value)){
alert("Invalid email detected.");
f.email.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}
else if(f.query.value.length < 1 || f.query.value == "" ){
alert("Please enter your querie.");
f.query.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.query.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}

}
