function trimStartEnd(currVal)
{
  // Trim from start  
	while(""+currVal.charAt(0)==" ")
	    currVal = currVal.substring(1, currVal.length);
	
	// Trim from end
	while(""+currVal.charAt(currVal.length-1)==" ")
	    currVal = currVal.substring(0, currVal.length-1);
	
	return currVal;
}

function popWinWithNoToolbar(url, title, height, width) 
{ 
	newWindow = window.open(url, title, 'new Window','toolbar=no,menubar=no,resizable=no,scrollbars=no, status=no, location=no, top=0, left=0, width='+height+',height='+width)
}

function validateEmail(value) {
	//regex=/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if(regex.test(value) == false)
		return false;
	else
		return true;
}

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Philip Myers :: http://virtualipod.tripod.com/bookmark.html */
function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}
