//this script is for validation of sendbamd and sendmail  


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")
		   document.form1.email.focus()
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   document.form1.email.focus()
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
			 document.form1.email.focus()
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
			 document.form1.email.focus()
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
			 document.form1.email.focus()
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
			 document.form1.email.focus()
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
			 document.form1.email.focus()
		    return false
		 }

 						
	}

//new ypSlideOutMenu("menu3", "right", 812, 235, 250, 285)
function ramayan()
{
	window.open ("didunow.asp","Ramayan",',resizable=yes,width=410,height=260,left=2,top=0')
}


function gotopuja(x)
{    //alert("hi")
   
	
	if(x==1)
	   window.location="ganesh/ganesha_puja.asp"
    else if(x==2)
	   window.location="../dashavatar/krishna_avatar/krishna_onlinepuja.asp"
	 else if(x==3)
	   window.location="Shiva/Shiva_onlinepuja.asp"   
	  
	else if(x==4)
	   window.location="Vishnu/Vishnu_onlinepuja.asp"  	 
		 
	else if (x==5)
		window.location="lakshmi/laxmi_onlinepuja.asp"
	else if (x==6)
		window.location="Durga/Durga_onlinepuja.asp"
	
	else if (x==7)
		window.location="Hanuman/Hanuman_onlinepuja.asp"
		
	else if (x==8)
		window.location="saraswati/saraswati_onlinepuja.asp"
	
	else if (x==9)
		window.location="Vishwakarma/Vishwakarma.asp"
	
	else if (x==10)
		window.location="ram_avatar/rama_onlinepuja.asp"
	
	else if (x==11)
		window.location="Kali/Kali.asp"	
	
	else if (x==12)
		window.location="Surya/Surya.asp"
		
}

function gotobhajan(x)
{    
   
	
	if(x==1)
	   window.location="ganesh/ganesha_bhajans.asp"
	   		 
	 else if(x==2)
	   window.location="../dashavatar/krishna_avatar/krishna_bhajans.asp"
	 else if(x==3)
	   window.location="Shiva/Shiva_bhajans.asp"   
	  
	else if(x==4)
	   window.location="Vishnu/Vishnu_bhajans.asp"  	 
		 
	else if (x==5)
		window.location="lakshmi/laxmi_bhajans.asp"
	else if (x==6)
		window.location="Durga/durga_bhajans.asp"
	
		else if (x==7)
		window.location="Hanuman/Hanuman.asp"
		else if (x==8)
		window.location="saraswati/saraswati_bhajans.asp"
		else if (x==9)
		window.location="Vishwakarma/Vishwakarma.asp"
		else if (x==10)
		window.location="ram_avatar/rama_bhajans.asp"
		else if (x==11)
		window.location="Kali/Kali.asp"	
		else if (x==12)
		window.location="Surya/Surya.asp"
		
		
}

function gotoslokas(x)
{  
	
	if(x==1)
	   window.location="ganesh/ganesha_slokas.asp"
	 else if(x==2)
	   window.location="../dashavatar/krishna_avatar/krishna_slokas.asp"
	 else if(x==3)
	   window.location="Shiva/Shiva_slokas.asp"   
	  
	else if(x==4)
	   window.location="Vishnu/Vishnu_slokas.asp"  	 
		 
	else if (x==5)
		window.location="lakshmi/laxmi_slokas.asp"
	else if (x==6)
		window.location="Durga/durga_slokas.asp"
	
		else if (x==7)
		window.location="Hanuman/Hanuman_slokas.asp"
		else if (x==8)
		window.location="saraswati/saraswati_slokas.asp"
		else if (x==9)
		window.location="Vishwakarma/Vishwakarma.asp"
		else if (x==10)
		window.location="ram_avatar/rama_slokas.asp"
		else if (x==11)
		window.location="Kali/Kali.asp"	
		else if (x==12)
		window.location="Surya/Surya.asp"
		
		
}


function ValidateForm()
{

var comments=document.form1.comments

	
	if ((comments.value==null)||(comments.value=="")){
		alert("Please Enter Message")
		comments.focus()
		return false
	}
	
	return true
}



function validkey(e){
	var keynum;
	var keychar;
	var numcheck;if(window.event) // IE
	{
		keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}
	
	keychar = String.fromCharCode(keynum);
	
	if(keychar=='?')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='!')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='@')
	{
	 alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='# ')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='$')
	{
	 alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='%')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='^')
	{
	 alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='*')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar==';')
	{
	 alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar==':')
	{
	 alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='{')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='}')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='-')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='~')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='/')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=='"')
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	if(keychar=="'")
	{
	alert("Use of special characters are not allowed here!");
	 return false;
	}
	var validchars = new RegExp("'");
	return !validchars.test(keychar);
	}

