// JavaScript Document

/* Menu functionality */
$(document).ready(function(){
				 
	//menu hover functionality
	$("#menuWrapper li").hover(
		function(){
			$(this).find("> ul").show();
			$(this).addClass("hover");
		},
		function(){
			$(this).find("> ul").hide();
			$(this).removeClass("hover");
		}
	);
	
	//if the link menu is # avoid click triggering
	$("#menuWrapper li a").click(function(){
		if ( $(this).attr("href") == '#' )
			return false;
	});
	
	//Clear or populate a field
	var clearField = function(){
		
		var text = $(this);
		var textVal = $(this).val();
		
		//If the textfield is blank, re-insert the values.
		if (textVal == "") {
			
			text.val("Search");
			
			text.addClass("oaugBlue");
			text.removeClass("oaugBlack");
		
		}
		
		//If the textfield is not blank, remove the values.
		if (textVal === "Search") {
			
			text.val("");
			
			text.removeClass("oaugBlue");
			text.addClass("oaugBlack");
		
		}
		
	}
	
	$("#searchTextBox").focus( clearField );
	$("#searchTextBox").blur( clearField );
	

				 
})

	// Change Links
	function itemObfuscater (thisItem, urlLink){
		
		var item = $('a[href$="' + thisItem + '"]');
		
		item.attr('href', urlLink)
	
	}
