	function trim(s) 
	{
		while (s.substring(0,1) == ' ') 
		{
			s = s.substring(1,s.length);
		}
		while (s.substring(s.length-1,s.length) == ' ') 
		{
			s = s.substring(0,s.length-1);
		}
		  return s;
	}


	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 NewWindow(mypage,myname,w,h,scroll)
	{
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',noresizable';
		win = window.open(mypage,myname,settings);
		win.focus();
	}


	function checkfields2()
	{
		var errormsg='';
		if(trim(document.wpsubmit.firstname)=='')
			errormsg+=" - First Name\n";
		if(trim(document.wpsubmit.lastname)=='')
			errormsg+=" - Last Name\n";
		if(trim(document.wpsubmit.company)=='')
			errormsg+=" - Company\n";
		if(trim(document.wpsubmit.jobtitle)=='')
			errormsg+=" - Job Title\n";
		if(trim(document.wpsubmit.email)=='')
			errormsg+=" - Email\n";
		if(trim(document.wpsubmit.phone)=='')
			errormsg+=" - Phone\n";
			
		if(trim(errormsg)=='')
		{
			alert("Please enter the following details:\n"+ errormsg);
			return false;
		}	
		else
			return true;	
	}




