// document is loaded
jQuery(document).ready(function($){
	$('#slides').cycle({
    speed:    800, 
    timeout:  4000 
            });							
	// main nav
	$("#menu > ul").superfish({
		delay:400,
		speed:200,
		autoArrows: false,
		animation: { opacity:"show" }
	}).addClass('clearfix');
	
	// controls padding on submenus
	$('#menu ul.Level1').wrapInner("<div class='clearfix'/>");
	
	// remove title tags from menu links
	$('#menu a').attr('title','');
	
	// keep main menu items from jumping
	$('#menu a[href="#"]').click(function() { return false });
	$('#sitemenu a[href="#"]').click(function() { return false });
	
	// remove outline from links
	$('a').focus(function() { this.blur(); });
	
	// adding some classes to the menus
	$('li:last', 'ul').addClass('last');
	
	$("#menu .Level1").append("<li><img src='/Portals/_default/Skins/tingeyortho/images/subbtm.png' align='bottom' class='subbottom' /></li>");
	
	// open off-site links in new window
	$("a[href^='http']:not([href*='"+ this.location.host +"'])").attr("target", "_blank");
	// for pdfs
	$("a[href$='.pdf']").attr("target","_blank");
	
	$('#rpeClick').click(function() {
  		var sshow = new SWFObject("http://tools.televoxsites.com/features/rpa2.swf", "slideshow", "450", "350", "6", "#000000");
	    sshow.addParam("wmode", "transparent");
	    sshow.addParam("quality", "high");
		sshow.write("RPEflash");		
	});
	
	// faq accordions
	$('.acc h4').click(function() {
		jQuery(this).toggleClass('active').next().toggle("fast");
		return false;
	}).next().hide();
});


//sIFR implementation
function runSIFR(){
	var Clarendon = {  src: skinpath + 'Clarendon.swf' };
	sIFR.activate(Clarendon);
	sIFR.replace(Clarendon, {
	  selector: 'h1', 
	  wmode: 'transparent', 
	  src:  skinpath +  'Clarendon.swf', 
	  css: [ '.sIFR-root {color:#0977d6; font-size:42px;}'  ]
	});
}

