$(function(){
	
	$("ul.children").hide();
	
	// when search button gets fired
		$("#newletter").submit(function(){
			var valText = $("input#newletter").val();
			if(valText == 'Enter email and hit return'){
				return false;
			}
			else{
				return true;
			}
		})
		
		// events conditions
		$("input#newletter").val('Enter email and hit return').css('color', '#999');
		$("input#newletter").focus(function(){
			if($(this).val() != 'Enter email and hit return' ){
				// ei?
			}else{
				$(this).val('').css('color', '#000');
			}
		});
		
		$("input#newletter").blur(function(){
			if($(this).val() == 'Enter email and hit return' || $(this).val() == ''){
				$(this).val('Enter email and hit return').css('color', '#999');
			}
		});
		
		// For Dropdown Navigation added by James E.
		$(".navigation").find("li").each(function(){
			$(this).hover(function(){
				$(this).find("ul.children").show();
			}, function(){
				$(this).find("ul.children").hide();
			})
		})
		// End Simple Dropdown Navigation
	
		// Remove the inhereted Style on SubNav
		$("ul#subnav li.current_page_item").css('background', 'none').css('font-weight', '600');
		$("ul.children li.current_page_item").css('background', 'transparent');
		
		//$(".navigation li").addClass("line_separator");
		
		$("#sidebar").find("p").css('padding', '10px');
		
		$("li.widget").css("list-style", "none");
		
		$(".textwidget").find("p").css("padding", "10px");
		
		$("ul.children li.page_item").each(function(){
			$(this).hover(function(){
				$(this).find("a").css("color", "#fff");
			}, function(){
				$(this).find("a").css("color", "#00968B");
			})
		})
		
		//$(".quick_links").find("p").css("background", "url(http://www.techanthro.net/wp-content/themes/advocacy/images/quick-menu-bg.png) no-repeat");

		// if is GChrome
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if(is_chrome) $("#right-sidebar").css("top", "180px");
		
		$("#right-sidebar").find("li").removeClass("line_separator");
		
		$("p.support-us").click(function(){
			location.href="/support-us";
		})
		$("p.get-help").click(function(){
			location.href="/get-help";
		})
		$("p.lern-more").click(function(){
			location.href="/learn-more";
		})
		
		
		
})
