
$(document).ready(function() {
    
    jQuery.getFeed({
        url: '/uscdocs/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 #homeCol1 .social, body.home #homeCol2 .my-health-wrap, body.home #homeCol3 .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);
		}
	});
	
    
    $('#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');
    });
    
    $('body.home .featured-video-tabs li, body.home #homeSearch .block-find-tabs li').hover(function(){
        $(this).addClass('hover');
    }, function(){
        $(this).removeClass('hover');
    });
	
	docsHomeScroller = new docsHomeScroller();
	docsHomeScroller.play();
});


