/* scripts.js by Carolyn R. Cox carolyn@navcoda.com */

<!--//
/* ---- BROWSER and PLATFORM DETECTION ---- */

// to allow browser branching
isNav = (document.layers)? true:false
isIE = (document.all)? true:false
isDom3 = (document.getElementById)? true:false

function isWindows() {
return (navigator.appVersion.indexOf("Win") != -1)
}

function isMac() {
return (navigator.appVersion.indexOf("Mac") != -1)
}

function isMacPPC() {
return (isMac() && (navigator.appVersion.indexOf("PPC") != -1
|| navigator.appVersion.indexOf("PowerPC") != -1))
}

// info window opener
function doInfoWin(theUrl)	{
	if (window.infoWindow && !window.infoWindow.closed)	{
		window.infoWindow.close;
		window.infoWindow= window.open(theUrl, 'infoWin', 'width=400,height=400,scrollbars,resizeable');
		window.infoWindow.focus;
		window.infoWindow.opener = self;
	} else  {
		window.infoWindow= window.open(theUrl, 'infoWin', 'width=400,height=400,scrollbars,resizeable');
		window.infoWindow.focus;
		window.infoWindow.opener = self;
	}
}


//turns links red when mouse rolls over (IE)
function msover(){
	if (isIE)	{
		event.srcElement.style.color="red";
  		event.srcElement.style.cursor = "hand";
	}
}


//turns links back to grey when mouse rolls out (IE)
function msout(){
	if (isIE)	{
  		event.srcElement.style.color="#696969";
  		event.srcElement.style.cursor = "auto";
	}
}

//OR turns links back to blue when mouse rolls out (IE)
function msout2(){
	if (isIE)	{
  		event.srcElement.style.color="blue";
  		event.srcElement.style.cursor = "auto";
	}
}

/* ---- FORMS CONTROL ---- */
// form validation in one fell swoop

function submitMail(form)	{
 for (var i=0; i<form.elements.length; i++)	{
		if (form.elements[i].value=="") {
			if ((i==1)||(i==2)||(i==5)||(i==7)||(i==8)||(i==10))	{
			}
			else	{
				alert ("\n Please enter your " +form.elements[i].name);
				form.elements[i].focus();
				return false;
			}
		}
	}
	if (form.Email.value.indexOf ('@',0) == -1 ||
		form.Email.value.indexOf ('.',0) == -1) {
		alert ("\nThe email field requires a \"@\" and a \".\". \nPlease re-enter your email address.");
		form.Email.select();
		form.Email.focus();
		return false;
	}
	return true;
}


// End -->
