/* Project Name Global Javascript Functions

By  - ISITE Design


*/

//start the jQuery functions
$(document).ready(function() {


	/*apply to the header search input - add as needed*/
	$("#search").inputClear();


	/* add class to drop downs and buttons for IE <6 */
	if(document.all){
	    $("#nav li, button").hover(
	            function() { $(this).addClass("over"); }
				,
	            function() { $(this).removeClass("over"); }
	    );
	}// if document.all
    
    
    // Add mouseover behavior to main nav headings
    $("#nav>li>a.tab").mouseover(function () {
        $("#nav>li").removeClass('active');
        $(this).parent().addClass('active');
        
        $("#nav>li>a.tab").removeClass('activetab');
        $(this).addClass('activetab');
    });


    // swfobject in the flash component
    var so = new SWFObject("enrollmentrx.swf", "flash", "620", "301", "8", "#ffffff", 'high');
    so.write("primaryflash");    
    

});// document ready / end jquery functions


	/*clear search field on click - made into plugin so it can easily be used more than once.*/
	jQuery.fn.inputClear = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
	};
    


    
