var sliderIntervalId=0,sliderDownHeight=10,sliderDownMaxHeight=10,slidingDown=false,slideSpeed=15,slideUpSpeed=30,slidingUp=false,sliderUpHeight=10;function SlideDown(a,b,c,d){if(!slidingDown){var e=document.getElementById(a);e.style.overflow="hidden";sliderDownHeight=10;if(b>400&&c==false||d==true){sliderDownMaxHeight=400;e.style.overflowY="scroll"}else sliderDownMaxHeight=b+100;slidingDown=true;sliderIntervalId=setInterval("SlideDownRun('"+a+"',"+c+")",10)}}
function SlideUp(a,b){if(!slidingUp){var c=document.getElementById(a);c.style.overflow="hidden";sliderUpHeight=parseInt(c.style.height);if(isNaN(sliderUpHeight))sliderUpHeight=c.offsetHeight;slidingUp=true;sliderIntervalId=setInterval("SlideUpRun('"+a+"',"+b+")",1)}}
function SlideUpRun(a,b){slider=document.getElementById(a);if(sliderUpHeight<=b){slidingUp=false;sliderUpHeight=0;slider.style.height=b+"px";clearInterval(sliderIntervalId)}else{sliderUpHeight-=slideUpSpeed;if(sliderUpHeight<0)sliderUpHeight=0;slider.style.height=sliderUpHeight+"px"}}
function SlideDownRun(a,b){slider=document.getElementById(a);if(sliderDownHeight>=sliderDownMaxHeight){slidingDown=false;sliderDownHeight=sliderDownMaxHeight;slider.style.height=sliderDownMaxHeight+"px";if(b==true){slider.style.overflow="";slider.style.height=""}clearInterval(sliderIntervalId)}else{sliderDownHeight+=slideSpeed;if(sliderDownHeight>sliderDownMaxHeight)sliderDownHeight=sliderDownMaxHeight;slider.style.height=sliderDownHeight+"px"}}
function closeSlideUpDivs(a,b,c,d,e,f){a=document.getElementById(a);b=document.getElementById(b);e=document.getElementById(e);f=document.getElementById(f);a.style.display="none";b.style.display="none";e.style.display="none";if(f!=null)f.innerHTML=""}
function displayAutoSuggestUser(a){var b=document.getElementById("div_Participant_"+a+"_AutoSuggest"),c=document.getElementById("div_Coach_"+a+"_AutoSuggest"),d=document.getElementById("div_Observer_"+a+"_AutoSuggest"),e=document.getElementById("div_Participant_"+a+"_Submit"),f=document.getElementById("div_Coach_"+a+"_Submit"),g=document.getElementById("div_Observer_"+a+"_Submit"),h=document.getElementById("rb_Participant_"+a),i=document.getElementById("rb_Coach_"+a);a=document.getElementById("rb_Observer_"+
a);if(h.checked==true){b.style.display="block";c.style.display="none";d.style.display="none";e.style.display="block";f.style.display="none";g.style.display="none"}else if(i.checked==true){b.style.display="none";c.style.display="block";d.style.display="none";e.style.display="none";f.style.display="block";g.style.display="none"}else if(a.checked==true){b.style.display="none";c.style.display="none";d.style.display="block";e.style.display="none";f.style.display="none";g.style.display="block"}}
function valid(a){/\d*\.\,/.test(a.value)||alert("Only numbers, dot and comma are allowed!")}function displayDeleteUserCross(a,b){a=document.getElementById(a);if(b=="over")a.style.display="block";else if(b=="out")a.style.display="none"}
function createHiddenField(a,b,c,d){var e=document.createElement("input");e.setAttribute("id",a);e.setAttribute("type","hidden");e.setAttribute("name",b);e.setAttribute("value",c);document.getElementById(d)!=null&&document.getElementById(d).appendChild(e);return e}
function goal_HightlightSelectedLink(a,b,c,d,e){a=document.getElementById(a);for(var f=a.parentNode.firstChild;f!=null;){f.id!=null&&f.getAttribute("name")!=null&&f.getAttribute("name")==d&&replaceCSSClass(f,c,b);f=f.nextSibling}e==0&&replaceCSSClass(a,b,c)}
function lifespace_HighlightSelectedLifespace(a,b,c){a=document.getElementById(b).parentNode;a=document.getElementsByName("LifespaceName");for(var d=0;d<=a.length;d++)if(a[d]!=null&&a[d].id!=null)if(b==a[d].id){a[d].style.backgroundColor=""+c+"";a[d].style.color="#FFFFFF"}else{a[d].style.backgroundColor="";a[d].setAttribute("class","activeLifeSpaceBlockRadialGradient");a[d].style.color=""}}function SelectAll(a){a=document.getElementById(a);if(a!=null){a.focus();a.select()}}
function closeTemplateDetailDiv(a){a=document.getElementById(a);if(a!=null){a.innerHTML="";a.style.display=""}}function showSlideDownDivs(a,b){a=document.getElementById(a);b=document.getElementById(b);a.style.display="block";b.style.display="block"}function elementExistsInside(a,b){for(;b!=null;){if(a!=null&&a==b)return true;b=b.parentNode}return false}
function replaceCSSClass(a,b,c){b=new RegExp(b,"ig");if(a!=null)a.getAttribute("class")!=null?a.setAttribute("class",a.getAttribute("class").replace(b,c)):a.setAttribute("class",c)}function displayHideGoalHeadlines(a,b){a=document.getElementById(a);b=document.getElementById(b);if(a!=null){a.style.display="block";b.style.display="none"}}
function getWindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))a=document.documentElement.clientWidth;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))a=document.body.clientWidth;return a}
function getTimeZoneOffset(){var a=new Date((new Date).getFullYear(),0,1,0,0,0,0),b=a.toGMTString();b=new Date(b.substring(0,b.lastIndexOf(" ")));return(a-b)/36E5*60}function getTimeZoneOffsetDayLightSaving(){var a=new Date((new Date).getFullYear(),6,1,0,0,0,0),b=a.toGMTString();b=new Date(b.substring(0,b.lastIndexOf(" ")));return(a-b)/36E5*60}
function createCookie(a,b,c){if(c&&c>0){var d=new Date;d.setTime(d.getTime()+c*24*60*60*1E3);c="; expires="+d.toGMTString()}else c="";document.cookie=a+"="+b+c+"; path=/"}function readCookie(a){a=a+"=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)==0)return d.substring(a.length,d.length)}return null}function loadFileFromServer(a){var b=createXmlHTTP();b.open("GET",a,false);b.send("");return b.responseText}
function getHostName(){if(window.location.host.toLowerCase()=="localhost")return"http://"+window.location.host+"/website";else{window.location.host.toLowerCase().indexOf("localhost",0);return"http://"+window.location.host}}function transFormXml(a,b){try{if(window.ActiveXObject)return a.transformNode(b);else if(document.implementation&&document.implementation.createDocument){var c=new XSLTProcessor;c.importStylesheet(b);return c.transformToFragment(a,document)}}catch(d){alert(d)}return null}
function getRealLeftPosition(a){xPos=a.offsetLeft;for(tempEl=a.offsetParent;tempEl!=null;){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent}return xPos}function getRealRightPosition(a){return parseInt(getRealLeftPosition(a))+parseInt(a.offsetWidth)}function getRealTopPoistion(a){yPos=a.offsetTop;for(tempEl=a.offsetParent;tempEl!=null;){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent}return yPos}function getRealBottomPosition(a){return parseInt(getRealTopPoistion(a))+parseInt(a.offsetHeight)}
function getXmlString(a){try{return(new XMLSerializer).serializeToString(a)}catch(b){try{return a.xml}catch(c){return"Xmlserializer not supported"}}}function stopEventPropagation(a){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true}function getQueryStringFromURL(a){var b=[];b=window.location.search.substring(1).split("&");for(var c=-1,d=0;d<b.length;d++){c=b[d].indexOf("=");if(a==b[d].substring(0,c).toUpperCase())return b[d].substring(c+1)}return null}var flagDualCall=false;
function getXmlString(a){try{return(new XMLSerializer).serializeToString(a)}catch(b){try{return a.xml}catch(c){return"Xmlserializer not supported"}}}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);if(a!=null){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 displayLoginRegisterPopupControl(a){var b=XML_element("Action","displayLoginRegisterPopupControl");a=XML_element("Origin",a);a=XML_element("Params",a);b=XML_element("AjaxRequest",b+a);b=AjaxRequest_GetParams("Template","",b);executeXmlHTTPPostRequest(ajaxRequestHandlerURL+"?pingInterval="+new Date,Ajax_ServerResponse,0,b)}
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){if(XML_createXmlDom(a).getElementsByTagName("Action")[0].firstChild.nodeValue=="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}a.style.top=c-10+"px";a.style.left=d-10+"px"}
function showLoginPopupFrameDiv(a){document.getElementById("divLoginFrame_Container").style.display="block";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;else{displayRegister();displayLogin()}b.style.display="block";b.style.position="static";b.style.width="100%"}else window.location=
window.location.hostname=="localhost"||window.location.hostname.indexOf("DRISHDEV")>=0?"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;if(b.getElementsByTagName("Action")[0].firstChild.nodeValue=="displayLoginRegisterPopupControl"){if(document.getElementById("loginDiv")){a=b.getElementsByTagName("Origin")[0].firstChild.nodeValue;c=document.getElementById("iframeLoginPopup");HideProcessingImage();if(document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("loginbox")==null)c.contentWindow.location=b.getElementsByTagName("LoginPopupUrl")[0].firstChild.nodeValue;displayLoginRegisterPanelFromPopup(b.getElementsByTagName("LoginPopupUrl")[0].firstChild.nodeValue,
a)}}else showLoginPopupFrameDiv(b.getElementsByTagName("LoginPopupUrl")[0].firstChild.nodeValue)}else{if(d!=null)d.style.display="none";if(c!=null)c.innerHTML="";return false}}
function displayLoginRegisterPanelFromPopup(a,b){if(document.getElementById("loginDiv")){var c=document.getElementById("loginDiv"),d=document.getElementById("iframeLoginPopup");if(document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("loginbox")==null)setTimeout("displayLoginRegisterPanelFromPopup('"+a+"','"+b+"');",100);else{a=document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("loginbox");d=document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("registrationbox");
if(b=="register"){if(a!=null)a.style.display="none";if(d!=null)d.style.display="block"}else if(b=="login"){if(a!=null)a.style.display="block";if(d!=null)d.style.display="none"}c.style.display="block";b=document.getElementById("iframeLoginPopup").contentWindow.document.getElementById("container");if(b!=null&&parent!=null&&typeof parent.setHeight=="function")b.style!=null&&b.style.marginTop!=null&&isNaN(parseInt(b.style.marginTop))==false?setHeight(parseInt(b.offsetHeight)+parseInt(b.style.marginTop)+
20):setHeight(b.offsetHeight);c.style.position="static";c.style.width="100%"}}}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"}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 createXmlElementCdataNode(a,b,c){b=a.createElement(b);a=a.createCDATASection(c);b.appendChild(a);return b}function createXmlElementTextNode(a,b,c){b=a.createElement(b);a=a.createTextNode(c);b.appendChild(a);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)}
function makeAjaxCall(a,b,c){a=AjaxRequest_GetParams(a,b,c);executeXmlHTTPPostRequest(ajaxRequestHandlerURL+"?pingInterval="+new Date,Ajax_ServerResponse,0,a)}function getInputKeyValue(a){return window.event?window.event.keyCode:a.which};

