// JavaScript Document

$(document).ready(    
	function(){	
	
		/*--------------------------------------------------------------------
			Global
		----------------------------------------------------------------------*/
		
		// superscript the reg mark
		// Replace all instances of "this" or "that" with "the other".
		$("body *").replaceText( /&reg;|®/gi, "<sup>&reg;</sup>" );	
		
		// search box - remove text on focus
		$('input#s').val('search site');
		$('input#s').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		});			

		// search button - do hover
		$("input#searchsubmit").val(" "); 
		$("input#searchsubmit").hover(
		  function () {
			$(this).addClass("searchbtn-over");
		  }, 
		  function () {
			$(this).removeClass("searchbtn-over")
		  }
		);

		// dropdowns
		$("#main-nav ul.dropdown").hover(
		  function () {
			$(this).parents(".main").find("a").addClass("selected");
		  }, 
		  function () {
			$(this).parents(".main").find("a").removeClass("selected");
		  }
		);		
	
		/*--------------------------------------------------------------------
			Home
		----------------------------------------------------------------------*/							
		if(	$('body').hasClass("home"))
		{					
			// ie6 png fix
			$("#home-intro").pngFix(); 												
		}								
});
