jQuery(document).ready(function($){	
								
	//hide menu on load
	$("p.active").hide();
	
	//add class 'last' to last topper element
	$("#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);
	$("a.active").mouseover(function(){menuShow(this); return(false);});

	$("a.empty").mouseover(function(){
		$(".topsub > p.active").stop().slideUp(200);
		$('.topsub').removeClass("topsub");
	});
													
	$("#content, #home-content, #splash").mouseover(function(){
		$(".topsub > p.active").stop().slideUp(200);
		$('.topsub').removeClass("topsub");
 	});
	
	$('.topper.active').click(function(){
		return false;
	});
	
	//no boxy outline on clicks
	jQuery("a").focus(function() {
		jQuery(this).blur();
	});
	
	//remove border on blank images
	if(jQuery(".sidepic > img").width() <= 40) {
		jQuery(".sidepic > img").remove();
	}
	
	//accordion for INVISALIGN FAQ page
	jQuery('.accordion h3').click(function() {
		jQuery(this).toggleClass('active').next().toggle('blind', 'normal');
		return false;
	}).next().hide();
	
	if($('.sidepic').length) {
		addShadow();
	}	
	
	if($('.rotate').length) {
		$('.rotate').cycle();
	}
	
	//open external links in new window
	$("a[href^='http']").not("a[href*='swso.org']").attr("target", "_blank");
	// for pdfs
	$("a[href$='.pdf']").attr("target","_blank");
	
	
	$('#dnn_search').find('.NormalTextBox').val("Search the site").click(function() {
		$(this).val("");
	});
	$('#dnn_search').find('.StandardButton').val("");
});

//make menu work
function menuShow(menuitem){
	$(".topsub > p.active").stop().slideUp(200);
	$('.topsub').removeClass("topsub");
	$(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:#c23600; text-transform: uppercase;}']
	});
}


	
function addBullets(el) {
	jQuery(el).each(function() {
		jQuery("<span class='bullety'></span>").insertBefore(jQuery(this));
	});
}



