var path;var width;var wideWidth;var protocol;var shellID;var iframeName;var filename;var allowAnonymousViewer;$().ready(function(){$("div.overlay_shell").jqm({modal:true,toTop:true});$("a.iframe_invite_link").click(function(){path="user/friend_invites.aspx?ChannelID="+iFrameChannelID;width=600;wideWidth=835;protocol="https";shellID="#invite_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=false;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("a.iframe_share_link").click(function(){id=stripPrefix("share_link_",$(this).attr("id"));path="user/share_replay.aspx?UserID="+userID+"&ReplayID="+id+"&ChannelID="+iFrameChannelID;width=600;wideWidth=600;protocol="http";shellID="#share_replay_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=false;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("#awards_link").click(function(){path="profile/awards.aspx?ChannelID="+iFrameChannelID+"&UserID="+profileUserID;width=710;wideWidth=710;protocol="http";shellID="#awards_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=true;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("#stats_link").click(function(){path="profile/stats.aspx?ChannelID="+iFrameChannelID+"&UserID="+profileUserID;width=710;wideWidth=710;protocol="http";shellID="#stats_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=true;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("#appearance_link").click(function(){path="profile/appearance.aspx?ChannelID="+iFrameChannelID+"&UserID="+profileUserID;width=710;wideWidth=710;protocol="http";shellID="#appearance_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=true;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("#equipment_link").click(function(){path="profile/equipment.aspx?ChannelID="+iFrameChannelID+"&UserID="+profileUserID;width=710;wideWidth=710;protocol="http";shellID="#equipment_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=true;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$("#score_history_link").click(function(){path="profile/score_history.aspx?ChannelID="+iFrameChannelID+"&UserID="+profileUserID;width=710;wideWidth=710;protocol="http";shellID="#score_history_overlay_shell";iframeName="overlay_iframe";allowAnonymousViewer=true;renderOverlay(path,width,wideWidth,protocol,shellID,iframeName,allowAnonymousViewer)});$(window).resize(function(){$.centerOverlay(window,".overlay_shell")})});function closeOverlay(){if($.browser.msie&&$.browser.version=="6.0"){$(".overlay_shell").height(550).width(605);$(".overlay_shell.modal_panel").css({position:"absolute"})}else{$(".overlay_shell").height(545).width(600);$(".overlay_shell.modal_panel").css({position:"fixed"})}$(".overlay_shell").jqmHide().empty().html()}function resizeOverlay(a){if(a=="wide"){$("iframe#overlay_iframe").width(wideWidth);$(".overlay_shell").width(wideWidth);$.centerOverlay(window,".overlay_shell")}else{$("iframe#overlay_iframe").width(width);$(".overlay_shell").width(width);$.centerOverlay(window,".overlay_shell")}}function renderOverlay(p,j,b,a,r,o,n){if(userID==0&&!n){setTimeout(function(){window.location.href=baseSitePath+"login.aspx?ReturnUrl="+encodeURI(loginURL)},0)}else{if(userID>0||n){setTimeout(function(){$(r).jqmShow();$.centerOverlay(window,r)},0);var k=$.url.attr("source");var q=$.url.attr("protocol");var d=$.url.attr("host");var h=$.url.attr("directory");var f=$.url.attr("file");var c=$.url.attr("query");var g=a;var s=d;var l=p;var i=g+"://"+s+"/"+l;var m=$.url.setUrl(i).attr("directory");var t=g+"://"+s+baseSitePath+l;var e=document.createElement("iframe");$(e).attr("id","overlay_iframe");$(e).attr("src",t);$(e).attr("name",o);$(e).attr("border","0");$(e).attr("frameBorder","0");setTimeout(function(){$(r).append($(e))},0);$.centerOverlay(window,r);return false}}}jQuery.centerOverlay=function(d,f){if($(f).css("display")=="block"){var h=$(d).height();var e=$(d).width();var a=$(f).height();var g=$(f).width();var b=0;var c=0;if(e>g){b=(e-g)/2}if(h>a){c=(h-a)/2}$(f).css("left",b);$(f).css("top",c)}};