// open pop-up window
function openWin(URL,w,h) { 
	var popupWin = window.open(URL,'newWin','width=' + w + ',height=' + h + ',location=0,menubar=0,scrollbars=1,resizable=1,status=0')
	popupWin.focus();
}

// NEW COPY OF FORM VALIDATOR SCRIPT
function validFormNew(which) {
	var pass=true;
	for (i=0;i<which.length;i++) {
		var tempobj=which.elements[i];
		if(tempobj.name.substring(0,2)=="rq") {
			if (((tempobj.type=="text"||tempobj.type=="textarea") && tempobj.value=='') || (tempobj.type.toString().charAt(0)=="s" && tempobj.selectedIndex==0)) {
				pass=false;
				break;
      }
    }
  }
	
	if (!pass) {
		shortFieldName=tempobj.name.substring(2,30).toUpperCase();
		alert("Please make sure the "+ shortFieldName +" field was properly completed.");
		return false;
	}	else {
	return true;
	}
}

function expWindow(locX,locY,wd,ht) {
	top.window.moveTo(locX,locY);
	if(document.all) {
		top.window.resizeTo(screen.availWidth-wd,screen.availHeight-ht);
	} else if(document.layers||document.getElementById) {
		if(top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
			top.window.outerHeight = screen.availHeight-ht;
			top.window.outerWidth = screen.availWidth-wd;
		}
	}
}

function goSearch() { 
	if(!search.s.value) {
		alert("Please enter a search term");
		search.s.focus();
		search.s.select();
		return false;
	} else { 
		document.search.submit();
	}
}

function validEmail(sEmailAddress)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(sEmailAddress))
		return true;
	else
		return false;
}

function sMenu(thisMenu,thisLink) {
	var mstyle = document.getElementById(thisMenu).style;
	var lstyle = document.getElementById(thisLink).style;
	if(mstyle.visibility == 'visible') {
		mstyle.visibility = 'hidden';
		lstyle.backgroundColor = '#69C';
		lstyle.color = '#FFF';
		lstyle.borderColor = '#69C';
	} else {
		mstyle.visibility = 'visible';
		lstyle.backgroundColor = '#FE9';
		lstyle.color = '#036';
		lstyle.borderColor = '#036';
	}
}

function inknow(color) { document.getElementById('enews').style.backgroundColor = color; }
