jQuery(document).ready(function($){
	
	// superfish menu
	$("#menu > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse",
		delay:900,
		animation:{width:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	});
	
	$('li:last', 'ul.Level1').addClass('last');
	
	$("#menu a[href=#], #menu66 > a").click(function() { return false });
	
	//open external links in new window
	 $("a[href^='http']:not([href*='damonanddamon.com'])").each(function() {
		$(this).attr("target", "_blank");
	});
			
	// for pdfs
	$("a[href$='.pdf']").attr("target","_blank");
  

	//remove title from hover on menu
	
	$('#menu a').each(function(){
		$(this).attr('title','');
	});

//  flash photos
	$('.flash-photos').flashembed({ src: skinpath+'flash/pic-ani01.swf', wmode:'transparent'});
	
//  tour video on homepage
	$('.video-tour').click(function(){
		$(this).flashembed({ src: skinpath+'flash/virtualtour.swf', wmode:'transparent'});
  
	});
	

/*Flash Features*/
if (jQuery("#featurebefore").length){
var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("feature", "beforeafter"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("featurebefore"); 
}	

if (jQuery("#featureemer").length){
var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("feature", "emergencies"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("featureemer");
}

if (jQuery("#featurecommon").length){
var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("feature", "problems"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("featurecommon"); 
}

if (jQuery("#featuretypes").length){
var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("xmlfile", "/features/types.xml"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("featuretypes");
}

if (jQuery("#featureoral").length){
var so = new SWFObject("/features/loader.swf", "features", "500", "325", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("xmlfile", "/features/hygiene.xml"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("featureoral"); 
}


});

function runsifr() {
	var helvetica = {  src: skinpath + 'flash/kozuka_m.swf' };
	sIFR.activate(helvetica);
	sIFR.replace(helvetica, {
  		selector: 'h1.pagetitles', 
  		wmode: 'transparent', 
  		src:  skinpath +  'flash/kozuka_m.swf', 
  		css: [ '.sIFR-root {color:#470b15; font-size:36px; line-height:50px}'  ]
	});
}
