function validate(tf)
{
if (tf.tnm.value=="")
{
alert("Please fill the name");
tf.tnm.focus();
return(false);
}

if (tf.cmp.value=="")
{
alert("Please fill the companyt name");
tf.cmp.focus();
return(false);
}

if(tf.pcc.value!="")
{
if (isNaN(tf.pcc.value)==true)
{
alert("Please fill digits only in country code");
tf.pcc.value="";
tf.pcc.focus();
return(false);
}
}

if(tf.pcty.value!="")
{
if (isNaN(tf.pcty.value)==true)
{
alert("Please fill digits only in city code");
tf.pcty.value="";
tf.pcty.focus();
return(false);
}
}

if(tf.pno.value!="")
{
if (isNaN(tf.pno.value)==true)
{
alert("Please fill digits only in Phone number");
tf.pno.value="";
tf.pno.focus();
return(false);
}
}
if (tf.eid.value=="")
{
alert("Please fill Email");
tf.eid.focus();
return(false);
}
else
{
var apos=tf.eid.value.indexOf("@");
var dotpos=tf.eid.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
{
alert("Please fill a Valid E-mail");
tf.eid.focus();
return (false);
}
}

if (tf.dtls.value=="")
{
alert("Please fill details");
tf.dtls.focus();
return(false);
}


return(true);
}

