jQuery(document).ready(function($){
	$('#navigationTop div.Parentmain1').each(function(index){
		var thisFlyout = $(this).find('div.clLeft1');
		
		$(thisFlyout).find('h3').each(function(index){
			if($(this).width()<156){
				$(this).css({'width':155});
			}
		});
		
		
		if($(thisFlyout).width()>200){
			$(thisFlyout).css('margin-left',(($(thisFlyout).width()/2) - $(this).width()/2)*-1);
		}
		if(index==0 & parseFloat($(thisFlyout).css('margin-left')) < -205){
			$(thisFlyout).css('margin-left','-205px');
		}
	});
	$('#navigationTop div.Parentmain1').hover(function(){
		$(this).addClass('hover');
		$(this).removeClass('hoverout');
	});
	$('#navigationTop div.Parentmain1').mouseleave(function(){
		$(this).removeClass('hover');
		$(this).addClass('hoverout');
	});
	$('ul.navigationFooter li.navigationFooter').last().addClass('last-child');
	if($('#flashServiceCanvas').length > 0){
		swfobject.embedSWF("rex_footer_v4.swf", "flashServiceCanvas", "362", "280", "9.0.0","","",{wmode:"transparent"});
	}
	if($('#homeslider').length > 0){
		featuredcontentslider.init({
			id: "homeslider",
			contentsource: ["inline", ""],
			toc: "#increment",
			nextprev: ["",""],
			revealtype: "click",
			enablefade: [true, .1],
			autorotate: [true, 9000],
			onChange: function(previndex, curindex){
				$('div.contentdiv_external').not('#contentdiv_'+curindex).hide();
				$('#contentdiv_'+curindex).show();
			}
		});
		featuredcontentslider.jumpTo('homeslider',1);
	}
	if($('body#bodylayout').length){
		$('#containerBody div.column_right').css('display','table');
	}
	$('ul.ytv').ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytv'});
	
	if(/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32"){
		var physicianPhoto = $('#random_home');
		if(physicianPhoto.length > 0){
			var physicianPhotoImage = $(physicianPhoto).css('background-image').split('url("')[1].split('")')[0];
			$(physicianPhoto).css('background-image', 'none');
			$(physicianPhoto).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + physicianPhotoImage + "',sizingMethod='scale')";
		}
	}
	
});
