$.noConflict();
jQuery(document).ready(function($){
/*accordian */
	jQuery('.submenu').hide();
	jQuery('.menulink').click(function(){
		if( $(this).next().is(':hidden') ) { 
			$('.menulink').removeClass('active').next().slideUp(); 
			$(this).toggleClass('active').next().slideDown(); 
		}
		return false; 
	});
/*img opacity*/
jQuery('.logos img, #socialIcons img').css({'opacity' : '0.8' })
jQuery('.logos img, #socialIcons img').each(function() {
	$(this).hover(function() {
		$(this).stop().animate({ opacity: 1.0 }, 200);
	},
   function() {
	   $(this).stop().animate({ opacity: 0.8 }, 200);
   });
});

/*cycle*/
jQuery('.testimonials').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});

/*link*/
jQuery('.testimonials').click(
function()
{
    window.location = $(this).attr('url');
    return false;
});

/*asterisk*/
var string = jQuery('#dnn_ctr422_FormMaster_lbl_ctl__20080307T162547').text().split("*");
var string2 = jQuery('#dnn_ctr422_FormMaster_lbl_ctl__20080307T163603').text().split("*");
var string3 = jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173049').text().split("*");
var string4 = jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173608').text().split("*");
var string5 = jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173253').text().split("*");
jQuery('#dnn_ctr422_FormMaster_lbl_ctl__20080307T162547').text("* " + string[0]);
jQuery('#dnn_ctr422_FormMaster_lbl_ctl__20080307T163603').text("* " + string2[0]);
jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173049').text("* " + string3[0]);
jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173608').text("* " + string4[0]);
jQuery('#dnn_ctr423_FormMaster_lbl_ctl__20080307T173253').text("* " + string5[0]);



//alert(string);*/
//string.replace("*", "");

/*var lastIndex = string.length - 1
     if ( string.charAt(lastIndex) == "*" ) {
     string.replace("*", "");
     } else {
     alert('No!')
    }*/













if (jQuery("#flashLogo").length) { // if div exists...
    // add the flash
  var sshow = new SWFObject(DNN_skinPath+"flash/Logo_1.swf", "slideshow", "416", "331", "8", "#ffffff");
  sshow.addParam("wmode", "transparent");
  sshow.addVariable("xmlfile", DNN_skinPath+"flash/xml/data.xml");
  sshow.write("flashLogo");
 }

 if (jQuery("#flashPhoto").length) { // if div exists...
    // add the flash
  var sshow = new SWFObject(DNN_skinPath+"flash/Flash_Photos_2.swf", "slideshow", "564", "420", "8", "#ffffff");
  sshow.addParam("wmode", "transparent");
  sshow.addVariable("xmlfile", DNN_skinPath+"flash/xml/data.xml");
  sshow.write("flashPhoto");
 }
 
 if (jQuery("#beforeAfter").length) { // if div exists...
    // add the flash
  var so = new SWFObject("/features/loader.swf", "features", "500", "315", "9", "#FF6600");	
	so.addVariable("config", "/features/config.xml");
	so.addVariable("feature", "beforeafter");
	so.addParam("wmode", "transparent");
	so.addParam("quality", "high");
	so.write("beforeAfter");
 }
 
 if (jQuery("#oralHygiene").length) { // if div exists...
    // add the flash
  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("oralHygiene");
 }
 
 if (jQuery("#commonProblems").length) { // if div exists...
    // add the flash
  var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600");	
	so.addVariable("config", "/features/config.xml");
	so.addVariable("feature", "problems");
	so.addParam("wmode", "transparent");
	so.addParam("quality", "high");
	so.write("commonProblems");
 }
 
 if (jQuery("#emergencyInfo").length) { // if div exists...
    // add the flash
  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("emergencyInfo");
 }

if (jQuery("#types").length) { // if div exists...
    // add the flash
  var so = new SWFObject("/features/loader.swf", "features", "500", "273", "9", "#FF6600");	
	so.addVariable("config", "/features/config.xml");
	so.addVariable("xmlfile", "/features/types.xml");
	so.addParam("wmode", "transparent");
	so.addParam("quality", "high");
	so.write("types");
 }
 
if (jQuery("#colorChooser").length) { // if div exists...
    // add the flash
  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("colorChooser");
 }
 
 if (jQuery("#retainer").length) { // if div exists...
    // add the flash
  var so = new SWFObject("http://tools.televoxsites.com/features/retainer.swf", "feature", "450", "265", "6", "ffffff");
so.addParam("wmode", "transparent");
so.write("retainer");
 }
 
 if (jQuery("#flash-video").length) { // if div exists...
   flowplayer("flash-video", "/Portals/_default/Skins/siteskin/flash/flowplayer-3.1.5.swf", {
		plugins: { controls: { url: 'flowplayer.controls-tube-3.1.5.swf' } },
		clip: { autoPlay: false, autoBuffering: true }
	});
 }
 
 if (jQuery("#intro-video").length) { // if div exists...
   flowplayer("intro-video", "/Portals/_default/Skins/siteskin/flash/flowplayer-3.1.5.swf", {
		plugins: { controls: { url: 'flowplayer.controls-tube-3.1.5.swf' } },
		clip: { autoPlay: false, autoBuffering: true }
	});
 }

 $('.accordion h2').click(function() {
	 	$('h2.active').removeClass('active').next().toggle('normal');
		$(this).toggleClass('active').next().toggle('normal');
		return false;
	}).next().hide();

});

/*sifr */
function pageScripts(){
var TwenCentMT = {  src: DNN_skinPath + '/flash/TwenCentMT.swf' };
sIFR.activate(TwenCentMT);
sIFR.replace(TwenCentMT, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  '/flash/TwenCentMT.swf', 
  css: [ '.sIFR-root {font-size:36px;color:#004B8F;}'  ]
});
}

