var isTweening=false,activeTab,TabNames=[],Tabs=[],AppPopup,AppCollapse,AppTopRight,AppIcon,AppWidth,AppExpand,AppHeader,AppContent,isAppCollapsed=false,resizingPanelId,pageHasLoaded=false,supportsPNG="PNG",popupToCallAfterLogin="",panelOrder=[];Sys.Application.add_load(CloudDBLoad);function CloudDBLoad(){var bName=navigator.userAgent.indexOf("Opera")>-1?"Opera":navigator.appName,pos=navigator.userAgent.indexOf("MSIE");if(pos>-1){bVer=navigator.userAgent.substring(pos+5);var pos=bVer.indexOf(";"),bVer=bVer.substring(0,pos)}if(bName=="Microsoft Internet Explorer"&&bVer=="6.0")supportsPNG="";if(getCrumbValue("colors"))addStylesheet(getCrumbValue("colors"),"colors");else addStylesheet("schemeBlue","colors");if(getCrumbValue("fonts"))addStylesheet(getCrumbValue("fonts"),"fonts");else addStylesheet("fontNormal","fonts");AppPopup=$get("ApplicationsPanel");AppCollapse=$get("AppCollapse");AppTopRight=$get("AppTopRight");AppIcon=$get("AppIcon");AppExpand=$get("AppExpand");AppContent=$get("AppContent");AppHeader=$get("header");AppWidth=Sys.UI.DomElement.getBounds(AppPopup).width;$addHandler(AppTopRight,"click",appToggle);$addHandler(AppCollapse,"dblclick",appToggle);$addHandler(AppExpand,"click",appToggle);$addHandler(AppIcon,"click",appToggle);var dd=new YAHOO.example.DDResize("ApplicationsPanel","rightBar","panelresize");AppContent.style.width=AppHeader.style.width=345+"px";TabNames.push("SettingsPanelLink","LoginPanelLink","RegisterPanelLink","InvitePanelLink");for(tabName in TabNames){var tab=$get(TabNames[tabName]);tab&&Tabs.push(tab)}for(tabIndex in Tabs){var tab=Tabs[tabIndex];tab&&$addHandler(tab,"click",tabClick)}YAHOO.namespace("example.container");YAHOO.example.container.manager=new YAHOO.widget.OverlayManager;var escKL=new YAHOO.util.KeyListener(document,{keys:27},{fn:escAction});escKL.enable();checkForCookie();checkHashCodes()}function showKeyboardShortcuts(){showHelp("<h4 style=' margin:0; padding: 5px 0 5px 0; text-align:center;'>Keyboard Shortcuts</h4><p style='margin:0; padding: 0 10px 10px 10px;'>Ctrl + 0 : Help <br />Esc : Close Popup <br />Ctrl + 1, Ctrl + 2, Ctrl + 3 : Font Sizes")}function ctrlFontsAction(keyEventType,keyEventArgs,scope){addStylesheet("font"+scope,"fonts")}function cycleWindows(keyEventType,keyEventArgs){document.location=document.activeElement;if(!document.hasFocus()){if(keyEventArgs[0]==219)panelOrder.unshift(panelOrder.pop());else keyEventArgs[0]==221&&panelOrder.push(panelOrder.shift());panelOrder[panelOrder.length-1].focus()}}function escAction(){hidePopup(YAHOO.example.container.manager.getActive().id)}function checkHashCodes(){var hash=document.location.search;if(hash){if(hash.charAt(0)=="?")hash=hash.substring(1);if(hash.length>0)for(var actions=hash.split(","),i=0;i<actions.length;i++){var parts=actions[i].split(":");if(parts.length>1)if(getCrumbValue("invites")==undefined||getCrumbValue("invites")=="")if(parsePanelID(parts[0]).objectType=="activate")createPopup(parts[0],parts[1],parts[2]=="null"?null:parts[2],parts[3].substitute("+"," "));else{tabClick({target:$get("LoginPanelLink")});popupToCallAfterLogin="createPopup('{0}', '{1}', {2}, '{3}')";popupToCallAfterLogin=String.format(popupToCallAfterLogin,parts[0],parts[1],parts[2]=="null"?"null":"'"+parts[2]+"'",parts[3].substitute("+"," "))}else if(parsePanelID(parts[0]).objectType=="activate")Logout("createPopup('"+parts[0]+"', '"+parts[1]+"', '"+parts[2]+"', '"+parts[3].substitute("+"," ")+"')");else createPopup(parts[0],parts[1],parts[2]=="null"?null:parts[2],parts[3].substitute("+"," "));else tabClick({target:$get(parts[0].titleCase()+"PanelLink")})}}}function removeStylesheet(name){var linkTag=$get(name);if(linkTag)linkTag.disabled=true}function createLinkElement(name,removeOld){var e=document.createElement("link");if(removeOld=="colors")e.href="common/css/"+name+supportsPNG+".css";else if(removeOld=="fonts")e.href="common/css/"+name+".css";e.rel="stylesheet";e.type="text/css";e.id=name;document.getElementsByTagName("head")[0].appendChild(e)}function addStylesheet(name,removeOld){var curSS=$get(name);if(!curSS)createLinkElement(name,removeOld);else curSS.disabled=false;if(removeOld){var sheetsArray=[];switch(removeOld){case "fonts":Array.addRange(sheetsArray,["fontSmall","fontNormal","fontMedium"]);break;case "colors":Array.addRange(sheetsArray,["schemeBlue","schemeGreen","schemeOrange"])}Array.remove(sheetsArray,name);for(var i in sheetsArray)removeStylesheet(sheetsArray[i])}var exdate=new Date;exdate.setDate(exdate.getDate()+14);document.cookie=removeOld+"="+name+"; expires="+exdate}function appExpand(){attributes={left:{to:0}};isAppCollapsed=false;if(AppIcon)AppIcon.style.backgroundPosition="0px 1560px";var animExpand=new YAHOO.util.Anim(AppExpand,{left:{to:20}},.2,YAHOO.util.Easing.easeIn);animExpand.animate();isAppCollapsed=false;var anim=new YAHOO.util.Anim(AppPopup,attributes,.2,YAHOO.util.Easing.easeIn);anim.onComplete.subscribe(animateAppComplete);anim.animate()}function appClose(){attributes={left:{to:-AppWidth-10}};isAppCollapsed=true;var anim=new YAHOO.util.Anim(AppPopup,attributes,.2,YAHOO.util.Easing.easeIn);anim.onComplete.subscribe(animateAppComplete);anim.animate()}function appToggle(){if(isAppCollapsed)appExpand();else appClose()}function showLoginTab(){var tab={};tab.target=$get("LoginPanelLink");tabClick(tab)}function tabClick(sender){var tab=sender.target;if(!isTweening)if(tab==activeTab){doAnimation(tab,-308,true);$get("bg").style.display="none"}else{if(activeTab!=null){doAnimation(activeTab,-308,true);$get("bg").style.display="none"}doAnimation(sender.target,76,false);$get("bg").style.display="block"}tab.id=="LoginPanelLink"&&$get("tbEmail").focus()}function doAnimation(tab,pixels,isUp){isTweening=true;var attributes={top:{to:pixels}},panelId=tab.id.substring(0,tab.id.length-4);if(!isUp){var anim=new YAHOO.util.Anim(panelId,attributes,.6,YAHOO.util.Easing.easeOut);activeTab=tab;tab.className="activeTab";anim.onComplete.subscribe(animateTabComplete)}else{var anim=new YAHOO.util.Anim(panelId,attributes,.2,YAHOO.util.Easing.easeIn);activeTab=null;tab.className="inactiveTab";isTweening=false}anim.animate()}function animateTabComplete(){isTweening=false}function animateAppComplete(){if(isAppCollapsed){AppIcon.style.backgroundPosition="0px 1620px";var animExpand=new YAHOO.util.Anim(AppExpand,{left:{to:51}},.2,YAHOO.util.Easing.easeIn);animExpand.animate()}else{var animExpand=new YAHOO.util.Anim(AppExpand,{left:{to:20}},.2,YAHOO.util.Easing.easeIn);animExpand.animate()}}YAHOO.example.DDResize=function(panelElId,handleElId){YAHOO.example.DDResize.superclass.constructor.apply(this,arguments);handleElId&&this.setHandleElId(handleElId)};YAHOO.extend(YAHOO.example.DDResize,YAHOO.util.DragDrop,{onMouseDown:function(e){if(document.all)resizingPanelId=e.srcElement.id;else resizingPanelId=e.target.id;var panel=this.getEl();this.startWidth=panel.offsetWidth;this.startPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)]},onDrag:function(e){if(resizingPanelId=="rightBar"||resizingPanelId=="AppCollapse"){if(!isAppCollapsed){isAppBeingResized=true;var newPos=[YAHOO.util.Event.getPageX(e)],offsetX=newPos[0]-this.startPos[0],newWidth=Math.max(this.startWidth+offsetX,10);if(newWidth<330)newWidth=330;var panel=this.getEl();panel.style.width=newWidth+"px";AppContent.style.width=AppHeader.style.width=newWidth-10+"px";AppWidth=newWidth}}else{var newPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)],offsetX=newPos[0]-this.startPos[0],newWidth=Math.max(this.startWidth+offsetX,10),panel=this.getEl();panel.style.width=newWidth+"px"}}});function showControls(li){if(!$get(li.id+"_details")||$get(li.id+"_details").style.display=="none")li.style.backgroundColor="#fff9b9"}function hideControls(li){if(!$get(li.id+"_details")||$get(li.id+"_details").style.display=="none")li.style.backgroundColor="White"}var pauseTimout=false;function showHelp(text){var helpBar=$get("helpBar"),animExpand=new YAHOO.util.Anim(helpBar,{top:{to:-1}},.2,YAHOO.util.Easing.easeIn);animExpand.animate();text+='<div class="container-close-my-data spriteImages" style="top:4px; right:4px;" onclick="hideHelp();"></div>';helpBar.innerHTML=text;var linkText=$get("linkText");linkText&&linkText.select();setTimeout(hideHelp,1e4)}function hideHelp(){var helpBar=$get("helpBar"),helpBarHeight=Sys.UI.DomElement.getBounds($get("helpBar")).height,animExpand=new YAHOO.util.Anim(helpBar,{top:{to:-helpBarHeight-10}},.2,YAHOO.util.Easing.easeIn);animExpand.animate()};