// JavaScript Document

/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function("return false")
if (document.getElementById){
highlighttab(aobject)
if (turntosingle==0){
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
}
}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
collecttablinks()
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


<!--

	<!-- Hide script from old browsers

	dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	monName = new Array ("january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december")


	now = new Date

	// End hiding script from old browsers -->
//-->


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];}
}

// ================================================================
// IMM091804: Javascript to handle form
// ----------------------------------------------------------------

function formsubmit(){
document.form.send.value = "yes";
document.form.submit();
}

function formerase(){
document.form.send.value = "no";
document.form.submit();
}

// ================================================================
// IMM091804: Javscript for Contact Us form validation
// ----------------------------------------------------------------
function checkContact()
{
	oFrm = document.forms[1];
	if (oFrm.refer.selectedIndex == 0)
	{
		alert("Please specify how you heard about us.");
		oFrm.refer.focus();
		return false;
	}

	sNme = new String(oFrm.name.value);
	if (sNme.length == 0)
	{
		alert("Please provide your full name before submitting the form.");
		oFrm.name.select();
		return false;
	}

	sPhn = new String(oFrm.phone.value);
	sTel = new String("");
	for (idx = 0; idx < sPhn.length; idx++ )
		if ("0123456789".indexOf(sPhn.substr(idx,1)) > -1)
			sTel += sPhn.substr(idx,1);

	if (sTel.length < 10)
	{
		alert("Please provide a valid telephone number, including area code.");
		oFrm.phone.select();
		return false;
	}

	sCmt = new String(oFrm.comments.value);
	if (sCmt.length == 0)
	{
		alert("Please describe your question or comment before submitting the form.");
		oFrm.comments.select();
		return false;
	}

	return true;
}