MySpace.UI.PopupV2=function(J){var M=this,A,L,I,D,E,K,C;function H(){L=B("msPopupV2Overlay",document.body);I=B("msPopupV2Wrapper",document.body);D=B("msPopupV2Box",I);E=B("msPopupV2Content",D);K=B("msPopupV2Border",D);C=B("msPopupV2Close",D);$addHandler(C,"click",M.hide);$addHandler(window,"resize",G);M.set(J||{});MySpace.UI.addStyles(".msPopupV2Overlay { position:absolute;top:0;left:0;display:none;z-index:1000200;width:100%;opacity:0.6;filter:alpha(opacity=60);background:#000; }.msPopupV2Wrapper { position:absolute;left:0;display:none;width:100%;z-index:1000201 }.msPopupV2Box { margin:0 auto;padding:10px;position:relative; }.msPopupV2Border { position:absolute;top:0;left:0;background:#000;height:100%;width:100%;opacity:0.33;filter:alpha(opacity=33);-moz-border-radius:10px;-webkit-border-radius:10px;z-index:-1; }.msPopupV2Close { position:absolute;top:-5px;right:-7px;height:15px;width:15px;background:url("+MySpace.StaticContentBase+"/modules/common/static/img/closepopup.png);cursor:pointer; }.msPopupV2Content { height:100%;width:100%;overflow:auto;background:#444; }",false,"MySpace.UI.PopupV2")}function G(){L.style.height=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)+"px"}function B(O,N){var P=document.createElement("div");P.className=O;N.appendChild(P);return P}function F(Q){if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<=6){var P="iframe,select,embed,object",O=$q(P),N=$q(P,I);Array.forEach(O,function(R){if(Array.indexOf(N,R)==-1){if(Q){R.setAttribute("origvis",R.style.visibility)}R.style.visibility=Q?"hidden":(R.getAttribute("origvis")||"")}})}}M.show=function(){G();L.style.display="block";I.style.display="block";D.style.height=J.height+"px";D.style.width=J.width+"px";var N=window.innerHeight||document.documentElement.clientHeight,O=document.documentElement.scrollTop||document.body.scrollTop;I.style.top=(O+Math.max(Math.round((N-J.height)/2),50))+"px";K.style.zoom="1";K.style.zoom="";F(true);A=true};M.hide=function(N){L.style.display="";I.style.display="";F(false);A=false};M.set=function(N){for(var O in N){J[O]=N[O]}if(N.content){if(typeof N.content=="string"){E.innerHTML=N.content}else{E.innerHTML="";E.appendChild(N.content)}}if(A){M.show()}};M.getCloseButton=function(){return C};H()};if(!MySpace){MySpace={}}if(!MySpace.UI){MySpace.UI={}}MySpace.UI.LoginOverlayClient=(function(){var B=this,H,I=350,D=550,C=450,F;function A(){return !(MySpace.ClientContext&&MySpace.ClientContext.UserId>0)}function E(){var J;if(document.domain.indexOf("myspace.dev")>=0){document.domain="myspace.dev";J="http://secure.myspace.dev"}else{if(document.domain.indexOf("myspace.com")>=0){document.domain="myspace.com";J="https://secure.myspace.com"}}J+="/index.cfm?fuseaction=login.simpleform&featureName=loginOverlay";if(H.titleClass1&&H.titleKey1){J+="&tc1="+H.titleClass1+"&tk1="+H.titleKey1}if(H.titleClass2&&H.titleKey2){J+="&tc2="+H.titleClass2+"&tk2="+H.titleKey2}return J}function G(){var J=document.createElement("iframe");J.style.height="99.3%";J.style.width="100%";J.style.border="none";J.scrolling="no";J.frameBorder="0";J.src=E();return J}B.show=function(J){H={};if(J){for(var K in J){H[K]=J[K]}}if(A()){var L={height:I,width:C,content:G()};if(!F){F=new MySpace.UI.PopupV2(L)}else{F.set(L)}F.show();return true}else{if(H.alreadyLoggedInCallback&&typeof(H.alreadyLoggedInCallback)=="function"){H.alreadyLoggedInCallback()}else{B._loggedIn()}}return false},B.hide=function(){if(F){F.hide()}};B._resizeForCaptcha=function(J){if(F){if(J){F.set({height:D})}else{F.set({height:I})}}};B._loggedIn=function(J){B.hide();if(H.loggedInCallback&&typeof H.loggedInCallback=="function"){H.loggedInCallback(J)}else{if(H.redirectUrl&&typeof H.redirectUrl=="string"){window.top.location=H.redirectUrl}else{window.location.reload(true)}}};return B})();
