//sIFR implementation
function pageScripts(){
var ShelleyAllegroScript = {  src: DNN_skinPath + '/flash/kojika.swf' };
sIFR.activate(ShelleyAllegroScript);
sIFR.replace(ShelleyAllegroScript, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  '/flash/kojika.swf', 
  css: [ '.sIFR-root {color:#ae656f; font-size:36px;}'  ]
});
}




//Menu implementation	   
jQuery(document).ready(function(){
	
	jQuery("#dnn_ctr521_FormMaster_New_Form").attr("cellpadding","10");
	
	jQuery('.accordion h3').click(function() {
		jQuery(this).toggleClass('active').next().toggle('normal');
		return false;
	}).next().hide();



	jQuery("#Navigation > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse",
		delay:800,
		animation:{height:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	}).find(">li:has(ul)").mouseover(function () {
		jQuery("ul", this).bgIframe({opacity:true});
		}).find("a").focus(function () {
		jQuery("ul", jQuery("#Navigation > ul >li:has(ul)")).bgIframe({opacity:true});
	
	
	});




//officeinfo

var PathHomeo = DNN_skinPath + "images/home.jpg";

jQuery(
"#Navigation40").append("<a href='#' title=''></a>");

jQuery(
"#Navigation40").find("img").mouseover(function () {

var PathHomeON = DNN_skinPath + "images/home_hover.jpg";

jQuery(
this).attr({ src:PathHomeON });

});

jQuery(
"#Navigation40").find("img").mouseout(function () {

var PathHomeON = DNN_skinPath + "images/home.jpg";

jQuery(
this).attr({ src:PathHomeON });

});

//End
//meetus

var PathHomeo = DNN_skinPath + "images/meetus.jpg";

jQuery(
"#Navigation63").append("<a href='#' title=''></a>");

jQuery(
"#Navigation63").find("img").mouseover(function () {

var PathHomeON = DNN_skinPath + "images/meetus_hover.jpg";

jQuery(
this).attr({ src:PathHomeON });

});

jQuery(
"#Navigation63").find("img").mouseout(function () {

var PathHomeON = DNN_skinPath + "images/meetus.jpg";

jQuery(
this).attr({ src:PathHomeON });

});

//End
//services
	var PathHome = DNN_skinPath + "images/services.jpg";
	jQuery("#Navigation65").append("<a href='#' title=''></a>");

	jQuery("#Navigation65").find("img").mouseover(function () {
				var PathHomeON = DNN_skinPath + "images/services_hover.jpg";
				jQuery(this).attr({ src:PathHomeON });

	});
	jQuery("#Navigation65").find("img").mouseout(function () {
				var PathHomeON = DNN_skinPath + "images/services.jpg";
				jQuery(this).attr({ src:PathHomeON });
	});
	//End

	//newpatientinfo
	var PathHome = DNN_skinPath + "images/newpatientinfo.jpg";
	jQuery("#Navigation64").append("<a href='#' title=''></a>");

	jQuery("#Navigation64").find("img").mouseover(function () {
				var PathHomeON = DNN_skinPath + "images/newpatientinfo_hover.jpg";
				jQuery(this).attr({ src:PathHomeON });

	});
	jQuery("#Navigation64").find("img").mouseout(function () {
				var PathHomeON = DNN_skinPath + "images/newpatientinfo.jpg";
				jQuery(this).attr({ src:PathHomeON });
	});
	//newpatientinfo


	//gmcontests
	var PathHome = DNN_skinPath + "images/gmcontests.jpg";
	jQuery("#Navigation66").append("<a href='#' title=''></a>");

	jQuery("#Navigation66").find("img").mouseover(function () {
				var PathHomeON = DNN_skinPath + "images/gmcontests_hover.jpg";
				jQuery(this).attr({ src:PathHomeON });

	});
	jQuery("#Navigation66").find("img").mouseout(function () {
				var PathHomeON = DNN_skinPath + "images/gmcontests.jpg";
				jQuery(this).attr({ src:PathHomeON });
	});
	//End

	//technology
	var PathHome = DNN_skinPath + "images/technology.jpg";
	jQuery("#Navigation101").append("<a href='#' title=''></a>");

	jQuery("#Navigation101").find("img").mouseover(function () {
				var PathHomeON = DNN_skinPath + "images/technology_hover.jpg";
				jQuery(this).attr({ src:PathHomeON });

	});
	jQuery("#Navigation101").find("img").mouseout(function () {
				var PathHomeON = DNN_skinPath + "images/technology.jpg";
				jQuery(this).attr({ src:PathHomeON });
	});



	
	//patientinfo
	var PathHome = DNN_skinPath + "images/patientinfo.jpg";
	jQuery("#Navigation108").append("<a href='#' title=''></a>");

	jQuery("#Navigation108").find("img").mouseover(function () {
				var PathHomeON = DNN_skinPath + "images/patientinfo_hover.jpg";
				jQuery(this).attr({ src:PathHomeON });

	});
	jQuery("#Navigation108").find("img").mouseout(function () {
				var PathHomeON = DNN_skinPath + "images/patientinfo.jpg";
				jQuery(this).attr({ src:PathHomeON });


  });
	
	if (jQuery('#featureortho').length) {
		var so = new SWFObject("/features/loader.swf", "features", "500", "325", "9", "#FF6600");
		so.addVariable("config", "/features/config.xml");
		so.addVariable("feature", "hygiene");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("featureortho");
	}
	
	if (jQuery('#featureemer').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("featureemer");
	}
	
	
	if (jQuery('#featureplan').length) {
		var so = new SWFObject("/features/loader.swf", "features", "500", "325", "9", "#FF6600");
		so.addVariable("config", "/features/config.xml");
		so.addVariable("feature", "planner");
		so.addParam("wmode", "transparent");
		so.addParam("quality", "high");
		so.write("featureplan");
	}
	
	
	
	if (jQuery('#featurejaw').length) {
		var sshow = new SWFObject("http://tools.televoxsites.com/features/orthognathic.swf", "slideshow", "190", "205", "6", "#000000");
		sshow.addVariable("colorslocation", location.host+DNN_skinPath+"colors.txt");
		sshow.addParam("wmode", "transparent");
		sshow.write("featurejaw");
	}
	
	if (jQuery('#featureexpander').length) {
		var sshow = new SWFObject("http://tools.televoxsites.com/features/rpa2.swf", "slideshow", "450", "350", "6", "#000000");
		sshow.addVariable("colorslocation", location.host+DNN_skinPath+"colors.txt");
		sshow.addParam("wmode", "transparent");
		sshow.write("featureexpander");	
	}
	
	// invisalign faq
	jQuery('.accordion h2').click(function() {
	jQuery(this).toggleClass('active').next().slideToggle('slow');
		return false;
	}).next().hide();
	
	if (jQuery('#flashcontent').length) {
				var width = 800,
					 height = 334,
				
				flashvars = {
					xml:"/gallery.xml"
				},
				params = {
					menu: "false",
					allowScriptAccess: "always",
					scale: "noscale",
					allowFullScreen: "true"
				},
				attributes = {};
				
				var sshow = new SWFObject("/preview.swf", "flashcontent", width, height, "9.0.0", "#000000");
				sshow.addVariable('xml', '/gallery.xml');
				sshow.addParam('menu', 'false');
				sshow.addParam('allowScriptAccess', 'always');
				sshow.addParam('scale', 'noscale');
				sshow.addParam('allowFullScreen', 'true');
				sshow.write("flashcontent");
			
				//swfobject.embedSWF("preview.swf", "flashcontent", width, height, "9.0.0", "expressInstall2.swf", flashvars, params, attributes);
				SWFID = "flashcontent";

	}

});
	
function fixSitemap() {
	jQuery("#sitemap40>a").text("Home");
	jQuery("#sitemap63>a").text("Meet Us");
	jQuery("#sitemap64>a").text("Our Services");
	jQuery("#sitemap65>a").text("New Patient Info");
	jQuery("#sitemap66>a").text("Games and Contests");
	jQuery("#sitemap101>a").text("Technology");
	jQuery("#sitemap108>a").text("Patient Info");
}
window.addEvent('domready', fixSitemap);


function startGallery() {
	if (jQuery('#myGallery').length) {
		var myGallery = new gallery($('myGallery'), {
			timed: true
		});
	}
}
window.addEvent('domready', startGallery);




