
$(document).ready(function() {

	var IE6 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 6);
	if(IE6) {
		/// PNGs
		$("img[src$='.png']").each(function() {
			var src = $(this).attr('src');
			$(this).attr("src", "http://www.dynamit.us/img/spacer.gif").attr("style", "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "');");
		});

		document.execCommand("BackgroundImageCache",false,true);
	}

	$("#nav").dynamItDrop();


	// info sliders on home page highlights boxes
	$('#your-physicians-content').click(function() {
		var top = $('#your-physicians-content').css('top');
		if(top == '182px') {
			$(this).animate({ top: '38px' }, 1000);
		} else {
			$(this).animate({ top: '182px' }, 1000);
	     }
	});
	$('#patient-story-content').click(function() {
		var top = $('#patient-story-content').css('top');
		if(top == '182px') {
			$(this).animate({ top: '38px' }, 1000);
		} else {
			$(this).animate({ top: '182px' }, 1000);
	     }
	});

	startRotation();

     $('.ddtop').css('top', '0px');
	$('.ddbottom').css('bottom', '0px');

});

function startRotation() {
	setTimeout('rotate()', 5000);
}

function rotate() {
	var vis = $('.hpg:visible');
	var num = vis.length;
	var selected = vis.eq(num-1);
	selected.fadeOut();
	if(num == 1) {
		$('.hpg').fadeIn();
	}
	setTimeout('rotate()', 5000);
}