
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/home-over.gif");
		home_pic_home_over = newImage("images/home_pic-home_over.jpg");
		grounds_over = newImage("images/grounds-over.gif");
		grounds_pic_grounds_over = newImage("images/grounds_pic-grounds_over.jpg");
		interiors_over = newImage("images/interiors-over.gif");
		interiors_pic_interiors_over = newImage("images/interiors_pic-interiors_ove.jpg");
		attractions_over = newImage("images/attractions-over.gif");
		attractions_pic_attractions_over = newImage("images/attractions_pic-attractions.jpg");
		reservations_over = newImage("images/reservations-over.gif");
		res_pic_reservations_over = newImage("images/res_pic-reservations_over.jpg");
		preloadFlag = true;
	}
}
function changeStatus(msg){
	window.status = msg;
}

// arguments are window/img W, window/img H, path/filename - .jpg and page/window title
function openWindow(winX, winY, pic, newPageTitle) {
			picWindow = window.open('','picWin','width='+winX+',height='+winY+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no')
			
	picWindow.focus() // Puts focus onto new window
			
	if (window.picWindow) {
		// write this code into it
		var pictureCode = "<html><head><title>"+newPageTitle+"</title></head>\n"
		pictureCode += "<body style=\"border: 0; margin: 0; padding: 0; padding-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; background-color: #ffffff;\" leftmargin=\"0\" topmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" onload=\"window.focus();\" onblur=\"window.close();\">\n"
		pictureCode += "<div align=\"center\" style=\"vertical-align: middle\">\n"
		pictureCode += "<img src=\""+pic+"\" width=\""+winX+"\"height=\""+winY+"\" alt=\""+newPageTitle+"\">\n"
		pictureCode += "</div>\n"
		pictureCode += "</body>\n"
		pictureCode += "</html>"	
		picWindow.document.open ()	
		picWindow.document.write (pictureCode)
		picWindow.document.close ()
		}
	}
function MM_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

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 == '');
}	