
/*----- Navigation ------*/
$(document).ready(function(){
	$("#mainmenu")
	.superfish({
		hoverClass	: "sfHover",
		pathClass	: "overideThisToUse",
		delay		: 800,
		animation	: {opacity:"show", height:"show"},
		speed		: "normal",
		oldJquery	: false, /* set to true if using jQuery version below 1.2 */
		disableHI	: false, /* set to true to disable hoverIntent detection */
		onInit		: function(){},
		onBeforeShow	: function(){},
		onShow		: function(){},
		onHide		: function(){}
	})
	.find(">li:has(ul)") //fixes ie6 bug
		.mouseover(function(){
			$("ul", this).bgIframe({opacity:true});
		})
		.find("a")
			.focus(function(){
				$("ul", $("#mainmenu>li:has(ul)")).bgIframe({opacity:true});
			});
	
	// Preload all rollovers
	$(".rollover").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.jpg$/ig,"_on.jpg");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$(".rollover").mouseover(function(){
		imgsrc = $(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
			$(this).attr("src", imgsrcON);
		}
	}).mouseout(function(){
		$(this).attr("src", imgsrc);
	});
	
		/* replace media classes */
	$("a.media").media();
	// gets rid of focus box on click
	$("a").focus(function(){
		this.blur();
	});

	$('#tour').before('<div id="imgNav" />')
	.after('<div id="caption" />')
	.cycle({
		fx:     'fade',
		speed:  'slow',
		timeout: 5000,
		pager:  '#imgNav',
		before: function() {$('#caption').html('<p >&nbsp;</p>');},
		after: function() {$('#caption').html('<p>' + this.alt + '</p>');},
		nowrap:false,
		pause:	1
		});

});


var futura = {  src: 'futura_light_condensed.swf' };
sIFR.activate(futura);

sIFR.replace(futura, {
  selector: '#addresses p', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#4b5b5a; }' ]
});

sIFR.replace(futura, {
  selector: '.addressTitle', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#000000; }' ]
});

sIFR.replace(futura, {
  selector: 'h1', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#3b5b7c; }' ]
});

sIFR.replace(futura, {
  selector: 'h2', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#fff; }' ]
});
sIFR.replace(futura, {
  selector: 'h3', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#334970; }' ]
});
sIFR.replace(futura, {
  selector: 'h4', 
  wmode: 'transparent', 
  src: 'futura_light_condensed.swf', 
  css: [ '.sIFR-root {color:#90ABC9; }' ]
});


