var lastPopupOpenXOriginal=83,lastPopupOpenYOriginal=350,lastPopupOpenX=0,lastPopupOpenY=0,lastPopupOffset=25,popupBodyMask="<div id='{1}_SM' class='shadowMargin' onselect='return true;' onselectstart='return true;'>{0}</div>";YAHOO.widget.ResizePanel=function(el,userConfig){arguments.length>0&&YAHOO.widget.ResizePanel.superclass.constructor.call(this,el,userConfig)};YAHOO.extend(YAHOO.widget.ResizePanel,YAHOO.widget.Panel);YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE="resizepanel";YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE="resizehandle";YAHOO.widget.ResizePanel.prototype.init=function(el,userConfig){YAHOO.widget.ResizePanel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.ResizePanel);YAHOO.util.Dom.addClass(this.innerElement,YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE);this.resizeHandle=document.createElement("DIV");this.resizeHandle.id=this.id+"_r";this.resizeHandle.className=YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE;this.beforeShowEvent.subscribe(function(){this.body.style.overflow="auto"},this,true);this.beforeHideEvent.subscribe(function(){this.body.style.overflow="hidden"},this,true);this.beforeRenderEvent.subscribe(function(){this.body.style.overflow="hidden";!this.footer&&this.setFooter("")},this,true);this.renderEvent.subscribe(function(){var me=this;me.innerElement.appendChild(me.resizeHandle);this.ddResize=new YAHOO.util.DragDrop(this.resizeHandle.id,this.id);this.ddResize.setHandleElId(this.resizeHandle.id);var headerHeight=me.header.offsetHeight+me.footer.offsetHeight+15;this.dd.onDrag=function(){me.cfg.setProperty("xy",[this.DDM.dragCurrent.lastPageX,this.DDM.dragCurrent.lastPageY]);this.DDM.dragCurrent.minY=80};this.ddResize.onMouseDown=function(e){this.startWidth=me.innerElement.offsetWidth;this.startHeight=me.innerElement.offsetHeight;me.cfg.setProperty("width",this.startWidth+"px");me.cfg.setProperty("height",this.startHeight+"px");this.startPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)];me.innerElement.style.overflow="hidden";me.body.style.overflow="auto"};this.ddResize.onDrag=function(e){var newPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)],offsetX=newPos[0]-this.startPos[0],offsetY=newPos[1]-this.startPos[1],newWidth=Math.max(this.startWidth+offsetX,10),newHeight=Math.max(this.startHeight+offsetY,10);me.cfg.setProperty("width",newWidth+"px");me.cfg.setProperty("height",newHeight+"px");var bodyHeight=newHeight-5-me.footer.offsetHeight-me.header.offsetHeight-3;if(bodyHeight<0)bodyHeight=0;me.body.childNodes[0].style.height=bodyHeight+8+"px";var panelIdParts=parsePanelID(me.id),popupStyle=me.body.childNodes[0].style;switch(me.browser){case "ie":case "ie7":if(panelIdParts.action=="view"){popupStyle.width=newWidth-12+"px";if(bodyHeight>2)bodyHeight=bodyHeight-2;me.body.childNodes[0].style.height=bodyHeight+"px"}else popupStyle.width=newWidth-7+"px";break;case "gecko":if(panelIdParts.action=="view")popupStyle.width=newWidth-18+"px";else popupStyle.width=newWidth-8+"px"}var innerHeight=me.innerElement.offsetHeight,innerWidth=me.innerElement.offsetWidth;if(innerHeight<headerHeight)me.innerElement.style.height=headerHeight+"px";if(innerWidth<300){me.innerElement.style.width="300px";me.body.childNodes[0].style.width="289px"}}},this,true);if(userConfig){userConfig.constraintoviewport=true;this.cfg.applyConfig(userConfig,true)}this.initEvent.fire(YAHOO.widget.ResizePanel)};YAHOO.widget.ResizePanel.prototype.toString=function(){return "ResizePanel "+this.id};function createPopup(panelID,width,context,title){var panelIDParts=parsePanelID(panelID),panel=YAHOO.example.container.manager.find(panelID);if(!panel)buildPopup(panelID,width,context,title);else{panel.show();var templateContext=context,context={};context.templateContext=templateContext;if(panelIDParts.action=="view")populatePopup(panelID,context.templateContext+"_"+panelIDParts.objectID);else populatePopup(panelID,context);YAHOO.example.container.manager.focus(panelID)}}function populatePopup(panelID,context){var panelIDParts=parsePanelID(panelID);if(panelIDParts.action=="view"&&panelIDParts.objectType=="entity"){var contextParts=parseContext(context);$get("view_entity_"+contextParts[1])&&viewData(contextParts[0],contextParts[1],null,panelID)}if(!(panelIDParts.action=="view"&&panelIDParts.objectType=="entity")){var fnc=String.format("refresh_{0}_{1}('{2}', '{3}')",panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,context.templateContext);eval(fnc)}}function populatePopupComplete(panelID){resetSavedChangesHash(panelID)}function buildPopup(panelID,width,context,title){var panelIDParts=parsePanelID(panelID);if(context)var contextParts=parseContext(context);var panelWidth=1;YAHOO.widget.panel1=new YAHOO.widget.ResizePanel(panelID,{width:panelWidth+"px",xy:[-2e3,-2e3],visible:true,draggable:true,close:true,underlay:"none",constraintoviewport:false});if(panelIDParts.action.toLowerCase()=="view"){var headerMask="<div class='dataIcon'></div><div id='NewRowButton_{2}'><div class='newRow' onclick='createPopup(\"new_row_{2}\", 450, \"{2}_{1}\");'></div><div class='newRowText NewAppText' onclick='createPopup(\"new_row_{2}\", 450, \"{2}_{1}\", \"{0}\");'>New</div><div style='top:18px; right:150px;' class='linkApp spriteImages' onclick=\"linkTextHelper('"+panelID+"','"+context+"','{0}');\"></div></div><div class='container-close-my-data' onclick='hidePopup(\"view_entity_{2}\");'></div><div id='view_entity_{2}_refreshIcon' class='view-refresh-spinning' onclick='populatePopup(\"{3}\",\"{1}_{2}\")'></div><div><table width='100%' border=0 cellspacing=0 cellpadding=0 style='margin-top: 10px;'><tr><td width=5></td><td class='dataTitleBar'><div id='TitleBarText_{2}' class='titleBarText'>{0}</div></td><td class='dataTr'></td></tr></table></div>",headerHTML=String.format(headerMask,title.cleanTitle(),context,panelIDParts.objectID,panelID);YAHOO.widget.panel1.setHeader(headerHTML);var bodyHTML=String.format('<div id="{0}_SM" class="dataShadowMargin" onselect="return true;" onselectstart="return true;"><img src=\'/common/images/loading.gif\'></div>',panelID);YAHOO.widget.panel1.setBody(bodyHTML);var footerHTML="<div class='bd'><div style='padding:0; margin-top:0;' class='dataShadowMargin'><div style='display:none;' id='"+panelID+"_pager' class='pager'>hi</div></div></div><div class='dataBottomBar'><div class='bl'></div><div class='br'></div></div>";YAHOO.widget.panel1.setFooter(footerHTML);YAHOO.widget.panel1.render("bodyTag");YAHOO.widget.panel1.close.style.top="20px";YAHOO.widget.panel1.close.style.right="16px";populatePopup(panelID,context+"_"+panelIDParts.objectID)}else if(panelIDParts.action.toLowerCase()=="delete"){var headerMask="<div class='container-close-my' onclick='hidePopup(\"{0}_{1}_{2}\");'></div><div class='titleBar'><div class='tl'></div><div class='titleBarText'>{4} {5}</div><div class='tr'></div></div><div class='subTitle'><div class='shadowMargin' id='{0}_{1}_{2}_subTitle'>{3}</div></div>",headerHTML=String.format(headerMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,title,panelIDParts.action.titleCase(),panelIDParts.objectType.titleCase());YAHOO.widget.panel1.setHeader(headerHTML);var loadingBody=String.format(popupBodyMask,"<img src='/common/images/loading.gif'>",panelID);YAHOO.widget.panel1.setBody(loadingBody);if(panelIDParts.objectType=="app")context=panelIDParts.objectID;getTemplate(panelIDParts.objectType,YAHOO.widget.panel1,context);var footerHTML="<div class='bottomBar'><div class='bl'></div><div class='br'></div>",buttonText="Delete";switch(panelIDParts.objectType){case "app":var buttonMask="<input type='button' onClick=\"{0}_{1}({2});\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText);break;case "column":var buttonMask="<input type='button' onClick=\"{0}_{1}({2}, {3}, {4});\" class='SubmitPopup' value='{5}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,contextParts[0],contextParts[1],panelIDParts.objectID,buttonText);break;case "entity":var buttonMask="<input type='button' onClick=\"{0}_{1}({2}, {3});\" class='SubmitPopup' value='{4}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,context,panelIDParts.objectID,buttonText);break;case "webservices":var buttonMask="<input type='button' onClick=\"{0}_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,context,buttonText);break;case "row":var buttonMask="<input type='button' onClick=\"remove_row({0}, {1}, {3});\" class='SubmitPopup' value='{2}' />",rowAndEntIDs=panelID.split("_")[2].split("x");footerHTML+=String.format(buttonMask,rowAndEntIDs[0],rowAndEntIDs[1],buttonText,contextParts[1]);break;case "role":var buttonMask="<input type='button' onClick=\"remove_{0}({1}, {2});\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectType,context,panelIDParts.objectID,buttonText);break;case "rolemember":var buttonMask="<input type='button' onClick=\"remove_{0}('{1}');\" class='SubmitPopup' value='{2}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectType,context,buttonText);break;case "security":var buttonMask="<input type='button' onClick=\"remove_userOrRole('{0}', {1}, '{2}', {3});\" class='SubmitPopup' value='{4}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectID,contextParts[0],contextParts[1],contextParts[2],"Remove");break;case "favorite":var buttonMask="<input type='button' onClick=\"remove_favorite({0});\" class='SubmitPopup' value='{1}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectID,"Remove")}var buttonMask="<input type='button' onClick=\"hidePopup('{0}');\" class='SubmitPopup' value='{1}' />";footerHTML+=String.format(buttonMask,panelID,"Cancel");footerHTML+="</div>";YAHOO.widget.panel1.setFooter(footerHTML);YAHOO.widget.panel1.render("container")}else{var refreshHeaderMask="<div class='container-close-my' onclick=\"hidePopup('{0}_{1}_{2}');\"></div><div class=\"titleBar\"><div class=\"edit-refresh-spinning\" id=\"{0}_{1}_{2}_refreshIcon\" onclick=\"refresh_{0}_{1}('{2}', '{6}');\"></div><div class='tl'></div><div class='titleBarText'>{4} {5}</div><div class='tr'></div></div><div class='subTitle'><div class='shadowMargin' id='{0}_{1}_{2}_subTitle'>{3}</div></div>",noRefreshHeaderMask="<div class='container-close-my' onclick=\"hidePopup('{0}_{1}_{2}');\"></div><div class='titleBar'><div class='tl'></div><div class='titleBarText'>{4} {5}</div><div class='tr'></div></div><div class='subTitle'><div class='shadowMargin' id='{0}_{1}_{2}_subTitle'>{3}</div></div>",headerMask="";switch(panelIDParts.objectType){case "app":headerMask+=refreshHeaderMask;if(panelIDParts.action=="edit"){headerMask+="<div class='popupDeleteButton' onClick=\"createPopup('delete_{1}_{2}', 400, null, '{3}');\" title='Delete {3}'></div>";headerMask+="<div class='copyApp' title='Copy {3}' onClick=\"createPopup('copy_app_{2}', 400, null, '{3}');\"></div>";headerMask+="<div class='webService' onClick=\"createPopup('edit_webservices_{2}', 400, null, '{3}');\" title='Create a Web Service for {3}'></div>";headerMask+="<div class='importData' onClick=\"createPopup('edit_import_{2}', 510, null, '{3}');\" title='Import Data into {3}'></div>";headerMask+="<div class='roles' onClick=\"createPopup('edit_role_{2}', 510, null, '{3}');\" title='Edit Roles for {3}'></div>";headerMask+="<div class='transferApp' onClick=\"createPopup('transfer_app_{2}', 350, null, '{3}');\" title='Transfer {3} to a Different User'></div>"}break;case "entity":headerMask+=refreshHeaderMask;if(panelIDParts.action.toLowerCase()=="edit")headerMask+="<div class='popupDeleteButton' onClick=\"createPopup('delete_{1}_{2}', 400, "+contextParts[0]+", '{5}');\" title='Delete {5}'></div>";break;case "column":headerMask+=refreshHeaderMask;if(panelIDParts.action.toLowerCase()=="edit")headerMask+="<div class='popupDeleteButton' onClick=\"createPopup('delete_{1}_{2}', 400, '"+context+"', '{5}');\" title='Delete {5}'></div>";break;case "row":headerMask+=noRefreshHeaderMask;break;default:headerMask+=refreshHeaderMask}headerMask+='<div class="linkApp spriteImages" title="Link to {3}" onclick="linkTextHelper(\''+panelID+"','"+context+"','{3}');\"></div>";var headerHTML=String.format(headerMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,title.cleanTitle(),panelIDParts.action.titleCase(),panelIDParts.objectType.titleCase(),context,title.cleanTitle().split(" ")[1]);YAHOO.widget.panel1.setHeader(headerHTML);var loadingBody=String.format(popupBodyMask,"<img src='/common/images/loading.gif'>",panelID);YAHOO.widget.panel1.setBody(loadingBody);if(!context)context="_";if(contextParts&&panelIDParts.objectType=="security"&&contextParts.length==1)context=context+"_"+context;var footerHTML="<div class='bottomBar'><div class='bl'></div><div class='br'></div>",buttonText;if(panelIDParts.action=="edit"){buttonText="Save";if(context){if(panelIDParts.objectType=="column"){var buttonMask="<input type='button' onClick=\"{0}_{1}({2}, {3}, {4});\" class='SubmitPopup' value='{5}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,contextParts[0],contextParts[1],panelIDParts.objectID,buttonText)}else if(panelIDParts.objectType=="row"){var buttonMask="<input type='button' onClick=\"{0}_{1}_{2}('{4}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context)}else if(panelIDParts.objectType=="security"&&contextParts&&contextParts.length==3){var buttonMask="<input type='button' onClick=\"edit_security('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,context,buttonText)}else if(panelIDParts.objectType=="entity"){var buttonMask="<input type='button' onClick=\"{0}_{1}('{2}_{3}');\" class='SubmitPopup' value='{4}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,context,buttonText)}else if(contextParts&&contextParts.length==3){var buttonMask="<input type='button' onClick=\"{0}_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,context,buttonText)}else if(panelIDParts.objectType!="webservices"&&panelIDParts.objectType!="role")if(panelIDParts.objectType=="import"){buttonText="Import Selected Tables";buttonMask="<input id='ImportButton_{2}' type='button' onClick=\"{0}_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText)}else{var buttonMask="<input id='Save_{2}' type='button' onClick=\"{0}_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context)}}else if(panelIDParts.objectType!="webservices"&&panelIDParts.objectType!="role"){var buttonMask="<input type='button' onClick=\"{0}_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context)}if(panelIDParts.objectType=="row"){buttonText="Save and New";var buttonMask="<input type='button' onClick=\"{0}_{1}_{2}('{4}_withPopup');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context)}else if(panelIDParts.objectType=="security"){buttonText="Apply";if(contextParts&&contextParts.length==3){var buttonMask="<input type='button' onClick=\"apply_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,context,buttonText)}else{var buttonMask="<input type='button' onClick=\"apply_{1}('{2}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context)}}}else if(panelIDParts.action=="new")switch(panelIDParts.objectType.toLowerCase()){case "app":buttonText="Create/New Table";var buttonMask="<input type='button' onClick=\"{0}_{1}('withPopup');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);buttonText="Create";var buttonMask="<input type='button' onClick=\"{0}_{1}();\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);break;case "entity":var buttonMask="<input type='button' onClick=\"{0}_{1}({2}, '{5}');\" class='SubmitPopup' value='{3}' />";buttonText="Add Columns";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context,"cols");buttonText="New Table";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context,"ent");buttonText="Create";var buttonMask="<input type='button' onClick=\"{0}_{1}('{4}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);break;case "column":buttonText="Create";var buttonMask="<input type='button' onClick=\"{0}_{1}('{4}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);break;case "row":buttonText="Create/New Row";var buttonMask="<input type='button' onClick=\"{0}_{1}_{2}('{4}_withPopup');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);buttonText="Create";var buttonMask="<input type='button' onClick=\"{0}_{1}_{2}('{4}');\" class='SubmitPopup' value='{3}' />";footerHTML+=String.format(buttonMask,panelIDParts.action,panelIDParts.objectType,panelIDParts.objectID,buttonText,context);break;case "activate":buttonText="Activate";var buttonMask="<input type='button' onClick=\"new_activate($get('activateInviteCode').value);\" class='SubmitPopup' value='{0}' />";footerHTML+=String.format(buttonMask,buttonText)}else if(panelIDParts.action=="copy"){buttonText="Copy App";var buttonMask="<input type='button' id=\"copy_app_{0}_button\" onClick=\"copy_app({0});\" class='SubmitPopup' value='{1}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectID,buttonText)}else{buttonText="Transfer";var buttonMask="<input type='button' id=\"transfer_app_{0}_button\" onClick=\"transfer_app({0});\" class='SubmitPopup' value='{1}' />";footerHTML+=String.format(buttonMask,panelIDParts.objectID,buttonText)}var action=panelIDParts.action.toLowerCase();getTemplate((action=="copy"||action=="transfer"?action:"")+panelIDParts.objectType,YAHOO.widget.panel1,context);buttonText="Cancel";if(panelIDParts.objectType=="webservices"||panelIDParts.objectType=="import"||panelIDParts.objectType=="security"||panelIDParts.objectType=="role"||panelIDParts.objectType=="app"&&panelIDParts.action=="copy")buttonText="Close";var buttonMask="<input type='button' onClick=\"hidePopup('{0}');\" class='SubmitPopup' value='{1}' />";footerHTML+=String.format(buttonMask,panelID,buttonText);footerHTML+="</div>";YAHOO.widget.panel1.setFooter(footerHTML);YAHOO.widget.panel1.render("container")}YAHOO.example.container.manager.register(YAHOO.widget.panel1);YAHOO.example.container.manager.focus(YAHOO.widget.panel1);YAHOO.widget.panel1.subscribe("focus",panelFocused);if(!lastPopupOpenX)lastPopupOpenX=lastPopupOpenXOriginal;if(!lastPopupOpenY)lastPopupOpenY=lastPopupOpenYOriginal;lastPopupOpenX+=lastPopupOffset;lastPopupOpenY+=lastPopupOffset;if(lastPopupOpenX>300)lastPopupOpenX=150;if(lastPopupOpenY>500)lastPopupOpenY=375;panelWidth=width;if(panelWidth<200)panelWidth=200;$get(panelID).style.width=panelWidth+"px";if(YAHOO.widget.panel1.browser=="ie"||YAHOO.widget.panel1.browser=="ie7")$get(panelID+"_SM").style.width=panelWidth-12+"px";YAHOO.widget.panel1.cfg.setProperty("xy",[lastPopupOpenY,lastPopupOpenX]);panelOrder.push(YAHOO.widget.panel1)}function panelFocused(){if(this!=panelOrder[panelOrder.length-1]){Array.remove(panelOrder,this);panelOrder.push(this)}}function sizePanelToScreen(panelID){var panelSM=$get(panelID+"_SM");if(panelSM){var screenH=getViewportHeight(),dude=Sys.UI.DomElement.getBounds(panelSM);if(dude.height+dude.y>screenH-50){var overflow=dude.y+dude.height-screenH,newHeight=dude.height-overflow-62;panelSM.style.height=newHeight+"px"}}}function showNewAppPopup(){createPopup("new_app_0",400,null,"Create a New Application")}function hidePopup(panelID){discardChanges=true;if(getSavedChangesHash(panelID))if(getSavedChangesHash(panelID)!=calcSavedChangesHash(panelID)){var discardChanges=confirm("This action will discard any unsaved changes.");if(!discardChanges)discardChanges=false}var manager=YAHOO.example.container.manager,popupToHide=manager.find(panelID);if(popupToHide&&discardChanges){var panelIDParts=parsePanelID(panelID);if(panelIDParts.objectType=="row"||panelIDParts.objectType=="security"){popupToHide.destroy();var panelScript=$get(panelID+"_script");panelScript&&panelScript.parentNode.removeChild(panelScript)}else{if(panelIDParts.objectType=="entity"&&panelIDParts.action=="edit")$get(panelIDParts.objectID+"_EntAliasRow").style.visibility="hidden";if(panelIDParts.objectType=="app"&&panelIDParts.action=="new")$get(panelIDParts.objectID+"_isPublicRow").style.visibility="hidden";popupToHide.hide()}}Array.remove(panelOrder,popupToHide);setPopupFocus()}function setPopupFocus(){var manager=YAHOO.example.container.manager,popupToFocus,highestZIndex=0;for(var p in manager.overlays){var curOverlay=manager.overlays[p];if(curOverlay.element.style.visibility=="visible")if(!popupToFocus||curOverlay.element.style.zIndex>highestZIndex){popupToFocus=curOverlay;highestZIndex=curOverlay.element.style.zIndex}}popupToFocus&&focusPopup(popupToFocus.id)}function setSavedChangesHash(panelID,hashCode){$get(panelID).hashCode=hashCode}function resetSavedChangesHash(panelID){setSavedChangesHash(panelID,calcSavedChangesHash(panelID))}function getSavedChangesHash(panelID){panel=$get(panelID);if(panel&&panel.hashCode)return panel.hashCode}function calcSavedChangesHash(panelID){for(var popupChildren=$get(panelID).getElementsByTagName("*"),validationBlocks=[],i=0;i<popupChildren.length;i++)popupChildren[i].className.match("validationBlock")&&validationBlocks.push(popupChildren[i]);var hashString="",controlsToCheckFor=["textarea","input","select"];for(var b in validationBlocks)for(var c in controlsToCheckFor){var blockChildren=validationBlocks[b].getElementsByTagName(controlsToCheckFor[c]);for(i=0;i<blockChildren.length;i++)if(blockChildren[i].id){hashString+=blockChildren[i].id+":";switch(controlsToCheckFor[c]){case "textarea":hashString+=blockChildren[i].value+".";break;case "select":hashString+=blockChildren[i].selectedIndex+".";break;case "input":switch(blockChildren[i].type){case "text":case "password":hashString+=blockChildren[i].value+".";break;case "radio":case "checkbox":hashString+=blockChildren[i].checked+"."}}}}return hashString}function hideDependantPopups(objectType,objectID){switch(objectType){case "app":hidePopup("edit_app_"+objectID);hidePopup("delete_app_"+objectID);break;case "entity":hidePopup("view_entity_"+objectID);hidePopup("edit_entity_"+objectID);hidePopup("delete_entity_"+objectID);break;case "column":hidePopup("edit_column_"+objectID);hidePopup("delete_column_"+objectID)}}function focusPopup(panelID){$get(panelID)&&YAHOO.example.container.manager.find(panelID).focus()}function getViewportHeight(){if(window.innerHeight!=window.undefined)return window.innerHeight;if(document.compatMode=="CSS1Compat")return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return window.undefined}function getViewportWidth(){if(window.innerWidth!=window.undefined)return window.innerWidth;if(document.compatMode=="CSS1Compat")return document.documentElement.clientWidth;if(document.body)return document.body.clientWidth;return window.undefined}function linkTextHelper(panelID,context,a,b){if(context==""||context==null)context="null";var mask='<p style="padding:0;margin:0; text-align: center;">Paste this link into the address bar</p><p style="padding:0;margin:0; text-align: center;"><input id="linkText" type=text value=\'http://my.clouddb.com/?{0}:450:{1}:{2} {3}\' /></p>';showHelp(String.format(mask,panelID,context,a,b))};