var tweetmeme_service = 'bit.ly';
var tweetmeme_source = 'nhl';
function tweetmemeWrite(){
//	var s=s_gi('nhlnhlleaguecom,nhlglobal');s.linkTrackVars='prop1,prop5,events';s.prop1='news';s.prop5='NHL.com';s.linkTrackEvents='event27';s.events='event27';s.tl (this,'o','shr:twitter:widget');
	var _url=window.location.href;if(_url.indexOf('?')>0) { _url += "&cmpid=twt:shr:widget"; } else { _url += "?cmpid=twt:shr:widget"; }; var _url=_url.replace(/((?:\?|&)?fbc_receiver=.+)?(?:#.*)?$/,"");var url=escape((typeof tweetmeme_url=="string")?tweetmeme_url:((typeof TWEETMEME_URL=="string")?TWEETMEME_URL:_url)).replace(/\+/g,"%2b");var source=(typeof tweetmeme_source=="string")?escape(tweetmeme_source):((typeof TWEETMEME_SOURCE=="string")?escape(TWEETMEME_SOURCE):false);var style=(typeof tweetmeme_style=="string")?escape(tweetmeme_style):((typeof TWEETMEME_STYLE=="string")?escape(TWEETMEME_STYLE):"normal");var service=(typeof tweetmeme_service=="string")?escape(tweetmeme_service):((typeof TWEETMEME_SERVICE=="string")?escape(TWEETMEME_SERVICE):false);var service_api=(typeof tweetmeme_service_api=="string")?escape(tweetmeme_service_api):((typeof TWEETMEME_SERVICE_API=="string")?escape(TWEETMEME_SERVICE_API):false);var alias=(typeof tweetmeme_alias=="string")?escape(tweetmeme_alias):((typeof TWEETMEME_ALIAS=="string")?escape(TWEETMEME_ALIAS):false);var src="http://api.tweetmeme.com/button.js";switch(style){case"compact":var h=20;var w=90;break;case"rednose":var h=61;var w=50;break;default:var h=61;var w=50;break}src+="?url="+url;src+="&style="+style;if(source!=false){src+="&source="+source}if(service){src+="&service="+service}if(service_api){src+="&service_api="+service_api}if(alias){src+="&alias="+alias}document.write('<iframe src="'+src+'" height="'+h+'" width="'+w+'" frameborder="0" scrolling="no"></iframe>');tweetmeme_url=null;TWEETMEME_URL=null;tweetmeme_source=null;TWEETMEME_SOURCE=null;tweetmeme_service=null;TWEETMEME_SERVICE=null;tweetmeme_service_api=null;TWEETMEME_SERVICE_API=null;tweetmeme_style=null;TWEETMEME_STYLE=null;
	return false;
}
function fbs_click() {
	var s=s_gi('nhlnhlleaguecom,nhlglobal');s.linkTrackVars='prop1,prop5,events';s.prop1='news';s.prop5='NHL.com';s.linkTrackEvents='event27';s.events='event27';s.tl (this,'o','shr:facebook:widget');
	u=location.href;if(u.indexOf('?')>0) { u += "&cmpid=fb:shr:widget"; } else { u += "?cmpid=fb:shr:widget"; }; t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

var teamsMap = {
	"COL" : "avalanche", "CHI" : "blackhawks", "CBJ" : "bluejackets", "STL" : "blues", "BOS" : "bruins", "MTL" : "canadiens",
	"VAN" : "canucks", "WSH" : "capitals", "PHX" : "coyotes", "NJD" : "devils", "ANA" : "ducks", "CGY" : "flames",
	"PHI" : "flyers", "CAR" : "hurricanes", "NYI" : "islanders", "LAK" : "kings", "TBL" : "lightning", "TOR" : "mapleleafs",
	"EDM" : "oilers", "FLA" : "panthers", "PIT" : "penguins", "NSH" : "predators", "NYR" : "rangers", "DET" : "redwings",
	"BUF" : "sabres", "OTT" : "senators", "SJS" : "sharks", "DAL" : "stars", "ATL" : "thrashers", "MIN" : "wild"
};

var teamsAbbrevMap = {
	"avalanche" : "COL", "blackhawks" : "CHI", "bluejackets" : "CBJ", "blues" : "STL", "bruins" : "BOS", "canadiens" : "MTL",
	"canucks" : "VAN", "capitals" : "WSH", "coyotes" : "PHX", "devils" : "NJD", "ducks" : "ANA", "flames" : "CGY",
	"flyers" : "PHI", "hurricanes" : "CAR", "islanders" : "NYI", "kings" : "LAK", "lightning" : "TBL", "mapleleafs" : "TOR",
	"oilers" : "EDM", "panthers" : "FLA", "penguins" : "PIT", "predators" : "NSH", "rangers" : "NYR", "redwings" : "DET",
	"sabres" : "BUF", "senators" : "OTT", "sharks" : "SJS", "stars" : "DAL", "thrashers" : "ATL", "wild" : "MIN"
	};

var teamsNameMap = {
	"avalanche" : "Colorado Avalanche", "blackhawks" : "Chicago Blackhawks", "bluejackets" : "Columbus Blue Jackets", "blues" : "St. Louis Blues", "bruins" : "Boston Bruins", "canadiens" : "Montreal Canadiens",
	"canucks" : "Vancouver Canucks", "capitals" : "Washington Capitals", "coyotes" : "Phoenix Coyotes", "devils" : "New Jersey Devils", "ducks" : "Anaheim Ducks", "flames" : "Calgary Flames",
	"flyers" : "Philadelphia Flyers", "hurricanes" : "Carolina Hurricanes", "islanders" : "New York Islanders", "kings" : "Los Angeles Kings", "lightning" : "Tampa Bay Lightning", "mapleleafs" : "Toronto Maple Leafs",
	"oilers" : "Edmonton Oilers", "panthers" : "Florida Panthers", "penguins" : "Pittsburgh Penguins", "predators" : "Nashville Predators", "rangers" : "New York Rangers", "redwings" : "Detroit Red Wings",
	"sabres" : "Buffalo Sabres", "senators" : "Ottawa Senators", "sharks" : "San Jose Sharks", "stars" : "Dallas Stars", "thrashers" : "Atlanta Thrashers", "wild" : "Minnesota Wild"	
}

function podcastPlayer(url) {
	if (url == null) return;
	var win = window.open(url,"podcastPlayer","resizable=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=485,height=225");
	if(win!=null)
		win.focus();
}

function mediaGalleryPlayer(url) {
	if (url == null) return;
	var win = window.open(url,"mediaGalleryPlayer","resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=755,height=800");
	if(win!=null)
		win.focus();
}

function realTimeSB(url, name) {
	if (url == null || name == null) return;
	var win = window.open(url,name,"width=428,height=228,resizable=no,location=no,menubar=no,scrollbars=auto,status=yes,toolbar=no,fullscreen=no,dependent=no");
	if(win!=null)
		win.focus();
}

function printPage(url) {
	if (url == null) return;
	var win = window.open(url,"printpage","resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=708,height=800");
	if(win!=null)
		win.focus();
}

function printStatsPage(url) {
	if (url == null) return;
	var win = window.open(url,"printpage","resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=972px,height=800");
	if(win!=null)
		win.focus();
}

function podcastPlayer(url) {
	if (url == null) return;
	var win = window.open(url,"podcastPlayer","resizable=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=485,height=225");
	if(win!=null)
		win.focus();
}

function playDLVideo(caption,src) {
	if (swfobject != null) swfobject.getObjectById("nhl").playVideo(caption, src);
}

function livePlayer(url) {
	if (url == null) return;
	var win = window.open(url,"livePlayer","resizable=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=650,height=260");
	if(win!=null)
		win.focus();
}

function gameCenterLive(url) {
	if (url == null) return;
	var win = window.open(url,"nhlgcconsole","scrollbars=yes,menubar=no,height=698,width=1010,top=0,left=0,resizable=yes,toolbar=no,location=no,status=no");
	if(win!=null)
		win.focus();
}

function toggleCommentView(divId, linkElementId, hiddenLabel, showLabel) {
	jQuery('#' + divId).slideToggle("slow", toggleLabel(divId, linkElementId, hiddenLabel, showLabel));							
}

function toggleLabel(divId, linkElementId, hiddenLabel, showLabel) {
	if (jQuery('#' + divId).is(":hidden")) {
		var state = showLabel;
    } else {
    	var state = hiddenLabel;
    } 
	jQuery('#' + linkElementId).html(state);
}

function showModal(ajaxUrl, posA, posB) {
	jQuery.post(ajaxUrl, {}, function(data) { jQuery('#basicModalContent').html(data); }, 'html');
	jQuery('#basicModalContent').modal({
		position : [posA, posB],
		dataCss : { 'padding' : '0px' },
		zIndex: 1000001
	});
}
function toggleStatsReports(id) {
	jQuery("#" + id).toggle();
}
function closeModalIfVisible() {
	if(jQuery.modal) { jQuery.modal.close(); }
}

jQuery(document).bind('keydown',function(e){if(e.keyCode==27){
	if(jQuery.modal) { jQuery.modal.close(); } 
	jQuery('#rfanLoginBubble').hide(); 
}
});
