
$(document).ready(function() {
    // Flash Hero
    var flashvars = {
		vpFile: "/_ui/srauscmaster/swf/videoplayer.swf",
		imgsFile: "/_ui/srauscmaster/swf/images.swf"
	};
	var params = {
		quality: "high",
		scale: "noscale",
		wmode: "transparent"
	};
    swfobject.embedSWF("/_ui/srausc/swf/hero.swf", "flashcontainer", "863", "329", "8.0", "/jsx/ext/swfobject/expressInstall.swf", flashvars, params);


    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);
		}
	});
});
