$(document).ready(function(){	
	
	$("#for_staff").click(function(){
		//get the url from href attribute and launch the url
		window.location=$(this).find("a").attr("href"); return false;
	});
	
	$(".clicky").hover(function(){
		$(this).addClass("cursor_pointer");
		$(this).find("a").css('text-decoration','underline');
        },function(){
		$(this).removeClass("cursor_pointer");
		$(this).find("a").css('text-decoration','none');
	});
	
	$(".clicky").click(function(){
		//get the url from href attribute and launch the url
		window.location=$(this).find("a").attr("href"); return false;
	});
	
	// animation init - reset everything to default state
   	$('p').filter(function() {return this.id.match(/anim/);}).fadeOut(0);
   	
   	// the fadey bit
	$('div').filter(function() {return this.id.match(/for/);}).hover(function() {
		// select the first div inside the frame and slide it down
		$("#"+$(this).attr("id")+" p:first").fadeIn("fast"); 
		
	},function(){
	   	
	   	// this hopefully protects against looping animations as well
		$('p').filter(function() {return this.id.match(/anim/);}).fadeOut("fast");

	});
	
	
	var $search3 = $('.n');	//Cache the element for faster DOM searching since we are using it more than once
	original_val3 = $search3.val(); 	//Get the original value to test against. We use .val() to grab value="Search"
	$search3.focus(function(){ 	//When the user tabs/clicks the search box.
		if($(this).val()===original_val3){ 	//If the value is still the default
			$(this).val('');//If it is, set it to blank
		}
	})
	.blur(function(){//When the user tabs/clicks out of the input
		if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
			$(this).val(original_val3); //... set back to the original value
		}
	});
	
	var $search4 = $('.o');	//Cache the element for faster DOM searching since we are using it more than once
	original_val4 = $search4.val(); 	//Get the original value to test against. We use .val() to grab value="Search"
	$search4.focus(function(){ 	//When the user tabs/clicks the search box.
		if($(this).val()===original_val4){ 	//If the value is still the default
			$(this).val('');//If it is, set it to blank
		}
	})
	.blur(function(){//When the user tabs/clicks out of the input
		if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
			$(this).val(original_val4); //... set back to the original value
		}
	});
        
});

