// Populate Left Nav Search Box
function populateElement(selector, defvalue) {
	$(selector).each(function() {
		if($.trim(this.value) == "") {
			this.value = defvalue;
		}
	});
	
	$(selector).focus(function() {
		if(this.value == defvalue) {
			this.value = "";
		}
	});
	
	$(selector).blur(function() {
		if($.trim(this.value) == "") {
			this.value = defvalue;
		}
	});
}

$(document).ready(function(){						
	populateElement("#s", "I'm looking for...");

	if ( $.browser.msie && (jQuery.browser.version == 7.0) ) {
		// Do someting
	}
	else {
		$(".page-item-19 ul").hide();
		$(".page-item-32 ul").hide();
	
		//$(".widget_pages li:nth-child(4) a").click(function(event) {
		//	event.preventDefault();
		//	$(".widget_pages li:nth-child(4) ul").show();
		//});
		//$(".widget_pages .page-item-32 a").click(function(event) {
			//event.preventDefault();
			//$(".widget_pages li:nth-child(4) ul ul").toggle();
		//});
	
		$(".widget_pages .page-item-19 a:lt(1)").toggle(
		  function () {
			$(".page-item-19 ul:first").show();
		  },
		  function () {
			$(".page-item-19 ul:first").hide();
		  }
		);	
			
		$(".widget_pages .page-item-32 a:lt(1)").toggle(
		  function () {
			$(".page-item-32 ul:lt(1)").show();
		  },
		  function () {
			$(".page-item-32 ul:lt(1)").hide();
		  }
		);	
	}

});

$(function(){
	if ( $.browser.msie && (jQuery.browser.version == 7.0) ) {
		// Do someting
	}
	else {
	   var path = location.pathname.substring(1);
	   if ( path )
		 $('.widget_pages a[href$="' + path + '"]').attr('class', 'selected');
	}
});


