$(document).ready(function(){
	var tabContainers = $('div.main-tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.main-tabs ul.main-tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).fadeIn('slow');
				$('div.main-tabs ul.main-tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();


    $("#tellfriend").hide();
    $("#forwardToFriend").show();
	$("#forwardFriend_subject").val(document.title);
	$("#tellfriend a.close").click(function() {
		$("#tellfriend").fadeToggle("slow");
	});
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
	  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
	};
});
function forwardFriend()
{
	$("#tellfriend").fadeToggle('slow');
	_gaq.push(['_trackEvent','Forward To Friend', 'Open']);
}
function forwardFriend_sendMail()
{
	var strData = new Object();
	strData.COMMAND = 'forwardtofriend';
	strData.addressTo = $("#forwardFriend_to").val();
	strData.addressFrom = $("#forwardFriend_from").val();
	strData.subject = $("#forwardFriend_subject").val();
	strData.message = $("#forwardFriend_message").val();
	strData.url = location.href;
	strData.name = $("#forwardFriend_name").val();
	strData.ie = Math.floor(Math.random() * 101);
	
	$("#forwardFriend_spinner").toggle();
	_gaq.push(['_trackEvent', 'Forward To Friend', 'Send']);
	$.get("/includes/emailer.aspx", strData, function (data) 
	{ 
		$("#forwardFriend_success").toggle(function(){
			$(this).animate({opacity: 1.0}, 5000,function(){
				$("#tellfriend").fadeToggle('slow',function(){
					$("#forwardFriend_from").attr("value","");
					$("#forwardFriend_name").attr("value","");
					$("#forwardFriend_to").attr("value","");
					$("#forwardFriend_message").val("Add a message to the recipient.");
					$("#forwardFriend_success").toggle();
				});	
			});
		});		
	});
	$("#forwardFriend_success").css("display","none");
	$("#forwardFriend_spinner").css("display","none");
}
