
( function($) {  //Allows this script to use $ for jQuery. All additional jQuery commands go between this set of brackets.
// Allow other JavaScript libraries to use $.

$(function() {
	$(document).ready(function() {
		var srchFocus = false;
		$( "#header-right .form-submit" ).attr("disabled", true); //Disabling the site search button at page load.
	});
});


	$(function() {
		$( ".login" ).click(function() {
			$( "#bighat" ).toggle("blind", 500);
		});
	});


	
	$(function() {
		$( "#tabs" ).tabs();
	});


	$(function() { //Darker chunk of the sprite when the user clicks the search box.
		$( "#header-right .form-text" ).focusin(
			function(){
				$(this).css("background-position","0px -74px");
				$( "#header-right .form-submit" ).css("background-position","-210px -74px");
				$( "#header-right .form-submit" ).css("cursor","pointer");
				$( "#header-right .form-submit" ).attr("disabled", false);
				srchFocus = true;
			}
		);
	});	
	
	$(function() { //Setting it back when the search box is clicked out of.
		$( "#header-right .form-text" ).focusout(
			function(){
				$( "#header-right .form-submit" ).css("background-position","-210px -42px");
				$( "#header-right .form-submit" ).css("cursor","default");				
				setTimeout('jQuery( "#header-right .form-submit" ).attr("disabled", true)', 100); //Giving folks a chance to hit the button if that's what they intend to do.	
				srchFocus = false;
			}
		);
	});	
	
	$(function() { //Toggling to another chunk of the sprite when hovered over.
		$( "#header-right .form-submit" ).hover(

			function(){
			  if( srchFocus ){
				  $( "#header-right .form-submit" ).css("background-position","-210px -106px");	
			  }
			}
			,
			function(){
			  if( srchFocus ){
				  $( "#header-right .form-submit" ).css("background-position","-210px -74px");	
			  }
			}
		);
	});	
	
	



} ) ( jQuery ); ;

