jQuery(document).ready(function($){	
								
	//hide menu on load
	jQuery("p.active").hide();
	
	//add class 'last' to last topper element
	jQuery("#innermenu > .abscontainer").last().addClass('last');
	
	/*jQuery("p.active > a").each(function() {
		jQuery(this).append("<div class='flasher'></div>");
	});*/
	
	//jQuery("div.sub").fadeTo("0", 0.9);
	jQuery("a.active").mouseover(function(){menuShow(this); return(false);});
													
	jQuery("#content").mouseover(function(){
		jQuery(".topsub > p.active").stop().hide().removeClass("topsub");
 	});
	
	//no boxy outline on clicks
	jQuery("a").focus(function() {
		jQuery(this).blur();
	});
	
	
	//remove border on blank images
	if(jQuery(".sidepic > img").width() <= 30) {
		jQuery(".sidepic").remove();
	}
	
	
	if($(".emerg").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("feature");
	}
	
	if($(".oralhy").length) {
		var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600"); 
		so.addVariable("config", "/features/config.xml"); 
		so.addVariable("feature", "hygiene"); 
		so.addParam("wmode", "transparent"); 
		so.addParam("quality", "high");
		so.write("feature");
	}
	
	if($(".types").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("feature");
	}
	
	if($(".befores").length) {
		var so = new SWFObject("/features/loader.swf", "features", "500", "315", "9", "#FF6600"); so.addVariable("config", "/features/config.xml"); so.addVariable("feature", "beforeafter"); so.addParam("wmode", "transparent"); so.addParam("quality", "high"); so.write("feature"); 
	}
	
	
	if($("#invisalign-video").length) {
		flowplayer("invisalign-video", {
			src: "http://tools.televoxsites.com/vendor/flash/flowplayer-3.2.6.swf",
			wmode: "transparent"
		}, 
		{
			plugins: { controls: { url: 'flowplayer.controls-tube-3.2.4.swf' } },
			clip: { autoPlay: false, autoBuffering: true, url: 'http://tools.televoxsites.com/vendor/flash/invisalign.flv' }
		});
	}
	
	// this part goes in site.js inside the DOCUMENT READY - DO NOT PUT IT IN TWICE
	$('.accordion-faq h3').click(function() {
		$(this).toggleClass('active').next().toggle('normal');
		return false;
	});
	
	
	$('.exam-hover, .login-hover').parent().hover(function() {
		$(this).children(0).css("display", "block").fadeIn(350, "easeOutExpo");
	}, function() {
		$(this).children(0).fadeOut(250);
	});
	
	
	//remove side picture if editing
	if($('.RadEditor').length) {
		$('.sidepic').remove();
	}
	
	if($("#loader").length) {
		var so = new SWFObject("/portals/0/video/FlashMediaPlayer2.swf", "sotester", "504", "464", "9");
		so.addParam("allowFullScreen", "true");
		so.addParam("flashvars", "&xmlLocation=/portals/0/video/data.xml");
		so.write("loader");
	}
	
	if($("#tests").length) {
		var so = new SWFObject("/portals/0/video/FlashMediaPlayer2.swf", "sotester", "504", "464", "9");
		so.addParam("allowFullScreen", "true");
		so.addParam("wmode", "opaque");
		so.addParam("flashvars", "&xmlLocation=/portals/0/video/data2.xml");
		so.write("tests");
	}
	
});

//make menu work
function menuShow(menuitem){
	jQuery(".topsub > p.active").stop().hide().removeClass("topsub");
	jQuery(menuitem).next().css("height", "auto").stop().slideDown(500).parent().addClass("topsub");
}

//sifr script
function pageScripts(){
var kozuka = {  src: DNN_skinPath + 'kozuka.swf' };
sIFR.activate(kozuka);
	sIFR.replace(kozuka, {
	  selector: 'h1', 
	  wmode: 'transparent', 
	  src:  DNN_skinPath +  'kozuka.swf', 
	  css: [ '.sIFR-root {color:#006974;}']
	});
	
}


