function validateEmail(val)
 {
	string = val;
	if((val.charAt(0).toLowerCase() < 'a' || val.charAt(0).toLowerCase() > 'z')) 	return 
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!= -1)
 	   return true;
	else
   	   return false;

 }

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also
   // removes consecutive spaces and replaces it with one space.
   var retValue = inputString;
   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



IE4 = (document.all);
function newConfirm(title,mess,icon,defbut,mods)
 {

   if (IE4) {
      icon = (icon==0) ? 0 : 2;
      defbut = (defbut==0) ? 0 : 1;
      retVal = makeMsgBox(title,mess,icon,4,defbut,mods);
      retVal = (retVal==6);
   }
   else {
      retVal = confirm(mess);
   }
   return retVal;
}

function help_window(strPage,strPageTitle,features)
{
var newwindow;

newwindow=window.open(strPage,strPageTitle,features);

}
	 
function PopupWindow(file,h,w) 
   { 
     var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = "height="+h+",width="+w+",top="+wint+",left="+winl+",scrollbars=yes"
     window.open(file,"",winprops)
   } 
