jQuery(document).ready(function($){
								

	 $('.acc h4').click(function() {
		 $(this).toggleClass('active').next().toggle("fast");
		 return false;
	 }).next().hide(); 								
    
	/*Menu Implementation*/
	
	$("#menu-parent").click(function(){
		$('#navigation').slideDown('fast');
		return false;
	});
	
	$("body").click(function(){							 
		var elem = $(this).attr('#menu-parent');
		if(!elem)
		{
		$('#navigation').slideUp('fast');
		return true;
		}		
		
	});
	
	$('ul.Level0').addClass('clearfix');	
	$('#navigation a[href="#"]').click(function() { return false; });
	
	/* remove box from links */
	$('a').focus(function(){ this.blur(); });
	
	$('.slides').cycle({speed: 2000, timeout: 5000});
	
/*Preload the menu backgrounds*/	
	menuImage1 = new Image(); 
	menuImage1.src = DNN_skinPath + "images/patientforms_hover.png";
	menuImage2 = new Image(); 
	menuImage2.src = DNN_skinPath + "images/sleepApnea_hover.png";
	menuImage3 = new Image(); 
	menuImage3.src = DNN_skinPath + "images/mail_hover.jpg";
	menuImage4 = new Image(); 
	menuImage4.src = DNN_skinPath + "images/getdirection_hover.jpg";
	menuImage5 = new Image(); 
	menuImage5.src = DNN_skinPath + "images/bg_menu.png";
	menuImage6 = new Image(); 
	menuImage6.src = DNN_skinPath + "images/Menu_hover.jpg";

	if($("#invisalign-video").length)
	{
	flowplayer("invisalign-video", {
				src: "http://tools.televoxsites.com/vendor/flash/flowplayer-3.2.6.swf",
				wmode: "transparent"
			}, {
			plugins: { controls: { url: 'flowplayer.controls-tube-3.2.4.swf' } },
			clip: { autoPlay: false, autoBuffering: true, url: 'http://tools.televoxsites.com/vendor/flash/invisalign.flv' }
		});
	}
	
	$('#office-tour').cycle({
		speed: 1500,
		timeout: 7000,
		next: '.next',
		prev: '.prev'
	});



	if($('#vid').length) {
		loadVid();
		
		$("#inline").click(function()
		{
			$("#lightvid").fadeIn(300);
		});
	}
	
	$('#invischoose').flashembed({src:'/portals/0/invis_vid_story/invisalignflash/swf/invisalign.swf', wmode:'transparent'});
	
	
});

//sIFR implementation
function pageScripts(){
	var BaskervilleOldFace = {  src: DNN_skinPath + 'BaskervilleOldFace.swf' };
	sIFR.activate(BaskervilleOldFace);
	sIFR.replace(BaskervilleOldFace, {
	  selector: 'h1', 
	  wmode: 'transparent', 
	  src:  DNN_skinPath +  'BaskervilleOldFace.swf', 
	  css: [ '.sIFR-root {color:#ffffff;font-size:33px;}'  ] 
	});
}

function loadVid()
{
	flowplayer("vid", {
			src: "/portals/0/flowplayer-3.2.6.swf",
			wmode: "transparent"
		}, {
		plugins: { controls: { url: 'flowplayer.controls-tube-3.2.4.swf' } },
		clip: { autoPlay: false, autoBuffering: true }
	});

}


