function ValidateContactForm()
{

var str = document.f.name.value;
if (str == "") {
alert("Please Enter Your Name.")
document.f.name.focus();
return false;
}
for (var i = 0; i < str.length; i++) 
{
var ch = str.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') 
{
alert("\nName Field Only Accepts Letters & Spaces.\n\nPlease Re-enter Your Name.");
document.f.name.select();
document.f.name.focus();
return false;
   }
}


var email = document.f.email;
if ((email.value==null)||(email.value==""))
    {
        window.alert("Please Enter Your E-mail Address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please Enter a Valid E-mail Address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please Enter a Valid E-mail Address.");
        email.focus();
        return false;
}





if (f.name.value =="")
{
alert("Please Enter Name ")
f.name.focus()
return(false)
}
if (f.email.value =="")
{
alert("Please Enter Email ")
f.email.focus()
return(false)
}


if (f.city.value =="-1")
{
alert("Please Select your City ")
f.city.focus()
return(false)
}

if (f.country.value =="-1")
{
alert("Please Select your Country ")
f.country.focus()
return(false)
}

if (f.require.value =="")
{
alert("Please Enter your Message OR Query.")
f.require.focus()
return(false)
}


if (f.vali.value !="9324")
{
alert("Please Enter Correct 4 Digits Numbers.- 9324")
f.vali.value="";
f.vali.focus()
return(false)
}

return(true);
}

function ValidateContactForm1()
{

var str = document.form1.fromname.value;
if (str == "") {
alert("Please Enter Your First Name.")
document.form1.fromname.focus();
return false;
}
for (var i = 0; i < str.length; i++) 
{
var ch = str.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') 
{
alert("\nName Field Only Accepts Letters & Spaces.\n\nPlease Re-enter Your First Name.");
document.form1.fromname.select();
document.form1.fromname.focus();
return false;
   }
}

var str = document.form1.last.value;
if (str == "") {
alert("Please Enter Your Last Name.")
document.form1.last.focus();
return false;
}
for (var i = 0; i < str.length; i++) 
{
var ch = str.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') 
{
alert("\n Last Name Field Only Accepts Letters & Spaces.\n\nPlease Re-enter Your Last Name.");
document.form1.last.select();
document.form1.last.focus();
return false;
   }
}


var email = document.form1.fromemail;
if ((email.value==null)||(email.value==""))
    {
        window.alert("Please Enter Your E-mail Address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please Enter a Valid E-mail Address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please Enter a Valid E-mail Address.");
        email.focus();
        return false;
}


var mob = document.form1.mob;
if ((mob.value==null)||(mob.value==""))
    {
        window.alert("Please Enter Your Mobile no.");
        mob.focus();
        return false;
    }
var fup = document.form1.filename;
var fileName = fup.value;
if (fileName == "") {
alert("Please select resume file for upload.")
document.form1.filename.focus();
return false;
}
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
if(ext == "doc" || ext == "pdf")
{
return true;
} 
else
{
alert("Upload Doc or pdf only");
fup.focus();
return false;
}

return(true);
}


function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}


