//sIFR implementation
function pageScripts() {
var Fontname = {src: DNN_skinPath + 'TrajanPro.swf' };
sIFR.activate(Fontname);
sIFR.replace(Fontname, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  'TrajanPro.swf', 
  css: [ '.sIFR-root {color:#98bc54; font-size:30px; text-transform:lowercase;}'  ] 
});
}

//Menu implementation	   
jQuery(document).ready(function(){
	jQuery("#navigation > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse", 
		delay:1200,
		animation:{height:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	}).find(">li:has(ul)").mouseover(function () {
		jQuery("li", this).bgIframe({opacity:true});
	}).find("a").focus(function () {
		jQuery("ul", jQuery("#navigation > ul >li:has(ul)")).bgIframe({opacity:true});
	});
	
	/*Invisalign FAQ*/
	jQuery('.acc h4').click(function() {					 
	 jQuery(this).toggleClass('active').next().toggle("fast");
	 return false;
	}).next().hide();
	
    /*Preload the menu backgrounds*/
	menuImage = new Image(); 
	menuImage.src = DNN_skinPath + "images/fun_on.png";
	menuImage1 = new Image(); 
	menuImage1.src = DNN_skinPath + "images/home_on.png";
	menuImage2 = new Image(); 
	menuImage2.src = DNN_skinPath + "images/oinfo_on.png";
	menuImage3 = new Image(); 
	menuImage3.src = DNN_skinPath + "images/pinfo_on.png";
	menuImage4 = new Image(); 
	menuImage4.src = DNN_skinPath + "images/plogin_on.png";
	menuImage5 = new Image(); 
	menuImage5.src = DNN_skinPath + "images/treat_on.png";	
	menuImage6 = new Image(); 
	menuImage6.src = DNN_skinPath + "images/subbg.png";	

	menuImage8 = new Image(); 
	menuImage8.src = DNN_skinPath + "images/aleoff_ON.jpg";	
	menuImage9 = new Image(); 
	menuImage9.src = DNN_skinPath + "images/Cenoff_ON.jpg";	
	menuImage10 = new Image(); 
	menuImage10.src = DNN_skinPath + "images/fairoff_ON.jpg";	
	menuImage11 = new Image(); 
	menuImage11.src = DNN_skinPath + "images/greatoff_ON.jpg";	
	menuImage12 = new Image(); 
	menuImage12.src = DNN_skinPath + "images/manoff_ON.jpg";	

	menuImage13 = new Image(); 
	menuImage13.src = DNN_skinPath + "images/contactus_ON.jpg";	
	menuImage14 = new Image(); 
	menuImage14.src = DNN_skinPath + "images/first_ON.jpg";	
	menuImage15 = new Image(); 
	menuImage15.src = DNN_skinPath + "images/pform_ON.jpg";	
	
	
	if (jQuery("#Periodontics").length){	
		var so = new SWFObject("http://tools.televoxsites.com/features/gums.swf", "features", "320", "200", "9", "#FF6600");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("Periodontics"); 
	}
	if (jQuery("#Implants").length){
  		var so = new SWFObject("http://tools.televoxsites.com/features/implant.swf", "features", "200", "195", "9", "#FF6600");
  		so.addParam("wmode", "transparent");
  		so.addParam("quality", "high");
  		so.write("Implants");
	}
	if (jQuery("#tmjtmd").length){
  		var so = new SWFObject("http://tools.televoxsites.com/features/jaws.swf", "features", "190", "206", "9", "#FF6600");
  		so.addParam("wmode", "transparent");
  		so.addParam("quality", "high");
  		so.write("tmjtmd");
	}	
	if (jQuery("#Crowns").length){
		var so = new SWFObject("http://tools.televoxsites.com/features/crown.swf", "features", "287", "300", "9", "#FF6600");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("Crowns"); 
	}	
	if (jQuery("#RootCanal").length){
		var so = new SWFObject("http://tools.televoxsites.com/features/rootcanal.swf", "features", "350", "260", "9", "#FF6600");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("RootCanal"); 
	}	
	if (jQuery("#ToothEx").length){
		var so = new SWFObject("http://tools.televoxsites.com/features/wisdom.swf", "features", "190", "205", "9", "#FF6600");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("ToothEx");
	}	
	if (jQuery("#DentalDevelopement").length){
		var so = new SWFObject("http://tools.televoxsites.com/features/dentaldevelopment.swf", "features", "450", "400", "9", "#FF6600");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("DentalDevelopement"); 
	}	
	
	var opts = {
		"Centreville Office": ["cvilleoffice@yahoo.com"],
		"Fairfax Office":  ["ffxoffice@yahoo.com"],
		"Manassas Office": ["manassasa03@yahoo.com"],
		"Alexandria Office":  ["ackalexandria@hotmail.com"],
		"Great Falls Office": ["ackermanGF@yahoo.com"]
	},
		
	selectEL = jQuery("select.txtLocation");
	
	selectEL.change(function() {
		var sel = jQuery(this).val();
			
			for (var i in opts) {
				if (i == sel) {
					
					jQuery("select.textAddress").empty();
					
					for (var y in opts[i]) {
						jQuery('select.textAddress')
							.append('<option value="'+opts[i][y]+'">'+opts[i][y]+'</option>');
					}					
				}
			}
			
	}).change();
	
});
