//sIFR implementation
function pageScripts(){
var ShelleyAllegroScript = {  src: DNN_skinPath + '/flash/avian.swf' };
sIFR.activate(ShelleyAllegroScript);
sIFR.replace(ShelleyAllegroScript, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  '/flash/avian.swf', 
  css: [ '.sIFR-root {color:#05530c; font-size:24px;}'  ]
});
}




//Menu implementation	   
jQuery(document).ready(function(){
	
	jQuery("#Navigation > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse",
		delay:800,
		animation:{height:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	}).find(">li:has(ul)").mouseover(function () {
		jQuery("ul", this).bgIframe({opacity:true});
		}).find("a").focus(function () {
		jQuery("ul", jQuery("#Navigation > ul >li:has(ul)")).bgIframe({opacity:true});
	
	});
	
	// menu hovers
	jQuery('ul.Level0>li>a').each(function() {
		var _this = jQuery(this);
		var _img = _this.find('img');
		var _src = _img.attr('src');
		_src = DNN_skinPath + 'images/' + 
						_src.substring(_src.lastIndexOf('/')+1, _src.lastIndexOf('.'));
		
		var _loader = new Image().src = _src + '_hover.jpg';
		
		_img.hover(
			function(){_img.attr({ src: _src + '_hover.jpg'});},
			function(){_img.attr({ src: _src + '.jpg'});}
		);
		
	});
	
	/*videos*/
	if (jQuery('#invisVideo').length) {
		flowplayer("invisVideo", "/Portals/0/vendor/flash/flowplayer-3.1.5.swf", {
			plugins: { controls: { url: '/Portals/0/vendor/flash/flowplayer.controls-tube-3.1.5.swf' } },
			clip: { autoPlay: false, autoBuffering: true, url: '/Portals/0/vendor/flash/invisalign.flv' }
		});
	}

	jQuery('.DisabledTab a[href=#]').click(function() { return false });
	
	jQuery('.accordion h2, .accordion h3').click(function() {
	jQuery(this).toggleClass('active').next().slideToggle('slow');
		return false;
	}).next().hide();
	
});
