//sIFR implementation
function pageScripts() {
var Arnopro= {  src: DNN_skinPath + 'Arnopro.swf' };
sIFR.activate(Arnopro);
sIFR.replace(Arnopro, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  'Arnopro.swf', 
  css: [ '.sIFR-root {color:#005488;font-size:30px;}'  ]
});
}

/**************************************/
jQuery(document).ready(function() {

/*Invisalign FAQ*/
jQuery('.acc h4').click(function() {
		jQuery(this).toggleClass('active').next().toggle("fast");
		return false;
	}).next().hide();

/* Menu code starts*/  
jQuery("#nav ul").hide();
jQuery("#nav li ul:has(img)").each(function() {
});

/*First level menu*/
jQuery("#nav >li >img").click(function(event){
if (this == event.target){
var current = this;
jQuery("#nav li:has(img)").each(function() {
if (this != current) jQuery(this).children().find("+ ul").slideUp(400);
});
jQuery(this).toggleClass("sub1").find("+ ul").slideToggle("medium");
}
});

/*second level menu*/
jQuery("li.p2:has(ul)").click(function(event){
if (this == event.target) {
var current = this;
jQuery("li.p2:has(ul)").each(function() {						  
if (this != current) jQuery(this).children().slideUp(400);

}); 
jQuery("ul:first", jQuery(this)).slideToggle(400);
}
});

/*Third level menu*/
var instance = jQuery(".selected");
jQuery(instance).click(function(event){
	jQuery(instance).each(function() {						   
	jQuery(instance).children().find("+ ul").slideDown(400);	
  });
	jQuery("ul:first", jQuery(instance)).slideToggle(400); 	
	});


if(jQuery(this).parent().find("ul:first").is(":visible")){
  					jQuery(this).parent().find("ul:first").slideUp(400, function(){
  					jQuery(this).parent("li").find("img").delay(400);
  					});
  					
  					
  				}else{
  					jQuery(this).parent().find("ul:first").slideDown(400, function(){
  						jQuery(this).parent("li").find("img").delay(400);
  					});
  				}

jQuery("#nav li ul:empty").remove();
jQuery("#nav li ul li ul:empty").remove();

/*Show/Hide submenus*/
jQuery(".sel ul.lev2").css("display","block");
jQuery("#sub87.selected ul").css("display","block");
	jQuery(".unsel").click(
	function(){ 	  
	   jQuery(".sel ul.lev2").css("display","none");
	});
	
/*Font tetx changes*/
jQuery("#sub89 a").text( "Orthognathic (Jaw) Surgery" );
jQuery("#site89").text( "Orthognathic (Jaw) Surgery" );

 jQuery("#sub108 a").click(function(){
			window.open('/Portals/0/cookbook.pdf','newwindow')	  	 	 			
	 });
	 
	 jQuery('#rpeFF').click(function() {
		var sshow = new SWFObject("http://tools.televoxsites.com/features/rpa2.swf", "slideshow", "450", "350", "10", "#000000");
		sshow.addParam("wmode", "transparent");
		sshow.write("rpeFF"); 
	 });
 
/*Preload the menu backgrounds*/
	menuImage1 = new Image(); 
	menuImage1.src = DNN_skinPath + "images/home_on.jpg";
	menuImage2 = new Image(); 
	menuImage2.src = DNN_skinPath + "images/plogin_on.jpg";	
	menuImage3 = new Image(); 
	menuImage3.src = DNN_skinPath + "images/oinfo_on.jpg";
	menuImage4 = new Image(); 
	menuImage4.src = DNN_skinPath + "images/pinfo_on.jpg";
	menuImage5 = new Image(); 
	menuImage5.src = DNN_skinPath + "images/tret_on.jpg";
	menuImage6 = new Image(); 
	menuImage6.src = DNN_skinPath + "images/fun_on.jpg";
	menuImage7 = new Image(); 
	menuImage7.src = DNN_skinPath + "images/cus_on.jpg";
	menuImage8 = new Image(); 
	menuImage8.src = DNN_skinPath + "images/npati_on.jpg";
	menuImage9 = new Image(); 
	menuImage9.src = DNN_skinPath + "images/what_on.jpg";
	menuImage10 = new Image(); 
	menuImage10.src = DNN_skinPath + "images/testi_on.jpg";
	menuImage11 = new Image(); 
	menuImage11.src = DNN_skinPath + "images/consultation_on.png";
	menuImage12 = new Image(); 
	menuImage12.src = DNN_skinPath + "images/Patient Friendly Recipes_on.png";

	if (jQuery("#orthodontist").length){
  		var sshow = new SWFObject("http://tools.televoxsites.com/features/beOrtho.swf", "slideshow", "500", "373", "6", "#000000");    		        sshow.addVariable("colorslocation", location.host+DNN_skinPath+"colors.txt"); 
        sshow.addParam("wmode", "transparent"); 
        sshow.write("orthodontist");
	} 
	if (jQuery("#featureorthognathic").length)
	{
		var sshow = new SWFObject("http://tools.televoxsites.com/features/orthognathic.swf", "slideshow", "190", "205", "6", "#000000"); 
		sshow.addParam("wmode", "transparent"); 
		sshow.write("featureorthognathic");
	}
});
