var highlightcolor="#ffffff"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}
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_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') { num = parseFloat(val);
        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 (num<min || max<num) 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 == '');
}
    function shockscreen() {
        self.name = "main"; // names current window as "main"
                newwindow=window.open("","shockscreen","width=400,height=400,resizable=yes,status=no,scrollbars=yes");
				if (window.focus) {newwindow.focus()};
               }
     function openbooking() {
        self.name = "main"; // names current window as "main"
                newwindow=window.open("","booking","width=850,height=600,resizable=yes,status=no,scrollbars=yes");
				if (window.focus) {newwindow.focus()};
               }
     function opencontactinfo() {
        self.name = "main"; // names current window as "main"
                newwindow=window.open("","contact","width=550,height=200,resizable=yes,status=no,scrollbars=no");
				if (window.focus) {newwindow.focus()};
               }
     function opentestimonial() {
        self.name = "main"; // names current window as "main"
                newwindow=window.open("","testimonial","width=580,height=700,resizable=yes,status=yes,scrollbars=yes");
				if (window.focus) {newwindow.focus()};
               }
     function opencalculator() {
        self.name = "main"; // names current window as "main"
                window.open("","Calculator","width=650,height=400,resizable=yes,scrollbars=yes")
               }

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function maxlength(element, maxvalue)
     {
     var q = eval("document.details."+element+".value.length");
     var r = q - maxvalue;
     var msg = "Sorry, you have input "+q+" characters into the "+
       "text area box you just completed. It can return no more than "+
       maxvalue+" characters to be processed. Please abbreviate "+
       "your text by at least "+r+" characters";
     if (q > maxvalue) {alert(msg);
	 document.details.message.focus();
	 }
     }
function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}
var bo_ns_id = 0;
function startIeFix(){  
	if(isIE()){
		document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');  
	}
}
function endIeFix(){
	if(isIE()){
		document.write('</div>');    
		var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);    
		var theCode = theObject.innerHTML;    
		theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"));    
		document.write(theCode);  
	}
}
function isIE(){
	// only for Win IE 6+  
	// But not in Windows 98, Me, NT 4.0, 2000  
	var strBrwsr= navigator.userAgent.toLowerCase(); 
	if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
		if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
			return false;    
		}    
		if(strBrwsr.indexOf("win98") > -1 ||       strBrwsr.indexOf("win 9x 4.90") > -1 ||       strBrwsr.indexOf("winnt4.0") > -1 ||       strBrwsr.indexOf("windows nt 5.0") > -1)    {
			return false;    
		}    
		return true;  
	}
	else{
		return false;  
	}
}