
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}


function valEmail(email)
		{
		var re  = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+[.])+([a-zA-Z0-9]{2,4})+$/;
		if (!re.test(email)) {

 		   return false;
		}
		else
		return true;
		}

function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;


   for (i = 0; i < sText.length && IsNumber == true; i++)
      {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1)
         {
         IsNumber = false;
         }
      }
   return IsNumber;

   }



function popup(url,win,width,height,resizable,scrollbars)
{

	
	if(!resizable) resizable = "no";
	else  resizable = "yes";
	if(!scrollbars) scrollbars = "no";
	else  scrollbars = "yes";
	w=width;
	h=height;
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2:100;	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbars+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+resizable;
	window.open(url,win,settings);
}

