12ebecb34a9a7166c318460035bb71fa971c0d4df1273180e47583b9452b6513

Source Code:

// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.ControlPicker=Class.create(Gaia.Panel,{initialize:function(element,options){this.initializeControlPicker(element,options);},initializeControlPicker:function(element,options){this.initializePanel(element,options);this.options.input=options.input;this.options.className=options.className;this.options.hoverSelection=options.hoverSelection;this.onKeyDown=this.keyDown.bindAsEventListener(this);this.initEventsAndState();var clickHandler=this.onClick.bindAsEventListener(this);Element.observe(this.element,'click',clickHandler);var mouseOutHandler=this.onMouseOut.bindAsEventListener(this);var mouseOverHandler=this.onMouseOver.bindAsEventListener(this);Element.observe(this.element,'mouseout',mouseOutHandler);Element.observe(this.element,'mouseover',mouseOverHandler);},reInit:function(){this.initEventsAndState();this._reInit();},initEventsAndState:function(){this.markIndex=-1;this.setHoverSelection(this.options.hoverSelection);},setSkinCssClass:function(current,value){this.options.className=value;return this.setSkinCssClassRoot(current,value,this.element);},setSel:function(values,cssClass){var items=this.getItems();for(var index=0,length=values.length;index<length;++index)
items[values[index]].className=cssClass;return this;},keyDown:function(event){var index;var itemCount;switch(event.keyCode){case Event.KEY_RETURN:this.selectItem(event,this.markIndex);break;case Event.KEY_ESC:Event.element(event).blur();break;case Event.KEY_DOWN:itemCount=this.getItems().length;index=Math.min(this.markIndex+1,itemCount-1);break;case Event.KEY_UP:index=Math.max(0,this.markIndex-1);break;case Event.KEY_PAGEDOWN:itemCount=this.getItems().length;index=Math.min(this.markIndex+5,itemCount-1);break;case Event.KEY_PAGEUP:index=Math.max(0,this.markIndex-5);break;case Event.KEY_END:index=this.getItems().length-1;break;case Event.KEY_HOME:index=0;break;default:return;}
if(!Object.isUndefined(index))
this.markItem(index,true);Event.stop(event);},findItem:function(evt){var evtElement=Event.element(evt);var className=this.getItemCssClass();for(var parent=evtElement;parent!==null&&parent!==this.element;parent=parent.parentNode){if(!Element.hasClassName(parent,className))continue;return parent;}
return null;},onClick:function(evt){var element=this.findItem(evt);if(element===null)return;var index=this.getItems().indexOf(element);this.selectItem(evt,index);},onMouseOver:function(evt){var element=this.findItem(evt);if(element===null)return;var index=this.getItems().indexOf(element);this.markItem(index);this.mouseOverItem=true;},onMouseOut:function(evt){var element=this.findItem(evt);if(element===null)return;this.markItem(-1);this.mouseOverItem=false;},selectItem:function(evt,index){var items=this.getItems();if(index<0||index>=items.length)return;evt.selectedIndex=index;this._onEventImpl(evt,evt.type,false);},setHoverSelection:function(value){this.options.hoverSelection=value;if(!value){this._observeKeyEvents(false);this.markItem(-1);}else
this._observeKeyEvents(true);return this;},_observeKeyEvents:function(on){if(this.options.input){var input=$(this.options.input);Element.stopObserving(input,'keydown',this.onKeyDown);if(on){input.setAttribute('autocomplete','off');Element.observe(input,'keydown',this.onKeyDown);}}},getItems:function(){return Element.select(this.element,this.getItemSelector());},getItemCssClass:function(){return this.options.className+'-controlpicker-item';},getItemSelector:function(){return'.'+this.getItemCssClass().replace(/(\s+)/g,"$1.");},checkMark:function(itemCount){if(this.markIndex<-1||this.markIndex>=itemCount)
this.markItem(0,true);return this;},markItem:function(index,scrollIntoView){var element;var items=null;if(this.markIndex>-1){items=this.getItems();element=items[this.markIndex];this.markIndex=-1;if(element!==null)
Element.removeClassName(element,this._getHoverItemClass());}
if(index>=0){if(items===null)
items=this.getItems();element=items[index];if(element!==null){if(scrollIntoView)
element.scrollIntoView(false);Element.addClassName(element,this._getHoverItemClass());this.markIndex=index;}}
return this;},_getHoverItemClass:function(){return this.options.className+'-controlpicker-hover';},destroyContainer:function(){this._observeKeyEvents(false);this.destroyChildControls();},_getElementPostValue:function(){if(this.mouseOverItem)
return'&'+this.getCallbackName()+"=M";return'';},_getElementPostValueEvent:function(evt){if(evt!==null&&!Object.isUndefined(evt.selectedIndex))
return'&'+this.getCallbackName()+"=S"+evt.selectedIndex;return'&__EVENTARGUMENT=&__EVENTTARGET='+this.element.id;}});Gaia.Extensions.ControlPicker.browserFinishedLoading=true;
// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.ExtendedButton=Class.create(Gaia.Button,{initialize:function(element,options){this.initializeExtendedButton(element,options);},initializeExtendedButton:function(element,options){this.initializeButton(element,options);this.options.className=options.className;},setSkinCssClass:function(current,value){this.options.className=current;this.setSkinCssClassRoot(current,value,this.element);},setToggle:function(value){this._toggleClass(this.element,this.options.className+'-button-checked',value);return this;},setText:function(value,index){var span=this._getContentSpan();span.update(this.decodeArgument(span.innerHTML,value,index));return this;},setEnabled:function(value){var div=$(this.element);var el=this._getButton();value?Form.Element.enable(div):Form.Element.disable(div);value?Form.Element.enable(el):Form.Element.disable(el);this._toggleClass(div,this.options.className+'-button-disabled',!value);if(value&&el.hasAttribute("disabled"))
el.removeAttribute("disabled");return this;},isEnabled:function(){var btn=this._getButton();return!btn.disabled&&!btn.hasAttribute('disabled');},setFocus:function(){this._getButton().focus();this._toggleClass(this.element,this.options.className+'-button-focus',true);return this;},_toggleClass:function(el,className,addClasses){if(addClasses)
Element.addClassName(el,className);else
Element.removeClassName(el,className);},_getButton:function(){return $(this.element.id+'_btn');},_getContentSpan:function(){return $(this.element.id+'_content');},destroy:function(){Event.stopObserving(this._getButton());this._destroyImpl();},_getElementPostValue:function(){return'';}});Gaia.Extensions.ExtendedButton.browserFinishedLoading=true;
// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.TabView=Class.create(Gaia.Panel,{initialize:function(element,options){this.initializeTabView(element,options);},initializeTabView:function(element,options){this.initializePanel(element,Object.extend({active:false},options));this.setActive(this.options.active);},setActive:function(value){Element.setStyle(this.element,{'display':value?'block':'none'});return this;}});Gaia.Extensions.TabControl=Class.create(Gaia.Panel,{initialize:function(element,options){this.initializeTabControl(element,options);},initializeTabControl:function(element,options){this.initializePanel(element,Object.extend({inactive:[]},options));for(var i=0,length=this.options.inactive.length;i<length;++i)
this.setActive(this.options.inactive[i],false);Element.observe(this.getHeaderContainer(),'click',this.onClick.bindAsEventListener(this));},onClick:function(evt){var found=false;var header=Event.element(evt);var container=this.getHeaderContainer();var prefix=this.getTabViewHeaderPrefix();while(header!==container){if(header.id&&header.id.indexOf(prefix)===0){found=true;break;}
header=header.parentNode;}
if(!found||(!Object.isUndefined(header.active)&&!header.active))return;var id=header.id;var index=id.substring(id.lastIndexOf('_')+1);Gaia.Control.callControlMethod.bind(this)('TabViewHeaderClicked',[index],null,this.element.id);},clear:function(start,count){if(!isNaN(start)){var end=isNaN(count)?start+1:count;for(var index=start;index<end;++index)
Element.remove(this.getTabViewHeader(index));}else
this.getHeaderContainer().update();return this;},add:function(value,index){if(Object.isNumber(index)){if(index===0)
Element.insert(this.getHeaderContainer(),{top:value});else
Element.insert(this.getTabViewHeader(index-1),{after:value});}else
Element.insert(this.getHeaderContainer(),value);return this;},update:function(index,options){if(!Object.isUndefined(options)){if(!Object.isUndefined(options.active))
this.setActive(index,options.active);if(!Object.isUndefined(options.classHeader))
this.getTabViewHeader(index).className=options.classHeader;if(!Object.isUndefined(options.caption))
this.getTabViewCaption(index).update(options.caption);if(!Object.isUndefined(options.classContent))
this.getTabViewCaption(index).className=options.classContent;}
return this;},setActive:function(index,value){this.getTabViewHeader(index).active=value;},setContentHeight:function(value){Element.setStyle(this.getViewContainer(),{'height':value});return this;},setContentWidth:function(value){Element.setStyle(this.getViewContainer(),{'width':value});return this;},getViewContainer:function(){return $(this.element.id+"_content");},getHeaderContainer:function(){return Element.down(this.element,'ul');},getTabViewHeaderPrefix:function(){return this.element.id+'_LI_';},getTabViewHeader:function(index){return $(this.getTabViewHeaderPrefix()+index);},getTabViewCaption:function(index){return $(this.element.id+'_content_'+index);},_getElementPostValueEvent:function(){return'&__EVENTARGUMENT=&__EVENTTARGET='+this.element.id;},destroy:function(){Element.stopObserving(this.getHeaderContainer());this._panelDestroy();}});Gaia.Extensions.TabControl.loaded=true;
// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.ToolbarItem=Class.create(Gaia.Panel,{initialize:function(element,options){this.initializeToolbarItem(element,options);},initializeToolbarItem:function(element,options){options.effects=Object.extend({gaiahidechildren:function(e){Element.hide(this._getDropper());},gaiashowchildren:function(e){Element.show(this._getDropper());}},options.effects);this.initializePanel(element,Object.extend({isTop:0,closeOnClick:1},options));if(this._getDropper(true)===null)
this.element.appendChild(new Element('ul',{'id':this.element.id+'_children','style':'display:none'}));this.setNested(this.options.isTop);this.setDropDownMethod(this.options.dropMethod);},setIconCssClass:function(value){var icon=Element.down(this.element,'span-for-image');if(icon!==null)
icon.className=value;return this;},setNested:function(value){this.options.isTop=value;return this;},setCssClassRoot:function(value){this.element.className=value;return this;},_mouseOver:function(evt){this._showDropDown();},_mouseLeave:function(evt){this.hideToolbar();},_bodyClicked:function(evt){if(evt.$toolbaritemClicked$)return;this.hideToolbar();},_itemClicked:function(evt){evt.$toolbaritemClicked$=true;var dropper=this._getDropper();if(dropper!==null){if(!Element.visible(dropper)){this._showDropDown();Event.stop(evt);}else if(this.options.closeOnClick){this.hideChildren(dropper);}}else if(!this.options.closeOnClick){evt.stopPropagation();}},setDropDownMethod:function(value){this.unsetDropDownMethods();switch(value){case'Hover':this.onMouseOver=this._mouseOver.bindAsEventListener(this);Element.observe(this.element,'mouseover',this.onMouseOver);this.onMouseLeave=this._mouseLeave.bindAsEventListener(this);Element.observe(this.element,'mouseleave',this.onMouseLeave);this.onDropperMouseLeave=this._mouseLeave.bindAsEventListener(this);Element.observe(this._getDropper(true),'mouseleave',this.onDropperMouseLeave);break;case'Click':this.onItemClicked=this._itemClicked.bindAsEventListener(this);Element.observe(this.element,'click',this.onItemClicked);this.onBodyClicked=this._bodyClicked.bindAsEventListener(this);Element.observe(document.documentElement||document.body,'click',this.onBodyClicked);break;}
return this;},_showDropDown:function(){var dropper=this._getDropper();if(dropper===null||Element.visible(dropper))return;if(this.options.isTop){Position.clone(this.element,dropper,{offsetTop:Element.getHeight(this.element),setWidth:false,setHeight:false});}else{Position.clone(this.element,dropper,{offsetLeft:Element.getWidth(this.element.parentNode),setWidth:false,setHeight:false});}
this.showChildren(dropper);var items=Gaia.Control._registeredControls.values();for(var index=0,length=items.length;index<length;++index){var control=items[index];var isToolbar=control!==this&&Object.isFunction(control.initializeToolbarItem);if(!isToolbar)continue;var isChild=control.element!==null&&control.element.id!==this.element.id&&!Element.descendantOf(this.element,control.element);if(isChild)
control.hideToolbar();}},showChildren:function(drop){Element.fire(this.element,'gaia:showchildren',{afterFinish:function(){drop.style.height='';}.bind(drop)});},hideChildren:function(drop){Element.fire(this.element,'gaia:hidechildren',{afterFinish:function(){drop.style.height='';}.bind(drop)});},hideToolbar:function(){var dropper=this._getDropper();if(dropper===null||!Element.visible(dropper))return;this.hideChildren(dropper);},_getDropper:function(takeIfEmpty){var dropper=$(this.element.id+'_children');return!takeIfEmpty&&Element.firstDescendant(dropper)===null?null:dropper;},setCloseOnClick:function(value){this.options.closeOnClick=value;return this;},unsetDropDownMethods:function(){if(this.onItemClicked!==null)
Element.stopObserving(this.element,'click',this.onItemClicked);if(this.onBodyClicked!==null)
Element.stopObserving(document.documentElement||document.body,'click',this.onBodyClicked);if(this.onMouseOver!==null)
Element.stopObserving(this.element,'mouseover',this.onMouseOver);if(this.onMouseLeave!==null)
Element.stopObserving(this.element,'mouseleave',this.onMouseLeave);if(this.onDropperMouseLeave!==null)
Element.stopObserving(this._getDropper(true),'mouseleave',this.onDropperMouseLeave);},setAnimation:function(value){this.options.animation=value;return this;},setClose:function(){this.hideToolbar();return this;},destroy:function(){this.unsetDropDownMethods();this._panelDestroy();}});Gaia.Extensions.ToolbarItem.browserFinishedLoading=true;
// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.TreeViewItem=Class.create(Gaia.Control,{initialize:function(element,options){this.initializeTreeViewItem(element,options);},initializeTreeViewItem:function(element,options){options.effects=Object.extend({gaiacollapsing:function(evt){Element.hide(this.getChildrenContainer());this.raiseAfterFinish(evt);},gaiaexpanding:function(evt){Element.show(this.getChildrenContainer());this.raiseAfterFinish(evt);}},options.effects);this.initializeControl(element,options);var p=options.p;this.options=Object.extend({isEnd:(p&1)===1,isLeaf:(p&2)===2,allowSelections:(p&4)===4,fetchedChildren:(p&8)===8,collapsed:(p&16)===16},this.options);this._addEventListeners();},raiseAfterFinish:function(evt){var memo=evt.memo;if(Object.isUndefined(memo))return;var afterFinish=evt.memo.afterFinish;if(!Object.isFunction(afterFinish))return;afterFinish.call(this);},setSel:function(value){this.options.allowSelections=value;this._removeEventListeners();this._addEventListeners();return this;},setLeaf:function(value){this.options.isLeaf=value;this._removeEventListeners();this._addEventListeners();return this;},setCol:function(value){if(!this.processing){this.processing=true;if(value&&!this.options.collapsed)
Element.fire(this.element,'gaia:collapsing',{afterFinish:this.dequeueAction.bind(this)});else if(!value&&this.options.collapsed)
Element.fire(this.element,'gaia:expanding',{afterFinish:this.dequeueAction.bind(this)});this.options.collapsed=value;}else
this.queueAction(value);return this;},queueAction:function(value){if(Object.isUndefined(this.collapseQueue))
this.collapseQueue=[value];else
this.collapseQueue.push(value);},dequeueAction:function(){this.processing=false;if(Object.isUndefined(this.collapseQueue)||this.collapseQueue.length===0)return;this.setCol(this.collapseQueue.shift());},setInd:function(value,index){var element=Element.down(this.element,'.span-for-indent');element.update(this.decodeArgument(element.innerHTML,value,index));return this;},setCCnt:function(value,index){var container=this.getContainer();container.className=this.decodeArgument(container.className,value,index);return this;},setCExp:function(value,index){var expander=this.getExpander();expander.className=this.decodeArgument(expander.className,value,index);return this;},reInit:function(){this._reInit();this._removeEventListeners();this._addEventListeners();},appendHtml:function(value){this._appendHtml(this.getChildrenContainer(),value);return this;},_onElementClicked:function(evt){if(!this.options.allowSelections||evt.nodeSelectEvent)return;var element=Event.element(evt);if(!this.options.isLeaf){var expander=this.getExpander();if(expander===element||Element.descendantOf(element,expander))
return;}
evt.nodeSelectEvent=true;this._onEvent(evt,'click',true);},_addEventListeners:function(){if(!this.options.isLeaf){this.onExpanderClicked=this._onEvent.bindAsEventListener(this,'click',true);Element.observe(this.getExpander(),'click',this.onExpanderClicked);}
if(this.options.allowSelections){this.onElementClicked=this._onElementClicked.bindAsEventListener(this);Element.observe(this.getContainer(),'click',this.onElementClicked);}},_removeEventListeners:function(){if(this.onExpanderClicked!==null)
Element.stopObserving(this.getExpander(),'click',this.onExpanderClicked);if(this.onElementClicked!==null)
Element.stopObserving(this.getContainer(),'click',this.onElementClicked);},getExpander:function(){return $(this.element.id+'_expander');},getContainer:function(){return $(this.element.id+'_container');},getChildrenContainer:function(){return $(this.element.id+'_children');},destroy:function(){this.destroyContainer();this._destroyImpl();},destroyContainer:function(){this._removeEventListeners();this.destroyChildControls();},_getElementPostValueEvent:function(evt){var argument='';var postValue='&__EVENTTARGET='+this.getCallbackName();if(evt!==null){if(!evt.nodeSelectEvent)
argument=this.options.collapsed?'E':'C';else
argument='S';}
return postValue+'&__EVENTARGUMENT='+argument;}});Object.extend(Gaia.Extensions.TreeViewItem.prototype,Gaia.Container.prototype);Gaia.TreeItem=Gaia.Extensions.TreeViewItem;Gaia.Extensions.TreeViewItem.browserFinishedLoading=true;
// Gaia Ajax Copyright (C) 2008 - 2011 Gaiaware AS. details at http://gaiaware.net/
if(!Gaia.Extensions)
Gaia.Extensions=Class.create();Gaia.Extensions.Window=Class.create(Gaia.Panel,{initialize:function(element,options){this.initializeWindow(element,options);},initializeWindow:function(element,options){this.initializeWindowEffects(options);this.initializePanel(element,options);this.initializeWindowDimensions();var properties=options.p;if(Object.isNumber(properties)){if((properties&8)===8){this.options.center=true;var canCenter=!Object.isNumber(options.nested)||$G(this.element.id.substr(0,this.options.nested))!==null;if(canCenter)
this.center();}
if((properties&1)===1)
this.setMinimized(1);if((properties&2)===2)
this.setMaximized(1);if((properties&4)===4)
this.bringWindowToFront();}
Element.setStyle(this.element,{'visibility':'visible','display':'none'});Element.fire(this.element,"gaia:appearing");Element.observe(element,'click',Gaia.Extensions.Window.clickHandler.bindAsEventListener(this));},initializeWindowEffects:function(options){options.effects=Object.extend({gaiaminimizing:function(e){this.defaultMinimize();},gaiarestoring:function(e){this.defaultRestore();},gaiarestoreafterminimize:function(e){this.defaultRestore();},gaiaclosing:function(e){this._setVisibleImpl(false);},gaiaappearing:function(e){Element.show(Event.element(e));}},options.effects);},initializeWindowDimensions:function(){var elementStyle=this.element.style;if(Prototype.Browser.IE){if(Object.isUndefined(elementStyle.width))
elementStyle.width=Element.getWidth(this.element)+'px';if(Object.isUndefined(elementStyle.height))
elementStyle.height=Element.getHeight(this.element)+'px';}
this.options.widthOfBorders=Element.getWidth(this.element)-Element.getWidth(this.getContent());this.options.heightOfBorders=Element.getHeight(this.getCaption())+Element.getHeight(this.getBottom());if(elementStyle.height&&!this.options.maximized)
this.setHeight(parseInt(elementStyle.height,10)||0);},setBars:function(value){this.setScrollBars(value,this.getContent());var overflowValue=value!=='None'?'hidden':'visible';Element.setStyle(this.getMiddle().up(),{'overflow':overflowValue});return this;},setCCH:function(value){$(this.element.id+'_h').className=value;return this;},setSkinCssClass:function(current,value){this.options.className=value;return this.setSkinCssClassRoot(current,value,this.element);},setMinimized:function(value){this.options.minimized=value;if(value){if(this.options.maximized)
this.setMaximized(0);this._storeOldPositionAndHeight();Element.fire(this.element,"gaia:minimizing");}else
this.restore("gaia:restoreafterminimize");return this;},setMaximized:function(value){this.options.maximized=value;var maximizeCssClass=this.options.className+"-window-maximized";if(value){if(this.options.minimized)
this.setMinimized(0);Element.addClassName(this.element,maximizeCssClass);this._storeOldPositionAndHeight();var container=this.getOuterContainerBody();if(container!==null){this.element.clonePosition(container);this.sync();}else{var positionOffset=this.element.getOffsetParent().viewportOffset();this.element.setStyle({left:-positionOffset.left+'px',top:-positionOffset.top+'px'});var dimensions=document.viewport.getDimensions();this.setWidth(dimensions.width);this.setHeight(dimensions.height);}}else{Element.removeClassName(this.element,maximizeCssClass);this.restore('gaia:restoring');}
return this;},restore:function(evtName){Element.fire(this.element,evtName,{w:this._oldSizePos.width,h:this._oldSizePos.height,t:this._oldSizePos.top,l:this._oldSizePos.left,widthInner:this._oldSizePos.widthInner,heightInner:this._oldSizePos.heightInner,afterFinish:this.sync.bind(this)});},defaultMinimize:function(){var content=this.getContent();if(!Element.visible(content))return;Element.toggle(content);Element.setStyle(this.element,{width:'300px'});},defaultRestore:function(){Element.setStyle(this.element,{top:this._oldSizePos.top,left:this._oldSizePos.left,width:this._oldSizePos.width,height:this._oldSizePos.height});var content=this.getContent();Element.show(content);Element.setStyle(content,{width:this._oldSizePos.widthInner,height:this._oldSizePos.heightInner});},_storeOldPositionAndHeight:function(){var content=this.getContent();this._oldSizePos={top:this.element.style.top,left:this.element.style.left,width:this.element.style.width,height:this.element.style.height,widthInner:content.style.width||(Element.getWidth(content)+'px'),heightInner:content.style.height||(Element.getHeight(content)+'px')};},sync:function(){var dimensions=Element.getDimensions(this.element);this.setWidth(dimensions.width);this.setHeight(dimensions.height);},setHeight:function(value){Element.setStyle(this.element,{height:value+"px"});var content=this.getContent();var expectedHeight=(Element.getHeight(this.element)||value)-this.options.heightOfBorders;Element.setStyle(content,{height:expectedHeight+'px'});var difference=Element.getHeight(this.getMiddle())-expectedHeight;if(difference>0){Element.setStyle(content,{height:(expectedHeight-difference)+'px'});}
return this;},setWidth:function(value){Element.setStyle(this.element,{width:value+'px'});var content=this.getContent();var expectedWidth=(Element.getWidth(this.element)||0)-this.options.widthOfBorders;Element.setStyle(content,{width:expectedWidth+'px'});var contentWidth=Element.getWidth(content);var difference=contentWidth-expectedWidth;if(difference>0){Element.setStyle(content,{width:(value-this.options.widthOfBorders-difference)+'px'});}
return this;},reInit:function(){this._reInit();this.initializeWindowDimensions();},getOuterContainerBody:function(){for(var node=this.element.parentNode;node!==null;node=node.parentNode){if(!Gaia.Control.isGaiaControlRootNode(node))continue;var control=$G(node.id);if(control.isAjaxContainer())
return control.getBody();}
return null;},setVisible:function(value){if(value)
this._setVisibleImpl(value);else
Element.fire(this.element,"gaia:closing",{afterFinish:this.destroy.bind(this)});},getCaption:function(){return $(this.element.id+'_header');},getBottom:function(){return $(this.element.id+'_bottom');},getContent:function(){return $(this.element.id+'_content');},getMiddle:function(){return $(this.element.id+'_middle');},center:function(skipChildren){var scr=document.viewport.getScrollOffsets();var size=document.viewport.getDimensions();var dimensions=Element.getDimensions(this.element);var posLeft=Math.round(Math.max((size.width/2)-(dimensions.width/2),0));var posTop=Math.round(Math.max((size.height/2)-(dimensions.height/2),0));posTop+=scr.top;posLeft+=scr.left;Element.setStyle(this.element,{top:posTop+'px',left:posLeft+'px'});var cumOff=Element.cumulativeOffset(this.element);if(cumOff.left!==posLeft){posLeft-=cumOff.left-posLeft;Element.setStyle(this.element,{left:posLeft+'px'});}
if(cumOff.top!==posTop){posTop-=cumOff.top-posTop;Element.setStyle(this.element,{top:posTop+'px'});}
if(skipChildren)return;this._centerChildWindows();},_centerChildWindows:function(){var childWindows=[];this.eachGaiaChild(function(windowArray,control,key){if(Object.isFunction(control.initializeWindow)&&control.options.center)
windowArray.push(control);}.curry(childWindows));childWindows.sort(function(x,y){return x.element.id.length-y.element.id.length;}).invoke('center',true);},_getElementPostValue:function(){return'';},bringWindowToFront:function(){var id=this.element.id;var wnd=Gaia.Extensions.Window;if(wnd._topMostWindow===id)return;wnd._topMostWindow=id;this.bringToFront();},destroy:function(){Element.stopObserving(this.element,'click');var wnd=Gaia.Extensions.Window;if(wnd._topMostWindow===this.element.id)
wnd._topMostWindow=null;this._panelDestroy();}});Gaia.Extensions.Window._topMostWindow=null;Gaia.Extensions.Window.clickHandler=function(evt){if(!!evt.$stopPropagation$)return;evt.$stopPropagation$=true;this.bringWindowToFront();};Gaia.Extensions.Window.browserFinishedLoading=true;
Gaia_ExtensionsInclude_browserFinishedLoading = true