if (document.getElementById){

	document.write('<style type="text/css">\n');
	document.write('.subNav{display: none;}\n');
	document.write('.subSubNav{display: none;}\n');
	document.write('</style>\n');

}

/*

this is the base function to do the navigation switching
menu dropping is handled in the <BODY onLoad="menuToDrop..."> 
tag of the page.

*/

function switchNav(obj){

	if(document.getElementById){
	
		var elementObj	= document.getElementById(obj);
		var elementName	= document.getElementById("mainNav").getElementsByTagName("span");

		if(elementObj.style.display != "block"){
		
			for (var i = 0; i < elementName.length; i++) {
			
				if (elementName[i].className == "subNav")
				elementName[i].style.display = "none";
		
			}
			
			elementObj.style.display	= "block";

		} else {
			
			for (var i = 0; i < elementName.length; i++) {
			
				if (elementName[i].className == "subNav")
				elementName[i].style.display = "none";
		
			}
			
			elementObj.style.display	= "none";
			
		}
	}

	// flipEverything(obj);
}

/*

this is the base function to do the SUB navigation switching

*/

function switchSubNav(obj) {

	if(document.getElementById){
	
		var elementObj	= document.getElementById(obj);
		var elementName	= document.getElementById("mainNav").getElementsByTagName("span");
		
		if(elementObj.style.display != "block"){
		
			for (var i = 0; i < elementName.length; i++) {
			
				if (elementName[i].className == "subSubNav")
				elementName[i].style.display = "none";
		
			}
			
			elementObj.style.display	= "block";
		
		} else {
			
			for (var i = 0; i < elementName.length; i++) {
			
				if (elementName[i].className == "subSubNav")
				elementName[i].style.display = "none";
		
			}
			
			elementObj.style.display	= "none";
		
		}
	}
	
	/* 
	
	This removes the annoying dotted line border 
	from what was clicked, AFTER it was clicked. 
	Curious? Comment and vie the clicked subnav 
	item.
	
	*/
	
	self.focus();
}


/*

function flipEverything(obj) {

	var elementObj	= document.getElementById(obj);
	var elementName	= document.getElementById('L_NAV').getElementsByTagName('div');
	var clicked		= elementObj.previousSibling.id;

	for (var n = 0; n < elementName.length ; n++ ) {

		if (elementName[n].className == "NAV_BUT" && ) {

			//var name				= document.images[n].name;
			
			// alert(name);

			var lo_state	= 'images/' + elementName[n].id + '_lo.jpg';	// the source of the lo state image
			var imgName		= document.images[0].name;							// the name of this image


			alert('image named:' + imgName);

			// -- MM_swapImage( 'ABOUT' ,'', lo_state ,1);
			

			if (elementName[n].id == clicked) {

				var hi_state = 'images/' + clicked + '_hi.jpg';

				MM_swapImage( 'ABOUT' ,'', hi_state ,1);

			}
		}
	}
}

*/

/*

onMouseOver="MM_swapImage('Image1','','/images/but_hom_hi.jpg',1)"

Navigation Stuff

*/


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.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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function cellSwitch(cellName, newColor, textColor) {
//	if (isIE) {
		cellName.bgColor = newColor;
//	}
	if (textColor != null) {
		cellName.style.color = textColor;
	}
}




/*

this function is for the request info form page

*/

function emailValidation(entered) {
	with (entered) {
	
	apos=value.indexOf("@");
	
	dotpos=value.lastIndexOf(".");
	
	lastpos=value.length-1;
	
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2){
			
			return false;
			
		} else{ 
		
			return true;
		
		}
	}
}

function frmValidate(theForm) {
	
	if (theForm.contact_email.value == "") {
	
		alert("Please enter your EMail Address.");
		theForm.contact_email.focus();
		return (false);
	}
	
	if (emailValidation(theForm.contact_email) == false) {
		alert("Please enter a valid EMail Address.");
		theForm.contact_email.focus();
		return (false);
	}
	
	if (theForm.contact_message.value == "") {
		alert("Please enter your Message.");
		theForm.contact_message.focus();
		return (false);
	}
	
	return (true);
}
