$(document).ready(function() {
	$("#nfl_btnShare img").unbind("hover").hover(function() {
		$(this).attr("src", "/microsites/nfl/images/2009/btn-nflshare-over.gif");
		$(this).css("cursor", "pointer");
	}, function() {
		$(this).attr("src", "/microsites/nfl/images/2009/btn-nflshare.gif");
		$(this).css("cursor", "auto");
	});

	$("#nfl_btnShare img").unbind("click").click(function(e) {
		var panelOffset = $("#nfl_btnShare").offset();
		$(".nfl_share_overlay").css({ "left": panelOffset.left - 18, "top": panelOffset.top + 5, "width": "85px" });
		$(".nfl_share_overlay").show();
		e.preventDefault();
	});
	
	$(".nfl_share_overlay_top").unbind("hover").hover(function() {
		$(this).css("cursor", "pointer");

    	}, function() {
    		$(this).css("cursor", "auto");
   		
	});	
	
	$(".nfl_share_overlay_top").unbind("click").click(function(e) {
		$(".nfl_share_overlay").hide();
		e.preventDefault();
	});

	emailLink = "https://ebm.cheetahmail.com/r/regf2?a=0&aid=261845277&n=80";
	$("<li><a id='share_email' href=\"javascript:pop_email(emailLink);\">Email</a></li>").appendTo(".nfl_share_overlay_bottom ul");
	
	$("div#nfl_btnShare").show();
});

//popup email form
function pop_email(url) {
	var newwindow;

	if ($.browser.msie) {
		winWidth = 717;
	}
	else {
		winWidth = 700;
	}	
	
	newwindow=window.open(url,'name','height=680, width=' + winWidth + ', scrollbars=1');
	if (window.focus) {newwindow.focus()}
}
