
	function displayDiv(div){  
	
		var divstyle = new String();
		divstyle = document.getElementById(div).style.display;
		switch(div){

		case 'text1':

			document.getElementById('text1').style.display = "block";
			document.getElementById('text2').style.display = "none";
			document.getElementById('text3').style.display = "none";

			break

		case 'text2':
	
			document.getElementById('text1').style.display = "none";
			document.getElementById('text2').style.display = "block";
			document.getElementById('text3').style.display = "none";

			break
	
		case 'text3':
	
			document.getElementById('text1').style.display = "none";
			document.getElementById('text2').style.display = "none";
			document.getElementById('text3').style.display = "block";

			break

		}

	}

    

	function IsNumeric(strString){
	
		var strValidChars = "0123456789.-";
		var strChar;
		var blnResult = true;

		if (strString.length == 0) return false;

			//  test strString consists of valid characters listed above
			for (i = 0; i < strString.length && blnResult == true; i++){
				strChar = strString.charAt(i);
				if (strValidChars.indexOf(strChar) == -1){
					blnResult = false;
				}
			}
		return blnResult;
	}

   
   
	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 Address")
			return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(at,(lat+1))!=-1){
			alert("Invalid E-mail Address")
			return false
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(dot,(lat+2))==-1){
			alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(" ")!=-1){
			alert("Invalid E-mail Address")
			return false
		}

		return true					
	}
	


	function checkContact(){

		var emailID=document.contact_form.email

		if (document.contact_form.name.value == "" ) {
			alert("Please add your name");
			document.contact_form.name.focus();
			document.contact_form.name.style.background="#FFCECE";
			return false;
		}
			document.contact_form.name.focus();
			document.contact_form.name.style.background=""


		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			document.contact_form.email.style.background="#FFCECE";
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			document.contact_form.email.style.background="#FFCECE";		
			return false;
		}
			document.contact_form.email.focus();
			document.contact_form.email.style.background=""



		if (document.contact_form.message.value == "" ) {
			alert("Please your Message");
			document.contact_form.message.focus();
			document.contact_form.message.style.background="#FFCECE";		
			return false;
		}


			return true;

	}	
