// privacy popup
function openprivacy(sURL){
newwindow=open(sURL,"newwin",
"scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=no,status=no,width=450,height=500");
}

// terms popup
function openterms() 
{
window.open("http://www.affittaresardegna.com/legal/termswww.htm","Ordine","height=400,width=620,status=yes,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no,scrollbars=yes,fullscreen=no,top=200,left=250");
}

// netscape refresh

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


// form checking--contact owner

function checkFields2() {
	missinginfo = "";
	if (document.calform.nome.value == "") {
		missinginfo += "\n-  <? echo (nome) ?>";
	}
if (document.calform.richieste.value == "") {
		missinginfo += "\n-  <? echo (ric) ?>";
	}
	
	if (document.calform.uemail.value == "") {
		missinginfo += "\n-  Email";
	}
         

	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"<? echo (signerr3) ?>\n" +
		missinginfo + "\n_____________________________" +
		"\n";
		alert(missinginfo);
		return false;
	}
	else return true;
}





//form checking--house insert

function checkFields3() {
	missinginfo = "";
	if (document.houseinsert.categoria.value == "") {
		missinginfo += "\n-  Categoria";
	}
if (document.houseinsert.sublocalita.value == "") {
		missinginfo += "\n-  Localita";
	} 

	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"<? echo (signerr3) ?>\n" +
		missinginfo + "\n_____________________________" +
		"\n";
		alert(missinginfo);
		return false;
	}
	else return true;
}


//Clear default form value
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 



// for tell friend 
function MM_validateForm() { //v4.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

    if (val) { nm=val.name; if ((val=val.value)!="") {

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

      } else if (test!='R') {

        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

          min=test.substring(8,p); max=test.substring(p+1);

          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

  } if (errors) alert('The following error(s) occurred:\n'+errors);

  document.MM_returnValue = (errors == '');

}

// Hide status bar
function hidestatus(){
window.status=''
return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

// refresh status bar
function RefreshStatus(){

  window.status = "Toscana Affitti";
  timer=setTimeout("RefreshStatus()", 0);
}
RefreshStatus();




