jQuery(function($){
	$("#wrap #top_navi li.droppable ul").hide();	
	$("#wrap #top_navi li.droppable").hover(function(){
		$(this).find("ul").show();
		$(this).find("a:first").css({'background-position':'bottom left'});
	},function(){
		$(this).find("ul").hide();
		
		if( $(this).hasClass('current_page_item') || $(this).hasClass('current_page_parent') || $(this).hasClass('dr') ){
			$(this).find("a:first").css({'background-position':'0 -37px'});
		}else{
			$(this).find("a:first").css({'background-position':'top left'});
		}
		
		//$(this).find("a:first").css({'background-position':'top left'});
	});
	
	
	$("#wrap #inner_wrap #content_wrap #right .contact_awards_pan .quick_contact a.open_quick_contact").click(function(){
		$("#wrap #inner_wrap #content_wrap #right .contact_awards_pan .quick_contact .quick_contact_form").show();
		return false;
	});
	
	$("#wrap #inner_wrap #content_wrap #right .contact_awards_pan .quick_contact a.close_quick_contact").click(function(){
		$("#wrap #inner_wrap #content_wrap #right .contact_awards_pan .quick_contact .quick_contact_form").hide();
		return false;
	});
		
	$(".banner div").cycle();
	
	$(".quick_contact_form .inner form input").one('click',function(){ $(this).val(""); });
	$(".quick_contact_form .inner form textarea").one('click',function(){ $(this).val(""); });
	
	$(".quick_contact_form .inner form").submit(function(){
		var name = $(".quick_contact_form .inner form input[name='name']").val();
		var telephone = $(".quick_contact_form .inner form input[name='telephone']").val();
		var email = $(".quick_contact_form .inner form input[name='email']").val();
		var message = $(".quick_contact_form .inner form textarea[name='message']").val();
		var url = $(".quick_contact_form .inner form").attr("action");
		
		if(name == ""){
			alert("Please enter a name.");
			return false;
		}else if(telephone == ""){
			alert("Please enter a telephone number");
			return false;
		}else if(email == ""){
			alert("Please enter an email address");
			return false;
		}else if(message == ""){
			alert("Please enter a message");
			return false;
		}
		
		$.get(url,{name:name, telephone:telephone,email:email,message:message}, function(e){
			$("#wrap #inner_wrap #content_wrap #right .contact_awards_pan .quick_contact .quick_contact_form").hide();
			alert(e);
		});
		
		return false;
	});
	
	
	
	//<li class="single droppable current_page_ancestor"><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=23" title="Treatments">Treatments</a>
	//<ul class='children'>
	//	<li class=""><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=25" title="Tooth whitening">Tooth whitening</a></li>
	//	<li class=""><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=27" title="Cosmetic treatments">Cosmetic treatments</a></li>
	//	<li class=""><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=29" title="Facial aesthetics">Facial aesthetics</a></li>
	//	<li class=""><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=31" title="Dental information">Dental information</a></li>
	//	<li class="last current_page_ancestor current_page_parent"><a href="http://localhost/~kevinruscoe/Practice%20Plan/El%20Nashar/2011/wordpress/?page_id=33" title="Oral health">Oral health</a></li>
	
	$(".children li.current_page_ancestor.current_page_parent a").css({'text-decoration':'underline'});
	var submenu_submenu_selected = $(".children li.current_page_ancestor.current_page_parent a").parent().parent().parent().find("a:first");
	submenu_submenu_selected.css({'background-position':'0 -37px'});
	submenu_submenu_selected.parent().addClass('dr');
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
});
