// JavaScript Document
$(document).ready(function(){
	//hiding elements
	$('.sub').hide();
	
	//remove focus box
	if(document.getElementsByTagName) {
		var a = document.getElementsByTagName("a");
		for(var i = 0; i < a.length; i++){
		a[i].onfocus = function(){this.blur();};
		}
	}
	
	//menu
	function mouseOver(elem) {
		$('.sub', this).fadeIn().parent().addClass('current');		
	}
	function mouseOut(elem) {
		$('.sub', this).fadeOut().parent().removeClass('current');	
	}
	
	$('#innermenu > .abscontainer').hoverIntent(mouseOver, mouseOut);
	
	//photo rotation
	$('#rotation').fadeIn(1100);
    $('#rotation').cycle({
		fx: 'fade',
		speed: 1200,
		timeout: 5000,
		cssBefore: {right : 0}
	});
	
	if ($("#beanorthodontist").length) { // if div exists...
   		//embed be an orthodontist feature
		flashembed("beanorthodontist",{src:"http://tools.televoxsites.com/features/beOrtho.swf", wmode:"transparent"});
 	}
	
	//img opacity
	$('#callouts a, #left img').css({'opacity' : '0.8' })
	$('#callouts a, #left img').each(function() {
	$(this).hover(function() {
		$(this).stop().animate({ opacity: 1.0 }, 200);
	},
	    function() {
		   $(this).stop().animate({ opacity: 0.8 }, 200);
	    });
	});
	
	//videos
	if ($("#bioadaptive").length) { // if div exists...
   		flowplayer("bioadaptive", "/Portals/0/videos/flowplayer-3.2.4.swf", {
		wmode: "transparent",
		plugins: { controls: { url: 'flowplayer.controls-tube-3.2.2.swf' } },
		clip: { autoPlay: false, autoBuffering: true, url: '/Portals/0/videos/DamonDamonClearLobby_Video1.flv' }
		});
 	}	
				
});//end document ready







