function checkAlphaNumeric(mystr)
{
	len = mystr.length;
	str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	for(i=0;i<len;i++)
	{
		mychar=mystr.charAt(i)
		if (str.indexOf(mychar)==-1)
		{
			//alert ("Special Characters Cannot Be Used..")
			return 0;
		}
	}	
	return 1;
}

function Numeric(mystr)
{
	len = mystr.length;
	str="+0123456789-"
	for(i=0;i<len;i++)
	{
		mychar=mystr.charAt(i)
		if (str.indexOf(mychar)==-1)
		{
			return 0;
		}
	}	
	return 1;
}

function Alpha(mystr)
{
	len = mystr.length;
	str=".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	for(i=0;i<len;i++)
	{
		mychar=mystr.charAt(i)
		if (str.indexOf(mychar)==-1)
		{
			return 0;
		}
	}	
	return 1;
}


function chkhost()
{
	domn = document.gethost.dmname
	ftpu = document.gethost.ftpuser
	ftpp = document.gethost.ftppswd
	
	fname = document.gethost.fname
	lname = document.gethost.lname
	addrs = document.gethost.addr_1
	ccity = document.gethost.city
	state = document.gethost.state
	zipcd = document.gethost.zipcode
	email = document.gethost.email
	phone = document.gethost.phone

	if (domn.value.length < 6)
	{ alert("Domain name cannot be less than 6 alphabets"); domn.focus(); return(false)
	}
	else if (ftpu.value.length < 5)
	{ alert("FTP User name cannot be less than 5 alphabets"); ftpu.focus(); return(false)
	}
	else if (ftpp.value.length < 5)
	{ alert("FTP Password cannot be less than 5 alphabets"); ftpp.focus(); return(false)
	}
	else if ((fname.value.length < 1) || Alpha(fname.value)==0)
	{	alert("Enter First Name\nOnly alphabets are allowed"); fname.focus(); return (false);
	}
	else if ((lname.value.length < 1) || Alpha(lname.value)==0)
	{	alert("Enter Last Name\nOnly alphabets are allowed"); lname.focus(); return (false);
	}	
	else if (addrs.value.length < 1)
	{	alert("Enter Address Name"); addrs.focus(); return (false);
	}	
	else if ((ccity.value.length < 1) || Alpha(ccity.value)==0)
	{	alert("Enter City Name\nOnly alphabets are allowed"); ccity.focus(); return (false);
	}
	else if ((state.value.length < 1) || Alpha(state.value)==0)
	{	alert("Enter State Name\nOnly alphabets are allowed"); state.focus(); return (false);
	}
	else if ((zipcd.value.length < 1) || Numeric(zipcd.value)==0)
	{	alert("Enter Zip Code \nOnly numeric digits are allowed"); zipcd.focus(); return (false);
	}
	else if (email.value.length < 1)
	{	alert("Enter Email"); email.focus(); return (false);
	}
	else if ((phone.value.length < 10) || Numeric(phone.value)==0)
	{	alert("Enter 10 digit phone number\nOnly numeric digits are allowed"); phone.focus(); return (false);
	}
	return (true)
}
