/* Copyright (C) 2009 Microsoft Corporation */registerNamespace("Microsoft.Spaces.SharedDevTestConsts");Microsoft.Spaces.SharedDevTestConsts.Consts=new function(){this.idContainer="_nfu_div";this.idParent="_nfu_parent"};registerNamespace("Spaces.Popup");Spaces.Popup=new function(){function a(e,d){var a=new $UI.Popover,b=document.createElement("div");b.innerHTML=e;a.header=b;var c=document.createElement("div");c.innerHTML=d;a.body=c;a.width="512";a.modal=true;a.shadow=true;a.bodyPadding=true;return a}this.displayAlert=function(e,c,d){try{var b=a(e,c);b.addButton("idok",d,false,true);b.show()}catch(f){}};this.displayConfirm=function(f,e,d,c,g){try{var b=a(f,e);b.addButton("idok",d,true,false);b.addButton("idcancel",c,false,true);b.show(g,null)}catch(h){}}};Spaces_Controls_TextField_GetLabelElement=function(a){return document.getElementById(a+"_count")};Spaces_Controls_TextField_GetTextElement=function(a){return document.getElementById(a)};Spaces_Controls_TextField_GetMessage=function(b){var a=Spaces_Controls_TextField_GetTextElement(b);return new String(a.value)};Spaces_Controls_TextField_GetMessageLength=function(a){var b=Spaces_Controls_TextField_GetMessage(a);return b.trim().length};Spaces_Controls_TextField_DoMonitorLength=function(a){try{var c=Spaces_Controls_TextField_GetMessageLength(a),b=Spaces_Controls_TextField_GetLabelElement(a);b.innerHTML=c}catch(d){}};function Spaces_EventReply_OnShowReply(){document.getElementById("ReplyPrompt").style.display="none";document.getElementById("ReplyPanel").style.display="block"}function Spaces_EventReply_OnReplyCancel(){document.getElementById("ReplyPrompt").style.display="block";document.getElementById("ReplyPanel").style.display="none"}function Spaces_EventReply_OnReply(b){document.getElementById("Reply").disabled=true;document.getElementById("Cancel").disabled=true;var a=function(){document.forms["ReplyFormId"].submit()};if(b)Spaces.Controls.NameFixup.show(a);else a()}function Spaces_EventReply_OnRemove(){var a=function(a,b){if(b=="idok"){document.getElementById("Remove").value=1;a.disableButton("idok");a.disableButton("idcancel");document.forms["ReplyFormId"].submit()}else a.hide()};Spaces.Popup.displayConfirm(GetString("live.sndefaultstrings.strings.Events.Profile.EventReply.RemoveTitle"),GetString("live.sndefaultstrings.strings.Events.Profile.EventReply.RemoveContent"),GetString("live.sndefaultstrings.strings.global.yes"),GetString("live.sndefaultstrings.strings.global.no"),a)}registerNamespace("Spaces.Controls");Spaces.Controls.NameFixup=new function(){var a=null,b=null;this.show=function(c){b=c;a=new $UI.Popover;a.width="350";a.modal=true;a.shadow=true;a.bodyPadding=true;a.body=document.getElementById(Microsoft.Spaces.SharedDevTestConsts.Consts.idContainer);a.show()};this.cancel=function(){var a=new String(document.location.href);document.location.href=a};this.hide=function(){var d=document.getElementById(Microsoft.Spaces.SharedDevTestConsts.Consts.idParent),c=document.getElementById(Microsoft.Spaces.SharedDevTestConsts.Consts.idContainer);d.appendChild(c);a.hide();a=null;if(b)b()}}