var flagDualCall=false;function expandCollapseByGroup(a){a=document.getElementById(a);a.style.display=a.style.display=="block"?"none":"block"}
function lifeSpace_setTitleBar(){try{var a=titlePrefix;if(currentTab!=null)if(currentTab=="Home")a=tabUnderProcessTitle!=null?titlePrefix+" | "+currentTab+" | "+tabUnderProcessTitle:titlePrefix+" | "+currentTab;else if(currentTab=="LifeSpace")a=tabUnderProcessTitle!=null?titlePrefix+" | "+lifespaceUnderProcess+" | "+tabUnderProcessTitle:titlePrefix+" | "+lifespaceUnderProcess;else if(currentTab=="CreateGoal")a=tabUnderProcessTitle!=null?titlePrefix+" | "+lifespaceUnderProcess+" | New Goal ":titlePrefix+
" | "+lifespaceUnderProcess;else if(currentTab=="GoalOutline")a=tabUnderProcessTitle!=null?titlePrefix+" | "+lifespaceUnderProcess+" | "+goalUnderProcess+" | "+tabUnderProcessTitle:titlePrefix+" | "+lifespaceUnderProcess+" | "+goalUnderProcess;document.title=a.replace(/&quot;/,"'")}catch(b){}}function hideLoginPopupDiv(a){a=a?a.target:event.srcElement;var b=document.getElementById("loginDiv");if(b!=null&&clickedInSidePopup(a,b)==false)b.style.display="none"}
function clickedInSidePopup(a,b){for(;a!=null;){if(a==b)return true;a=a.parentNode}return false}function loadLoginURL(a){document.getElementById("iframeLoginPopup").src=a}var ajaxRequestHandlerURL=null,templatesURL=null,titlePrefix="LifeSpace",tabUnderProcessTitle=null,projectUrl=null,newProjectUrl=null,hostName=null,dashBoardUrl=null,ajaxBookMark=null;function moveSourceToTargetDiv(a,b){a=document.getElementById(a);b=document.getElementById(b);a.parentNode.removeChild(a);b.appendChild(a)}
function refreshDashBoard(){if(dashBoardUrl!=null)window.location.href=dashBoardUrl}function setLogoWidth(a,b,c){if(a.firstChild.firstChild!=null){a=a.firstChild.firstChild;a.height=b;a.width=c}else alert("logo image not found")}function CheckUserLoginStatus(){var a=XML_element("Action","CheckUserLoginStatus");a=XML_element("AjaxRequest",a);a=AjaxRequest_GetParams("Community","",a);executeXmlHTTPPostRequest(ajaxRequestHandlerURL+"?pingInterval="+new Date,LifeSpace_handleServerResponse,0,a)}
function LifeSpace_handleServerResponse(a,b){LifeSpace_ServerResponse(a.responseText)}function LifeSpace_ServerResponse(a){var b=XML_createXmlDom(a).getElementsByTagName("Action")[0].firstChild.nodeValue;alert("server");if(b=="CheckUserLoginStatus")if(IsHavingException(a)==false){alert("true");return true}else{alert("false");return false}}
function setHeight(a){var b=document.getElementById("iframeLoginPopup"),c=document.getElementById("loginDiv");if(b!=null){c.style.height=a+"px";b.style.height=a+"px"}}function loginDivVisible(){return document.getElementById("loginDiv").style.display=="none"?false:true}
function hideIFrameDivLogin(){var a=document.getElementById("loginDiv");if(a!=null){a.style.display="none";a=document.getElementById("LoginControlContainer");if(document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("loginbox")==null)document.getElementById("iframeLoginPopup").contentWindow.document.body.innerHTML="";if(a!=null){var b=null;b=a.firstChild.nodeName=="A"||a.firstChild.nodeName=="a"?a.firstChild:a.firstChild.nextSibling;b!=null&&goalOutline_setControlText(b,
"Logout")}}}function ShowProcessingImage(){if(ajaxRequestCount!=null){ajaxRequestCount+=1;var a=document.getElementById("divProcessingImage");setProcessingImgPosition();if(a.style.display=="none")a.style.display="block"}else alert("processing img can't be started coz ajaxRequestCount not defined!")}
function HideProcessingImage(){if(ajaxRequestCount!=null){ajaxRequestCount-=1;if(ajaxRequestCount<=0){var a=document.getElementById("divProcessingImage");if(a!=null&&a.style.display=="block")a.style.display="none"}}else alert("processing img can't be closed coz ajaxRequestCount not defined!")}function setProcessingImgPosition(){var a=document.getElementById("divProcessingImage");a.style.top="200px";a.style.left="430px"}
function applySelection(a){if(a!=null&&a.style!=null){a.style.backgroundColor="#4F81BD";a.style.color="#ffffff";a.style.border="2px solid #385D8A"}}function applyDeSelection(a){if(a!=null&&a.style!=null){a.style.backgroundColor="#DEE4F1";a.style.color="Black";a.style.border="2px solid #A8C1DF"}}
function positionTitleDiv(a,b){a=document.getElementById(a);b=document.getElementById(b);for(var c=0,d=0;b;){d+=b.offsetLeft;c+=b.offsetTop;b=b.offsetParent}alert("Top : "+c+"    Left : "+d);a.style.top=c-10+"px";a.style.left=d-10+"px"}
function showLoginPopupFrameDiv(a){if(document.getElementById("loginDiv")){var b=document.getElementById("loginDiv"),c=document.getElementById("iframeLoginPopup");HideProcessingImage();if(document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("loginbox")==null)c.contentWindow.location=a;b.style.display="block";b.style.position="static";b.style.width="100%"}else window.location=window.location.hostname=="localhost"?"http://"+window.location.host+"/Website/":"http://"+window.location.hostname}
function addWithCDATA(a){return"<![CDATA["+a+"]]\>"}
function IsHavingException(a){var b=XML_createXmlDom(a),c=document.getElementById("divExceptionSummary"),d=document.getElementById("imgExceptionSummary");if(b.getElementsByTagName("Exception")[0]!=null)if(b.getElementsByTagName("Message")[0].firstChild.nodeValue!="Session Expired"){d.style.display="block";c.innerHTML="Exception:-"+b.getElementsByTagName("Message")[0].firstChild.nodeValue+"<br/><br/>StackTrace:-"+b.getElementsByTagName("StackTrace")[0].firstChild.nodeValue;return true}else{ajaxBookMark=
a;showLoginPopupFrameDiv(b.getElementsByTagName("LoginPopupUrl")[0].firstChild.nodeValue)}else{d.style.display="none";c.innerHTML="";return false}}function adjustIFrameHeight(){var a=document.getElementById("iframeLoginPopup"),b=a.contentWindow.document.getElementById("container");a!=null&&b!=null?incrementHeight("loginDiv","1",b.offsetHeight):setTimeout("adjustIFrameHeight();",5)}
function setLoginDivHeightFromFrame(){var a=document.getElementById("iframeLoginPopup"),b=a.contentWindow.document.getElementById("container");if(a!=null&&b!=null){b=document.getElementById("loginDiv");a.style.height="150px";b.style.height="150px";alert(a.offsetHeight)}else setTimeout("setLoginDivHeightFromFrame();",20)}
function incrementHeight(a,b,c){var d=document.getElementById(a),e=document.getElementById("iframeLoginPopup");if(parseInt(d.style.height)<parseInt(c)){d.style.height=parseInt(d.style.height)+parseInt(b)+"px";e.style.height=parseInt(d.style.height)+parseInt(b)+"px";setTimeout("incrementHeight('"+a+"', '"+b+"','"+c+"');",5)}}function Div_InsertAfter(a,b){b.nextSibling!=null?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a)}
function Div_GetTreeNodeDiv(a){var b=document.createElement("Div");b.innerHTML=a;return b.firstChild}function XML_element(a,b,c){var d="";if(c)d=formatAttributes(c);return b?"<"+a+d+">"+b+"</"+a+">":b==0?"<"+a+d+">"+b+"</"+a+">":"<"+a+d+"/>"}function AjaxRequest_GetParams(a,b,c){return"target="+encodeURIComponent(a)+"&requestDivID="+encodeURIComponent(b)+"&data="+encodeURIComponent(c)}
function XML_createXmlDom(a){var b;try{b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}catch(c){parser=new DOMParser;b=parser.parseFromString(a,"text/xml")}return b}function span_SetText(a,b){if(document.all)a.innerText=b;else a.textContent=b}function span_GetText(a){return document.all?a.innerText:a.textContent}
function createXmlHTTP(){var a;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=null}}if(!a&&typeof XMLHttpRequest!="undefined")a=new XMLHttpRequest;return a}function executeXmlHTTPPostRequest(a,b,c,d){var e=createXmlHTTP();e.open("POST",a,true);e.onreadystatechange=function(){e.readyState==4&&e.status==200&&b(e,c)};e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.send(d)}
function executeXmlHTTPRequest(a,b,c){var d=createXmlHTTP();d.open("GET",a,true);d.onreadystatechange=function(){d.readyState==4&&d.status==200&&b(d,c)};d.send(null)};
