/*
$(document).ready(function() {
    // Flash Hero
    var flashvars = {
        vpFile: "/_ui/srauscnor/swf/home-frame.swf"
        //, imgsFile: "/_ui/srauscnor/swf/images.swf"
    };
	var params = {
		quality: "high",
		scale: "noscale",
		wmode: "transparent"
	};
/*
	var installedVersionObj = swfobject.getFlashPlayerVersion();
    if (installedVersionObj.major >= 8) {
        swfobject.embedSWF("/_ui/srauscuni/swf/images.swf", "flashcontainer", "863", "329", "8.0", "/jsx/ext/swfobject/expressInstall.swf", flashvars, params);
    } else {
        $('#flashcontainer div.noflash').show();
    }
*

	$('#hero').addClass('loaded');
});
*/
$(document).ready(function() {
    jQuery.getFeed({
        url: '/uscuh/about/press-room/rss/78001/10',
        success: function(feed) {
        	if (feed.items.length > 5) {
        		feed.items = feed.items.slice(0,5);
        	}
            com_doctorsofusc_home_feed.items = feed.items;
            com_doctorsofusc_home_feed.next();
        }
    });

    // Next link
	$('#news a.next').click(function() {
		com_doctorsofusc_home_feed.next();
		return false;
	});

	// If Mac Firefox
	if( $.browser.mozilla && navigator.platform == "MacPPC" ) {
	    $('#hero').append('<div id="flashcontainer-backup"></div>');
	    com_srausc_contactus_macfirefox();
	}
	
	$('#homeSearch .block-find-tabs li').click(function(){
		$('#homeSearch .block-find-tabs li').removeClass('active');
		$('#homeSearch div.block-find').removeClass('active');
		$( '#homeSearch div.block-find.'+$(this).attr('rel') ).addClass('active');
		$(this).addClass('active');
	}).each(function(){
		$(this).append("<div class='tl'>&nbsp;</div><div class='tr'>&nbsp;</div>");
	});

	$('#homeContent .featured-video-tabs li').click(function(){
		$('#homeContent .featured-video-tabs li').removeClass('active');
		$('#homeContent div.videos-wrap .category').removeClass('active');
		$( '#homeContent div.videos-wrap .category.c'+$(this).attr('rel') ).addClass('active');
		$(this).addClass('active');

	}).append("<div class='tl'>&nbsp;</div><div class='tr'>&nbsp;</div>");

	$('#homeSearch div.block-find, body.home #homeCol2 .videos-wrap')
		.append("<div class='bl'>&nbsp;</div><div class='br'>&nbsp;</div>");


	$('body.home #homeCol2 .social, body.home #homeCol2 .my-health-wrap, body.home #homeCol1 .best-doctors-wrap')
		.append("<div class='bl'>&nbsp;</div><div class='br'>&nbsp;</div><div class='tl'>&nbsp;</div><div class='tr'>&nbsp;</div>");

	$('#homeSearch div.block-find .primary-search input.form-text').focus(function(){
		if (this.value == this.defaultValue) {
			$(this).val('');
		}
	}).blur(function(){
		if (this.value == '') {
			$(this).val(this.defaultValue);
		}
	});
	
	   // reposition 'Connect With Us'
	var col1H = $('#homeCol1').height();
	var col2H = $('#homeCol2').height();
	/*
	if (col2H > col1H) {
	    var curMargin = $('#homeCol1 .social').css('marginTop').replace('px', '');
	    $('#homeCol1 .social').css('marginTop', (1*curMargin+12+( (col2H-col1H) ))+'px');
	   
    }
    */
    
    $('#homeSearch .block-find .primary-search div.form-item input.submit').hover(function(){
        $(this).parents('div.form-item').addClass('inputHover');
    }, function(){
        $(this).parents('div.form-item').removeClass('inputHover');
    });
	
	docsHomeScroller = new docsHomeScroller();
	docsHomeScroller.play();
});

