	ddsmoothmenu.init({
		mainmenuid: "smoothmenu1", //menu DIV id
		orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
		classname: 'ddsmoothmenu', //class added to menu's outer DIV
		//customtheme: ["#1c5a80", "#18374a"],
		contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	})
	
	haccordion.setup({
			accordionid: 'hc1', 
			paneldimensions: {peekw:'50px', fullw:'786px', h:'430px'},
			selectedli: [0, true], 
			collapsecurrent: false 
		})
// dom is ready 
$(function(){
	$("#name").focus(function(){
		$(this).val("");
	}).blur(function(){
		if($(this).val()=="")
		{
			$(this).val("Enter Your Name");
		}
	});
	$("#email").focus(function(){
		$(this).val("");
	}).blur(function(){
		if($(this).val()=="")
		{
			$(this).val("Enter Your Email ID");
		}
	});
	
// NOW LETES SUBMIT THIS FORM AND SAVE RESPONSE TO THE DB//
	$("#saveNews").click(function(){
		var msg = "";
		if($("#name").val()=="Enter Your Name" || $("#name").val()==""){
			msg += "Please enter you name. \r\n";
		}

		if($("#email").val()=="Enter Your Email ID" || $("#email").val()==""){
			msg += "Please enter your email id. \r\n";
		
		}else if(validateEmail($("#email").val())==false){
			msg += "Please enter correct email id. \r\n";
		}
		
		// if something wrong send message and stop elase send request to db//
		if(msg!=""){
			alert(msg);
			
		}
		else{
		
		
			var param = "email="+$("#email").val()+"&name="+$("#name").val();
		
			$.ajax({type: "POST", url: "ajax_news.php", data: param,success: function(msg){
				 		alert("Thank you...!!\r\n"+msg);
						document.newsFrm.reset();	
					} 
			});
		}
		return false;
	});	
});


function validateEmail(elementValue){  
   var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  
   return emailPattern.test(elementValue);  
 }
 

$(function(){

$("#submit").click(function(){
		var msg ="";
		if($("#name").val()==""){
			msg+="- Please enter your name.\n";
		}
		
		if($("#email").val()==""){
			msg+="- Please enter email. \n";
		}
		else if(validateEmail($("#email").val())==false){
		
			msg+="- Please enter valid email. \n";
		}	
		if($("#contactInfo").val()==""){
			msg+="- Please enter contact info. \n";
		}
		
		if($("#subject").val()==""){
			msg+="- Please enter subject. \n";
		}	
		
		if($("#message").val()==""){
			msg+="- Please enter message. \n";
		}	
		
		if(msg !=""){
			var msgTell ="Sorry we can't complete your request \r\n Please fill missing or incorrect information \r\n\n";
			alert(msgTell + msg);
		}
		else{
			var param = "mailFrom="+$("#email").val()+"&subject="+$("#subject").val()+"&msg="+$("#message").val()+"&name="+$("#name").val()+"&contInfo=" + $("#contactInfo").val();
			
		
			$.ajax({type: "POST", url: "dynamic_mail.php", data: param,success: function(msg){
			     
				 if(msg=="success"){
				 	alert("Thank you...! \r\n We received your message and get beack to you soon. \n");
					//$("#contFrm").fieldcontain('refresh');
					document.contFrm.reset();	
				 }
				 
   			} });
			
			
		
		}
		return false;
			
	});
//////////////////////////////////	
//////// Send refferd ///////////	
/////////////////////////////////

$("#send").click(function(){
		var msg ="";
		if($("#name").val()==""){
			msg+="- Please enter your name. \n";
		}
		
		if($("#email").val()==""){
			msg+="- Please enter email. \n";
		}
		else if(validateEmail($("#email").val())==false){
		
			msg+="- Please enter valid email. \n";
		}	
		if($("#contactInfo").val()==""){
			msg+="- Please enter contact info. \n";
		}
		
		if($("#whoRef").val()==""){
			msg+="- Please enter who referred. \n";
		}	
		
		if($("#message").val()==""){
			msg+="- Please enter message. \n";
		}	
		
		if(msg !=""){
			var msgTell ="Sorry we can't complete your request \r\n Please fill missing or incorrect information \r\n\n";
			alert(msgTell + msg);
		}
		else{
			var param = "mailFrom="+$("#email").val()+"&whoRef="+$("#whoRef").val()+"&msg="+$("#message").val()+"&name="+$("#name").val()+"&contInfo="+$("#contactInfo").val();
		
			$.ajax({type: "POST", url: "ajax_mail.php", data: param,success: function(msg){
			     
				 if(msg=="success"){
				 	alert("Thank you...! \r\n We received your message and get beack to you soon. \n");
					//$("#contFrm").fieldcontain('refresh');
					document.refFrm.reset();	
				 }
				 
   			} });
			
			
		
		}
		return false;
			
	});

	


});

 


