<!--
/*
// put the form in the upper left hand corner
function popWin(what, where, width, height, scroll, tool, resize, menu) 
{
	if (height == 0) var h = screen.height * 8/10;
	else var h = height;
	if (width == 0) var w = screen.width * 9/10;
	else var w = width;	
	var features ='width='+w+',height='+h+',menubar='+menu+',scrollbars='+scroll+',status=0,toolbar='+tool+',resizable='+resize+',top=0px,left=0px';
	window.open (what, where, features);
}
*/

// put the form in the middle of the screen
function popWin(what, where, width, height, scroll, tool, resize, menu) 
{
	if (height == 0) var h = screen.height * 8/10;
	else var h = height;
	if (width == 0) var w = screen.width * 9/10;
	else var w = width;	
	var top = (screen.height - h) / 2;
	var left = (screen.width - w) / 2;
	var features ='width='+w+',height='+h+',menubar='+menu+',scrollbars='+scroll+',status=0,toolbar='+tool+',resizable='+resize+',top='+top+'px,left='+left+'px';
	window.open (what, where, features);
}

function showDate() 
{
	var mydate=new Date();
	var year=mydate.getYear();
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10) daym="0"+daym;
	if (year<2000) year+=1900;
	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	document.write("<small><font face='verdana,arial' size='1'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</font></small>");
}

function showStatus()
{
	
}

function checkEmail(form)
{
	var d = form.email;
	var email = d.value.toLowerCase();
	var pattern = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2,4}$/;
	var matched = email.match(pattern);
	if (!matched) 
	{
		alert("Invalid email address. Please try again.");
		d.focus();
		return false;
	}
	return true;
}

function toggleAll() 
{
	var d = document.defaultform;
	d.toggleall.checked = !(d.toggleall.checked);
	for (var i = 0; i < d.elements.length; i++) 
	{
  		if( d.elements[i].type == 'checkbox' ) 
  		{
    			d.elements[i].checked = !(d.elements[i].checked);
    		}
	}
}

function validateSearch()
{
	var d = document.searchform.keywords;
	if (trim(d.value) == "")
	{
		alert("Please enter keywords to search.");
		d.focus();
		return false;
	}
	return true;
}

function trim(str) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof str != "string") { return str; }
   var retValue = str;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

//->