﻿function validateEmail( strValue) {
	/************************************************
	DESCRIPTION: Validates that a string contains a 
		valid email pattern. 
	  
	PARAMETERS:
		strValue - String to be tested for validity
	   
	RETURNS:
		True if valid, otherwise false.
	   
	REMARKS: Accounts for email with country appended
		does not validate that email contains valid URL
		type (.com, .gov, etc.) and optionally,
		a valid country suffix.  Since email has many
		forms this expression only tests for near valid
		address.  Some additional validation may be
		required.
	*************************************************/
	if (strValue=="") return true;
	var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

	//check for valid email
	return objRegExp.test(strValue);
}

function IntegerOnly(e){
/* This function allows only integer input into textbox.
	Usage: onkeypress="return IntegerOnly(event);"  VadymP 03/30/05 */
	var charCode = (navigator.appName == 'Netscape') ? e.which : e.keyCode;
	// test: alert(charCode);
	// charCode > 31 - no white space; charCode > 32 <- allow white space
	if (charCode > 32 && (charCode < 48 || charCode > 57))
	{
	return false;
	}
}	

function picoSearch() {
  var sSource = "http://www.picosearch.com/cgi-bin/ts.pl?";
  sSource += "query=" + document.getElementById("txtQuery").value;
  sSource += "&index=" + document.getElementById("hdnSearch").value;
  window.location.href = sSource;
  return false;
}