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 a valid e-mail address i.e name@website.com.\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 == '');
}

<!--add bookmark -->
function addbookmark()
{
bookmarkurl="url"
bookmarktitle="Title"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
<!--open browser window-->
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function imgswap(n)
{
if( n==0) document.images.homeimg.src="images/home_off.gif"; //home
if( n==1) document.images.homeimg.src="images/home_on.gif"; 
if( n==2) document.images.seatimg.src="images/seating_off.gif"; //seating
if( n==3) document.images.seatimg.src="images/seating_on.gif";
if( n==4) document.images.tableimg.src="images/tables_off.gif"; //tables
if( n==5) document.images.tableimg.src="images/tables_on.gif";
if( n==6) document.images.lightimg.src="images/light_off.gif"; //light
if( n==7) document.images.lightimg.src="images/light_on.gif";
if( n==8) document.images.wallimg.src="images/walls_off.gif"; //walls
if( n==9) document.images.wallimg.src="images/walls_on.gif";
if( n==10) document.images.storimg.src="images/stor_off.gif"; //storage
if( n==11) document.images.storimg.src="images/stor_on.gif";
if( n==12) document.images.objimg.src="images/obj_off.gif"; //obj
if( n==13) document.images.objimg.src="images/obj_on.gif";
if( n==14) document.images.linkimg.src="images/link_off.gif"; //link
if( n==15) document.images.linkimg.src="images/link_on.gif";
if( n==16) document.images.conimg.src="images/contact_off.gif"; //contact
if( n==17) document.images.conimg.src="images/contact_on.gif";
if( n==18) document.images.homepimg.src="images/home_off.gif";
if( n==19) document.images.homepimg.src="images/home_on.gif";
if( n==20) document.images.enq.src="images/enq_off_brown.gif";
if( n==21) document.images.enq.src="images/enq_on_brown.gif";
if (n==22) document.images.homepimg.src="images/home_off_prod.gif";
if( n==23) document.images.homepimg.src="images/home_on_prod.gif";
}
function change(id, newClass) {
	//alert(id);
	identity=document.getElementById(id);
	identity.className=newClass;
}

function DisplayLinks(id) {
	if (document.getElementById("catLinks_"+id).className == "disappear") {
		change("catLinks_"+id, "appear-tr");
		} else {
		change("catLinks_"+id, "disappear");
		}
}
