
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
  function MM_findObj(n, d) { //v3.0
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;

  
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setdestination(arrivalAirport)
		{
		document.flightSearch.td_A_City.value = arrivalAirport;
		}

			
function focusFirstBox() {
			document.all.document.all.name.focus();
		}

function isFilled(elm) {
    if (elm.value == "" ||
        elm.value == null) 
    return false;
    else return true;
}

function isFalse(elm) {
    if (elm.value == "FALSE") 
   return false;
   else return true;
}

function validate(form) {


    if (isFilled(form.Currency) == false) {
    alert("Please enter your Currency");
    form.Currency.focus();
    return false;
    }
    
return true;
}

var now = addDays( new Date(),0);
var day =now.getDate();
var month = now.getMonth(); 

function setDrops(theForm) {

   theForm.selDay.selectedIndex = day;
   theForm.selMonth.selectedIndex = month;
}

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

function popup(loc, win_name, height, width, scrollbars, resizable) {
		var has_win_name = '1'
		if (loc == ''){has_win_name = '0'}
		if (!win_name){win_name = 'biz_new'}
		if (!height){height = '420'}
		if (!width){width = '420'}
		if (!scrollbars){ scrollbars = 'no' }
		if (!resizable){ resizable = 'no' }
		if (has_win_name == 1){
			newWin = window.open(loc,win_name,"height=" + height + ",width=" + width + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",screenx=1,screeny=1,top=1,left=1");
			newWin.focus();
		}
	}
	
function HostelPictureWindow( url ) {
  SmallWin = window.open(url, 'HostelPicture','scrollbars,resizable,height=360,width=320');
  if (window.focus) {
    SmallWin.focus();
  }
  if (SmallWin.opener == null) {
    SmallWin.opener = window;
  }
}
function validate(form) {



    // is name element filled?

    if (isFilled(form.character) == false) {
    alert("Please enter your character rating");
    form.character.focus();
    return false;
    }
    
   	 // is number element filled?

    if (isFilled(form.security) == false) {
    alert("Please enter your security rating");
    form.security.focus();
    return false;
    }

 // e mail

    if (isFilled(form.location) == false) {
    alert("Please enter your location rating");
    form.location.focus();
    return false;
    }

// is staff element filled?

    if (isFilled(form.staff) == false) {
    alert("Please enter your staff rating. ");
    form.staff.focus();
    return false;
    }
	
	// is fun element filled?

    if (isFilled(form.fun) == false) {
    alert("Please enter your fun rating. ");
    form.fun.focus();
    return false;
    }
	
	// is staff element filled?

    if (isFilled(form.cleanliness) == false) {
    alert("Please enter your cleanliness rating. ");
    form.cleanliness.focus();
    return false;
    }
	
	// is staff element filled?

    if (isFilled(form.name) == false) {
    alert("Please enter your name. ");
    form.name.focus();
    return false;
    }
     
	 // is email element filled?

    if (isFilled(form.email) == false) {
    alert("Please enter your email address. It will not be displayed on the site.");
    form.email.focus();
    return false;
    }

         
	 // is comments element filled?

    if (isFilled(form.comments) == false) {
    alert("Please enter your comments to be displayed on the site.");
    form.comments.focus();
    return false;
    }
	
return true;
}
