
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) { //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 closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function showMenu(imgId,cNo) {
	switch (cNo)
	{
		case 1:
			closewindow_Cascadingsublimes('qhi0','','show','qhi1','','hide','qhi2','','hide','qhi3','','hide','qhi4','','hide','qhi5','','hide');
			break;
		case 2:
			closewindow_Cascadingsublimes('qhi0','','hide','qhi1','','show','qhi2','','hide','qhi3','','hide','qhi4','','hide','qhi5','','hide');
			break;
		case 3:
			closewindow_Cascadingsublimes('qhi0','','hide','qhi1','','hide','qhi2','','show','qhi3','','hide','qhi4','','hide','qhi5','','hide');
			break;
		case 4:
			closewindow_Cascadingsublimes('qhi0','','hide','qhi1','','hide','qhi2','','hide','qhi3','','show','qhi4','','hide','qhi5','','hide');
			break;
		case 5:
			closewindow_Cascadingsublimes('qhi0','','hide','qhi1','','hide','qhi2','','hide','qhi3','','hide','qhi4','','show','qhi5','','hide');
			break;
		case 6:
			closewindow_Cascadingsublimes('qhi0','','hide','qhi1','','hide','qhi2','','hide','qhi3','','hide','qhi4','','hide','qhi5','','show');
			break;
	}
}






function domTableEnhance()
{
	if(!document.createTextNode){return;}
	var tableClass='enhancedtable';
	var colourClass='enhancedtablecolouredrow';
	var hoverClass='enhancedtablerowhover';
	var activeClass='enhancedtableactive';
	var alltables,bodies,i,j,k,addClass,trs,c,a;
	alltables=document.getElementsByTagName('table');
	for (k=0;k<alltables.length;k++)
	{
		if(!alltables[k].className.match(tableClass)){continue;}
		bodies=alltables[k].getElementsByTagName('tbody');
		for (i=0;i<bodies.length;i++)
		{
			trs=bodies[i].getElementsByTagName('tr')
			for (j=0;j<trs.length;j++)
			{
				if(trs[j].getElementsByTagName('td').length>0)
				{
					addClass=j%2==0?' '+colourClass:'';
					trs[j].className=trs[j].className+addClass;
					trs[j].onclick=function()
					{
						if(this.className.match(activeClass))
						{
							var rep=this.className.match(' '+activeClass)?' '+activeClass:activeClass;
							this.className=this.className.replace(rep,'');
						} else {
							this.className+=this.className?' '+activeClass:activeClass;
						}
					}
					trs[j].onmouseover=function()
					{
						this.className=this.className+' '+hoverClass;
					}
					trs[j].onmouseout=function()
					{
						var rep=this.className.match(' '+hoverClass)?' '+hoverClass:hoverClass;
						this.className=this.className.replace(rep,'');
					}
				}
			}
		}
	}		
} 
window.onload=domTableEnhance; 
	


function checkContactUsForm() {
	if (document.theForm.name.value.length<3)	{window.alert("Please enter your first name.");		document.theForm.name.focus();		return false;}
	if (document.theForm.email.value.indexOf(".")<1)	{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		return false;}
	if (document.theForm.email.value.indexOf("@")<1)	{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		return false;}
	if (document.theForm.about.value=="")	{window.alert("Please select a 'regarding' option.");		document.theForm.about.focus();	return false;}
	if (document.theForm.message.value=="")	{window.alert("Please enter your message.");				document.theForm.message.focus();	return false;}
	return true;
}

function checkContactUsForm300409() {
	error="false";
	if (error=="false" && document.theForm.name.value.length<3) 
	{
	window.alert("Please enter your name.");
	document.theForm.name.focus();
	error="true";	
	}
	
	phoneError="false";
	if (document.theForm.phone.value.length<8) 
	{
	phoneError="true";	
	}
	
	emailError="false";
	if (document.theForm.email.value.indexOf(".")<1 || document.theForm.email.value.indexOf("@")<1) 
	{
	emailError="true";
	}
	
	if (error=="false" && phoneError=="true" && emailError=="true") {window.alert("Please enter your phone number or email address.");document.theForm.phone.focus();error="true";}
	if (error=="false" && document.theForm.about.value.length<1) {window.alert("What is your message regarding?");document.theForm.about.focus();error="true";}
	if (error=="false" && document.theForm.message.value.length<5) {window.alert("Please enter a message.");document.theForm.message.focus();error="true";}
	if (error=="false") {} else {return false;}
}