﻿
function enquiry()
{
if(!document.getElementById('txtFname').value)
{

alert("First Name should not empty");
document.getElementById('txtFname').focus();
return false

}
if(!document.getElementById('txtLname').value)
{

alert("Last Name should not empty");
document.getElementById('txtLname').focus();
return false

}

var digits="0123456789";
var temp;
for (var i=0;i<document.getElementById('txtCellno').value.length;i++)
{
temp=document.getElementById('txtCellno').value.substring(i,i+1);
if (digits.indexOf(temp)==-1)
{
alert("Please enter correct Cell Number");
document.getElementById('txtCellno').value="";
document.getElementById('txtCellno').focus();
return false;
}
}

if(document.getElementById('txtCellno').value.length < 10)
{
alert("Cell No should not empty");
document.getElementById('txtCellno').value="";
document.getElementById('txtCellno').focus();
return false;

}

if(document.getElementById('ddlProduct').selectedIndex==0)
{

alert("Please Select Product");
document.getElementById('ddlProduct').focus();
return false
}



if(!document.getElementById('txtEmail').value)
{

alert("E-mail should not empty");
document.getElementById('txtEmail').focus();
return false;

}
var emailPat = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
///^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var emailid=document.getElementById('txtEmail').value;
var matchArray = emailid.match(emailPat);

if (matchArray == null)
{
alert("Your E-mail address seems incorrect. Please try again.Eg bbb@gg.com ");
document.getElementById('txtEmail').value="";
document.getElementById('txtEmail').focus();
return false;
}

if(!document.getElementById('txtRemark').value)
{

alert("Remark should not empty");
document.getElementById('txtRemark').focus();
return false

}

}


function resume()
{


if(!document.getElementById('txtName').value)
{
alert("Name should not empty");
document.getElementById('txtName').focus();
return false
}

if(!document.getElementById('txtApply').value)
{
alert("Apply for should not empty");
document.getElementById('txtApply').focus();
return false
}

if(!document.getElementById('txtEmail').value)
{
alert("E-mail should not empty");
document.getElementById('txtEmail').focus();
return false;
}
var emailPat = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
///^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var emailid=document.getElementById('txtEmail').value;
var matchArray = emailid.match(emailPat);
if (matchArray == null)
{
alert("Your E-mail address seems incorrect. Please try again.Eg bbb@gg.com ");
document.getElementById('txtEmail').value="";
document.getElementById('txtEmail').focus();
return false;
}


var digits="0123456789";
var temp;
for (var i=0;i<document.getElementById('txtPhone').value.length;i++)
{
temp=document.getElementById('txtPhone').value.substring(i,i+1);
if (digits.indexOf(temp)==-1)
{
alert("Please enter correct Phone number");
document.getElementById('txtPhone').value="";
document.getElementById('txtPhone').focus();
return false;
}
}
if(document.getElementById('txtPhone').value.length < 10)
{
alert("Mobile No should not empty");
document.getElementById('txtPhone').value="";
document.getElementById('txtPhone').focus();
return false;

}

var fup = document.getElementById('FileUpload1');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
if(ext == "doc")
{
return true;
}
else
{
alert("Upload only .doc file");
fup.focus();
return false;

}

}



