﻿// JScript File
function validate()
    {
        if(document.Form.name.value == ""){
            alert("Please enter Name");
            document.Form.name.focus();
            return false;}
        if(document.Form.phone.value == ""){
            alert("Please enter Phone");
            document.Form.phone.focus();
            return false;}
        if(document.Form.email.value == ""){
            alert("Please enter E-mail");
            document.Form.email.focus();
            return false;}
        if(document.Form.email.value != ''){
        if(document.Form.email.value.indexOf ('@',0) == -1 || document.Form.email.value.indexOf ('.',0) == -1){
            alert("Please enter valid E-mail");
            document.Form.email.select();
            document.Form.email.focus();
            return false;}}
           
        return true;
    }

function validatequote()
{
    if(document.Form.txtName.value == ""){
            alert("Please enter Name");
            document.Form.txtName.focus();
            return false;}
        if(document.Form.txtOrganization.value == ""){
            alert("Please enter Organization");
            document.Form.txtOrganization.focus();
            return false;}
        if(document.Form.txtEMail.value == ""){
            alert("Please enter E-mail");
            document.Form.txtEMail.focus();
            return false;}
        if (document.Form.txtEMail.value != ''){
		if (document.Form.txtEMail.value.indexOf ('@',0) == -1 || document.Form.txtEMail.value.indexOf ('.',0) == -1){
		    alert ("Please Enter Valid E-mail")
		    document.Form.txtEMail.select();
		    document.Form.txtEMail.focus();
		    return false;}}
        if(document.Form.txtStreetAddress1.value == ""){
            alert("Please enter StreetAddress");
            document.Form.txtStreetAddress1.focus();
            return false;}
        if(document.Form.txtCity.value == ""){
            alert("Please enter City");
            document.Form.txtCity.focus();
            return false;}
        if(document.Form.selCountry.selectedIndex == 0){
            alert("Please Select Country");
            document.Form.selCountry.focus();
            return false;}
        if(document.Form.selApplication.selectedIndex == 0){
            alert("Please Select Application Type");
            document.Form.selApplication.focus();
            return false;}
        if(document.Form.selJob.selectedIndex == 0){
            alert("Please Select Job Type");
            document.Form.selJob.focus();
            return false;}
        if(document.Form.selTime.selectedIndex == 0){
            alert("Please Select Start Date");
            document.Form.selTime.focus();
            return false;}
           
        return true;
}

function validateproposal()
{
        if(document.Form.name.value == ""){
            alert("Please enter Name");
            document.Form.name.focus();
            return false;}
        if(document.Form.email.value == ""){
            alert("Please enter E-mail");
            document.Form.email.focus();
            return false;}
        if(document.Form.email.value != ''){
        if(document.Form.email.value.indexOf ('@',0) == -1 || document.Form.email.value.indexOf ('.',0) == -1){
            alert("Please enter valid E-mail");
            document.Form.email.select();
            document.Form.email.focus();
            return false;}}
        if(document.Form.contact_number.value == ""){
            alert("Please enter Contact Number");
            document.Form.contact_number.focus();
            return false;}
        if(document.Form.query.value == ""){
            alert("Please enter Query");
            document.Form.query.focus();
            return false;}
           
       return true;
}

function validateBR()
{
        if(document.Form.name.value == ""){
            alert("Please enter Name");
            document.Form.name.focus();
            return false;}
        if(document.Form.email.value == ""){
            alert("Please enter E-mail");
            document.Form.email.focus();
            return false;}
        if(document.Form.email.value != ''){
        if(document.Form.email.value.indexOf ('@',0) == -1 || document.Form.email.value.indexOf ('.',0) == -1){
            alert("Please enter valid E-mail");
            document.Form.email.select();
            document.Form.email.focus();
            return false;}}
        if(document.Form.CompanyName.value == ""){
            alert("Please enter Company Name");
            document.Form.CompanyName.focus();
            return false;}
            
        for (i = 0; i < document.Form.list.length; i++)
        {
	            if(document.Form.list[i].checked == true ){
	                if(document.Form.hdBr.value==''){
	                     document.Form.hdBr.value=document.Form.list[i].value;
	                }
	                else{
	                    document.Form.hdBr.value=document.Form.hdBr.value+','+document.Form.list[i].value;
	                }
	            }
        }
        for (i = 0; i < document.Form.ppt.length; i++)
        {
	            if(document.Form.ppt[i].checked == true ){
	                if(document.Form.hdppt.value==''){
	                 document.Form.hdppt.value=document.Form.ppt[i].value;
	                }
	                else{
	                 document.Form.hdppt.value=document.Form.hdppt.value+','+document.Form.ppt[i].value;
	                }          
	            }
        }
                  
       return true;
}

    function fn1()
    {
    document.getElementById("thanks").style.visibility="Visible";
    }
    function f2()
    {
    document.getElementById("thanks").style.visibility="Hidden";
    }

