// JavaScript Document

function SwapImage(imgToSwapIn,imgLocation) {
	imgToSwapIn = eval(imgToSwapIn + ".src");
	document [imgLocation].src = imgToSwapIn;
}

function selectNav(newLoc){
	newPage = newLoc.options[newLoc.selectedIndex].value ;
	
	if(newPage != ""){
		window.location.href = newPage
	}
}

function openWindow(theURL,winName,features){
	window.open(theURL,winName,features);
}

function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}

function printDate(){
	today = new Date();
	months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	
	date = today.getDate();
	year = today.getFullYear();
	month = today.getMonth();
	
	document.write(months[month] + " " + date + ", " + year);	
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function stateSelection(showMenu){
	document.write("<select name=\"STATE\">\n");
	if(showMenu) {
		document.write("<option value=\"\">-- Choose One --</option>\n");
	} else {
		document.write("<option value=\"\">--</option>\n");
	}
	
	var states = Array("AK","AL","AR","AZ","CA","CO","CT","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","VA","VT","WA","WI","WV","WY");
	for (var i=0; i<states.length; i++) {
		document.write("<option value=\"" + states[i] + "\">" + states[i] + "</option>\n");
	}
	
	document.write("</select>\n");
}

function CheckEmail(EMAIL) {
	var rejectedDomain=new Array()

	var rejected=false
	var testresults=true
	var str=EMAIL
	var filter=/^.+@.+\..{2,3}$/
	if (filter.test(str)){
		return true;
	} else {
		return false;
	}
}