$(document).ready(function(){

	/*----- Navigation ------*/
	$('#mainmenu').accordion({
		active: false,
		header: '.menuTitle',
		event: 'click',
		autoheight:false,
		navigation:true,
		showSpeed: 1200,
		hideSpeed: 1400
	});

	
	/* replace media classes */
	$("a.media").media();
	
	/* remove box from links */
	$("a").focus(function(){
		this.blur();
	});
	
	/* THIS REMOVE THE LINE FROM THE EMPTY <UL> ELEMENTS (NOTE: be sure there is NO space between the <ul></ul> elements) */
	jQuery("#mainmenu li ul:empty").remove();
		

	// Preload all rollovers
	jQuery(".menuRollOver").each(function() {
		// Set the original src
		rollsrc = jQuery(this).attr("src");
		rollON = rollsrc.replace(/.jpg$/ig,"_on.jpg");
		jQuery("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	jQuery(".menuRollOver").mouseover(function(){
		imgsrc = jQuery(this).attr("src");
		matches = imgsrc.match(/_on/);
		// don't do the rollover if state is already ON
		if (!matches) {
			imgsrcON = imgsrc.replace(/.jpg$/ig,"_on.jpg"); // strip off extension
			jQuery(this).attr("src", imgsrcON);
		}
		
	}).mouseout(function(){
		jQuery(this).attr("src", imgsrc);
	});
	
});

var spring = {  src: 'spring.swf' };
sIFR.activate(spring);

sIFR.replace(spring, {
  selector: 'h1', 
  wmode: 'transparent', 
  src: 'spring.swf', 
  css: [ '.sIFR-root {color:#006d75; }' ]
});	

var avian = {  src: 'avian.swf' };
sIFR.activate(avian);

/*sIFR.replace(avian, {
  selector: '#mainmenu li div', 
  wmode: 'transparent', 
  src: 'avian.swf', 
  css: [ '.sIFR-root {color:#564e34; padding:5px 0px 5px 0px; text-align:center;cursor:pointer;}',
		 '.sIFR-root a {background:#dfd9b3; text-decoration:none; color:#564e34;cursor:pointer; padding:10px 0px 5px 0px;}',
		 '.sIFR-root a:hover {background:#fbf4cb; color:#564e34;cursor:pointer;}']

});	*/

sIFR.replace(avian, {
  selector: '#address', 
  wmode: 'transparent', 
  src: 'avian.swf', 
  css: ['.sIFR-root {color:#564e34; text-align:center;']
});
 