function mover(strOverCat, strMajorCategory) 
{
	//DEPRECIATED
}

function unsub(strMajorCategory) 
{
	//DEPRECIATED
}

//returns true is e-mail is a good one
function isValidEmail(email)
{
	if (email == "")
		return false;

	//OLD VALIDATION
	//if (email.match(/^[\w-\.\-_]+@[\w-\-]/) == null)
	//	return false;

	//NEW VALIDATION - 5/9/03
	if (email.match(/^[\w-\.\-_]+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == null)
		return false;
		
	return true;
}

//trim function for javascript
//- returns the trimmed string
function Trim(string)
{
	var start=0;
	var end=string.length-1;
	
	if (end == 0)
		return string;
	
	// trim end.
	while ((string.charAt(end) == " ") && (end > 0))
		end--;
	
	if (end == 0)
		return string;

	while ((string.charAt(start) == " ") && (start < end))
		start++;
	
	return string.substring(start, end+1);	
}

function setSearchFocus() 
{
}


//Calendar GUI
//---------------------------------------------------
function SelectDate(whichDate,bOldDate) {
	var originalDate;
	var sDate;
	var newDate;
	var today = new Date();
	
	//set the time to 0:00 for the later comparison
	today.setHours(0,0,0,0);
	
	if (document.getElementById(whichDate)) {
    	sDate = document.getElementById(whichDate);
    	originalDate = new Date(sDate.value);
	}
	else {
	    originalDate = "NaN";
	}
	
	if (originalDate == "NaN")
	    originalDate = new Date(today);
	
	var aryParam = new Array(originalDate);
	
	var result = window.showModalDialog("dlog_calendar.asp",aryParam,"center=1; help:No; status:No");
	if (result != "") {
	
		newDate = new Date(result);
		
		if ((newDate < today) && (bOldDate == false)) {
			alert("You can't have a date before today.  Try again.");
		}
		else {
			//convert the result into 1/2/2002 notation
			newDate = (newDate.getMonth()+1) + "/" + newDate.getDate() + "/" + newDate.getFullYear()

			//insert the new date into the date field 
        	if (document.getElementById(whichDate)) {
			    sDate.value = newDate;
			}
		}
	}
}

function RemoveDate(whichDate) {
	//insert empty string into the specified date field
	document.getElementById(whichDate).value = "";
}
//---------------------------------------------------