$(document).ready(function(){
	
    // FIRE UP HOME PAGE IMAGE ROTATOR
	$('#home-rotator').cycle({ 
		speed:  2000, 
		timeout: 5000,
		slideExpr: 'img'
	});
	
	// SHOW DEFAULT VALUE IN SEARCH BOX, REMOVE ON FOCUS
	$("input#s").DefaultValue("search for...");     
	 
	 // INTIALIZE FONTSIZER
     var options = { min: 0, max: 3};
     $.FontSizer.Init(options);
     
     // SET DROPDOWN MENU STUFF
     $("#nav li").hover(
     function(){ $("ul", this).fadeIn("fast"); },
     	function() { }
     );
	 
	 // OPEN REL="EXTERNAL" LINKS IN NEW WINDOW	 
	 $('a[rel=external]').attr("target","_blank");
	 
     // SET MENU HOVER STUFF FOR IE
	 if (document.all) {
     	$("#nav li").hoverClass ("sfHover");
     }
	 
    // INITIALIZE CAMCAST VIDEOS
    $("a[rel]").overlay({
		onBeforeLoad: function() {
			this.getBackgroundImage().expose({api: true}).load();			
		},				
		onLoad: function(content) {
			this.getContent().find("a.player").flowplayer(0).load();
		},
		onClose: function(content) {
			$f().unload();
			this.getBackgroundImage().expose().close();
		}
    });
	$("a.player").flowplayer("/wp-content/themes/camcon_blue/flowplayer/flowplayer-3.1.1.swf");

});

// SET MORE MENU HOVER STUFF FOR IE
$.fn.hoverClass = function(c) {
     return this.each(function(){
          $(this).hover(
               function() { $(this).addClass(c);  },
               function() { $(this).removeClass(c); }
          );
     });
};

