// JavaScript Document


function showmenu()

{ 

document.getElementById("toolkit").className="on";

}

function hidemenu()

{

document.getElementById("toolkit").className="off";

}

 

 function showmenu1()

{ 

document.getElementById("testimonial").className="on";

}

function hidemenu1()

{

document.getElementById("testimonial").className="off";

}


function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}



function isInteger(s)
{ 

   

   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}



function ValidateForm(){
	var Name=document.form1.name;
	var Address=document.form1.address;
	var Phone=document.form1.phone;
	var Country=document.form1.country;
	var Email=document.form1.email;
	var Validation_code=document.form1.validation_code;
	var Intended_month_year_of_visit=document.form1.intended_month_year_of_visit;
	var Specific_Requirements=document.form1.specific_requirements;
	
	var No_of_days=document.form1.no_of_days;


	if ((Name.value==null)||(Name.value=="")){
		alert("Please Enter your Name")
		Name.focus()
		return false
	}
	
	if ((Address.value==null)||(Address.value=="")){
		alert("Please Enter your Address")
		Address.focus()
		return false
	}
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Mobile No ")
         Phone.focus()
		return false
	}
	if (isInteger(Phone.value)==false){
		Phone.value="";
		alert("Please Enter your valid Phone No")
		Phone.focus()
		return false
	}
	
	  if ((Country.value==null)||(Country.value=="")){
		alert("Please Enter your Countryname")
		Country.focus()
		return false
	}
	
	if ((Email.value==null)||(Email.value=="")){
		alert("Please Enter your Email ID")
		Email.focus()
		return false
	}
	if (echeck(Email.value)==false){
		Email.value="";
		Email.focus()
		return false
	}
	
	
	
	
	

if ((Validation_code.value==null)||(Validation_code.value=="")){
		alert("Please Enter The Validation_code")
		Validation_code.focus()
		return false
	}
	

	if ((Intended_month_year_of_visit.value==null)||(Intended_month_year_of_visit.value=="")){
		alert("Please Enter The Tentative Date of Travel")
		Intended_month_year_of_visit.focus()
		return false
	}
  
	if ((No_of_days.value==null)||(No_of_days.value=="")){
		alert("Please Enter The  No_of_days")
		No_of_days.focus()
		return false
	}
	
	
	if ((Specific_Requirements.value==null)||(Specific_Requirements.value=="")){
		alert("Please Enter The  Specific Requirements")
		Specific_Requirements.focus()
		return false
	}
	return true
 }
 


