	function regval(f)
	{
		if(!IsValid(f.loginemail.value,"UserID "))
		{
			f.loginemail.focus();
			return false;
		}
		if(!IsValid(f.pwd.value,"Password "))
		{
			f.pwd.focus();
			return false;
		}
		if(f.email.value != "")
        {
            var x = f.email.value;
	        if(x.indexOf("@")== -1 ||x.indexOf(".")==-1)
    	    {
                alert("Please enter valid  eMail Id.");
                f.email.focus();
                return false;
        	} 
     	}
		else
		{
			alert("Email should net be Empty");
			f.email.focus();
			return false;
		}
		if(!IsValid(f.fullname.value,"Fullname "))
		{
			f.fullname.focus();
			return false;
		}
		if(!IsValid(f.address.value,"Address "))
		{
			f.address.focus();
			return false;
		}
		if(!IsValid(f.city.value,"City "))
		{
			f.city.focus();
			return false;
		}
		if(!IsValid(f.state.value,"State "))
		{
			f.state.focus();
			return false;
		}
		if(!IsSelect(f.country.value,"Country "))
		{
			f.country.focus();
			return false;
		}
		if(!IsNumber(f.zip.value,"Zip "))
		{
			f.zip.focus();
			return false;
		}
		
		if(!IsPhone(f.phone.value,"Phone "))
		{
			f.phone.focus();
			return false;
		}
		
	}
	


function load()
{
	var load=window.open ('addglossary.php','','scrollbars=0,toolbar=0,statusbar=0,width=400,height=420,left=180,top=50')
}


function email()
{
	var email=window.open ('http://www.grrajeshkumar.com/internet/business-consultant/emailthispage.php','','scrollbars=0,toolbar=0,statusbar=0,width=400,height=250,left=180,top=95')
}


function rate()
{
	var rate=window.open ('http://www.grrajeshkumar.com/internet/business-consultant/ratethispage.php','','scrollbars=0,toolbar=0,statusbar=0,width=400,height=300,left=180,top=50')
}

function bookmark()
{
	var rate=window.open ('http://www.grrajeshkumar.com/internet/business-consultant/bookmarkthispage.php','','scrollbars=0,toolbar=0,statusbar=0,width=400,height=80,left=180,top=120')
}

//checks if a required field has been left empty
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(txtname,"Name must be filled out!")==false)
  {txtname.focus();return false}

if (validate_required(txtemail,"Email must be filled out!")==false)
  {txtemail.focus();return false}
if (validate_email(txtemail,"Not a valid e-mail address!")==false)
  {txtemail.focus();return false}

if (validate_required(txtoffph,"Phone must be filled out!")==false)
  {txtoffph.focus();return false}

if (validate_required(txtcity,"City must be filled out!")==false)
  {txtcity.focus();return false}

if (validate_required(txtcountry,"Country must be filled out!")==false)
  {country.focus();return false}

if (validate_required(txtcomments,"comments must be filled out!")==false)
  {txtcomments.focus();return false}
}
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_name(field,alerttxt)
{
with (field)
{
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(value)) {alert(alerttxt);return false}
else {return true}
}
}

function validate_phone(field,alerttxt)
{
with (field)
{
if (isNaN(parseInt(value))|| value.length <10) {alert(alerttxt);return false}
else {return true}
}
}

function validate_country(field,alerttxt)
{
with (field)
{
var Charset = /^[a-zA-Z]+$/;
 if (!(Charset.test(value))) {alert(alerttxt);return false}
else {return true}
}
}

function validate_comments(field,alerttxt)
{
with (field)
{
var Commset = /^\s+$/;
 if ((Commset.test(value))) {alert(alerttxt);return false}
else {return true}
}
}
