
/* 

START jQUERY 

*/
$(document).ready(function(){		

	
	/*
	
	INITIALIZE IE NAVMAIN FIX
	
	*/
	
	$("#navglobal li").hover(
		function () {
			$(this).addClass("sfhover");
			//IE7 fix to make sure the nested UL closes
			$(this).removeClass("sfhover-off");
		}, 
		function () {
			$(this).removeClass("sfhover");
			//IE7 fix to make sure the nested UL closes
			$(this).addClass("sfhover-off");
		}
	);/*
	
	SHOW-HIDE TOGGLE
	
	 - show-hide is triggered by the "toggler" class	 
	 - show-hide content defaults to open	
	 - show-hide collapsed trigger gets "toggler-closed" class
	 	 
	 */	 
	 
	var toggleSpeed = 300;
	$(".toggler").click(function(){
			$(this).toggleClass("toggler-closed").next().slideToggle(toggleSpeed);
		})
	.end();	
	
	/*
	
	FAQ
	
	- The question (dt tag) within an faq block is the trigger to expose the answer (dd tag)	
	- If a question/answer set is on/open and user clicks the question, the set will close	
	- only one question/answer set can be open at a time
	
	*/
	
	$(".faq dt").click(function(){
			
			// remove open class from dts and dds
			$(this).siblings("dt").removeClass("open");
						
			// hide all dds
			$(this).siblings("dd").hide();
									
			// if current trigger is not open, turn it on and open sibling dd. Otherwise, turn off trigger
			if (!$(this).hasClass("open")) {			
				$(this).addClass("open").next().toggle().toggleClass("open");				
			} else {			
				$(this).removeClass("open");			
			}
			
		})
	.end();
	
	$(".clearme").focus(function(){
	    if( this.value == this.defaultValue ) {
		    this.value = "";
	    }
        }).blur(function() {
	        if( !this.value.length ) {
		    this.value = this.defaultValue;
	    }
	})
	.end();

});

