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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 update_array(data_id){
var form_name = "form" + data_id;
document.getElementById(form_name).submit();
}
function new_column(data_id){
document.getElementById("add_column").submit();
}
//Create an array 
var allPageTags = new Array(); 

function show_checked() {

document.getElementById("merged").style.display = 'none';

		if(document.getElementById("merged_check").checked == true)
			  document.getElementById("merged").style.display = 'block';
			 else
			 document.getElementById("merged").style.display = 'none';
		
} 

function detect_type(){

var type = document.getElementById("type_select").value;
document.getElementById("beds_cabins").style.display = 'none';
document.getElementById("max_occupancy").style.display = 'none';

		if(type != 3 && type != 'default' && type != 1 && type != 5){
			  document.getElementById("beds_cabins").style.display = 'block';
			  document.getElementById("max_occupancy").style.display = 'block';
			  }
			 else{
			  document.getElementById("beds_cabins").style.display = 'none';
			  document.getElementById("max_occupancy").style.display = 'none';
		}
} 
function onload_functions(){
detect_type();
show_checked();
}
function show_form(form_id) {
document.getElementById(form_id).style.display = 'block';		
} 
function hide_form(form_id) {
document.getElementById(form_id).style.display = 'none';		
} 

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 500;
defaultHeight = 500;
// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(240,100);');
writeln('width=240-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+ imageURL +' style="display:block"></body></html>');
close();		
}}

function validate_form(){
			// Make quick references to our fields
			var name = document.getElementById('customer_name');
			var customer_email = document.getElementById('customer_email');
			var beds = document.getElementById('beds_cabs');
			var tel = document.getElementById('contact_tel');
			var day = document.getElementById('day');
			var month = document.getElementById('month');
			var year = document.getElementById('year');			
			// Check each input in the order that it appears in the form!
	if(!isEmpty(name, "You must enter your name")){
	if(!isEmpty(customer_email, "You must enter a valid email address")){
	if(emailValidator(customer_email, "Please enter a valid email address")){
	if(!isEmpty(beds, "Beds and Cabins Must be entered")){
	if(isNumeric(tel, "Please enter a valid telephone number")){
	if(!isEmpty(tel, "You must enter your telephone number")){
	if(madeSelection(day, "Please Choose a Day")){
	if(madeSelection(month, "Please Choose a Month")){
	if(madeSelection(year, "Please Choose a Year")){		
							return true;
							}
							}
						}
					}
				}
			}
		}
	}
	}
	
	return false;
	
}




function validate_email_form(){
			// Make quick references to our fields
			var to_name = document.getElementById('to_name');
			var to_email = document.getElementById('to_email');
			var from_name = document.getElementById('from_name');			
			var from_email = document.getElementById('from_email');
			// Check each input in the order that it appears in the form!
	if(!isEmpty(to_email, "To email address is empty") && emailValidator(to_email, "Please enter a valid to email address") && !isEmpty(from_email, "From email address is empty") && emailValidator(from_email, "Please enter a valid from email address")){			
					return true;
	}else{		

	return false;
	
	}	
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
<!--//--><![CDATA[//><!--
sfHover = function() {     
var sfEls = document.getElementById("menu").getElementsByTagName("li");     
		for (var i=0; i<sfEls.length; i++) {         
				sfEls[i].onmouseover=function() {             
					this.className+=" sfhover";         
					}         
					sfEls[i].onmouseout=function() {             
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");         
					}    
		} 
		
} 
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
function display_details(str){



var area_details = document.getElementById("area_details");

//course_area.style.display = 'block';

if (str.length==0)

  { 

document.getElementById("subject").value;

  return;

  }

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)

  {

  alert ("Your browser does not support AJAX!");

  return;

  } 

var url="/content/right_col/destination_info.inc.php";

url=url+"?id="+str;

xmlHttp.onreadystatechange=stateChanged;

xmlHttp.open("GET",url,true);

xmlHttp.send(null);

}



function GetXmlHttpObject()

{

var xmlHttp=null;

try

  {

  // Firefox, Opera 8.0+, Safari

  xmlHttp=new XMLHttpRequest();

  }

catch (e)

  {

  // Internet Explorer

  try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

  catch (e)

    {

    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

    }

  }

return xmlHttp;

}



function stateChanged() 

{ 

if (xmlHttp.readyState==4)

{ 

document.getElementById("area_details").innerHTML=xmlHttp.responseText;

}

}


