if(typeof pln=='undefined'){alert("Nvi Layer Package\nThis file required the PLN Javascript Library(pln.js)and it need to be loaded before this file.");}else if(typeof nvi=='undefined'){alert("Nvi Layer Package\nThis file required the NVI CORE(nvi.core.js)and it need to be loaded before this file.");}else if(typeof class_nvi_basic_panel=='undefined'){alert("Nvi Layer Package\nThis file required the Class Nvi Basic Panel and it need to be loaded before this file.");}else{function class_nvi_tooltip_panel(){var _host=this;var _isOpened=false;var _width=null;var _height=null;var _cachedWidth=null;var _cachedHeight=null;var _maximized=false;var _followTheMouse=false;var _disableContentRemoval=false;var _container=null;var _collection={open:[],close:[],drag:[],maximize:[],minimize:[]};var _scrollPaneId=null;var _offset=null;var _alignment="TR";this.__constructor=function(id){_container=new class_nvi_layer(id,true);void __super.__constructor(id);};this.toString=function(){return "Nvi ToolTip Panel Class";};this.initialize=function(){void create();void manageRegisteredControls(true);void __super.initialize();};this.terminate=function(){_host.close();void manageRegisteredControls(false);void __super.terminate();};this.deleteInstance=function(){void this.terminate();void _container.deleteInstance();delete _container;void __super.deleteInstance();};function create(){void _container.initialize();void _host.setDimension();};this.disableContentRemoval=function(Enable){if(pln.isBoolean(Enable))_disableContentRemoval=Enable;};this.isContentRemovalEnabled=function(){return!_disableContentRemoval;};this.updateView=function(){};this.setPosition=function(element,x,y){if(!_container.created)return;var buffer={x:_followTheMouse?5:0,y:_followTheMouse?10:0};var x=pln.isNumber(x)?x:0;var y=pln.isNumber(y)?y:0;var posX=null;var posY=null;if(element!=null){var display=pln.node.getProperty(element,'display');var elementBounds=pln.node.getBounds(element);var layerBounds=_container.getDimension();var windowBounds=pln.events.getWindowSize();var scrollOffset=pln.events.getScrollOffset();var limit={x:scrollOffset.x,y:scrollOffset.y,w:scrollOffset.x+windowBounds.width,h:scrollOffset.y+windowBounds.height};if(!_followTheMouse){x+=elementBounds.x;y+=elementBounds.y;}var position={x1:x-(layerBounds.width+buffer.x),x2:x+buffer.x+(_followTheMouse?0:elementBounds.width),y1:y-(layerBounds.height+buffer.y),y2:y+buffer.y+(_followTheMouse?0:elementBounds.height)};var calPosX1=position.x1-limit.x;var calPosX2=limit.w-(position.x2+layerBounds.width);var calPosY1=position.y1-limit.y;var calPosY2=limit.h-(position.y2+layerBounds.height);if((_alignment=="TL"||_alignment=="BL")&&position.x1>limit.x)posX=position.x1;if((_alignment=="TR"||_alignment=="BR")&&position.x2+layerBounds.width<limit.w)posX=position.x2;if((_alignment=="TR"||_alignment=="TL")&&position.y1>limit.y)posY=position.y1;if((_alignment=="BR"||_alignment=="BL")&&position.y2+layerBounds.height<limit.h)posY=position.y2;if(posX==null)posX=calPosX1>=calPosX2?position.x1:position.x2;if(posY==null)posY=calPosY1>=calPosY2?position.y1:position.y2;}else{posX=x;posY=y;}void _container.setPosition(posX,posY);};this.getPosition=function(){try{return _container.getPosition();}catch(error){return null;}};this.setDimension=function(width,height,autoScroll){if(pln.isNumber(width))_width=width;if(pln.isNumber(height))_height=height;var windowDimension=pln.events.getWindowSize();var bodyDimension=pln.events.getBodySize();var scrollWidth=pln.getScrollBarWidth();var autoScroll=pln.isBoolean(autoScroll)?autoScroll:true;if(_width>windowDimension.width)_width=windowDimension.width;if(_height>windowDimension.height)_height=windowDimension.height;if(_host.isNavigatorScrollBarActive){if(_width>=windowDimension.width-scrollWidth||_height>=windowDimension.height-scrollWidth){if(bodyDimension.width>windowDimension.width)_height-=scrollWidth;if(bodyDimension.height>windowDimension.height)_width-=scrollWidth;}}if(pln.isObject(_container)){void _container.setDimension(_width,_height);if(_scrollPaneId!=null){var scrollPane=pln.node.getById(_scrollPaneId);if(!pln.isNull(_width)&&!pln.isNull(_height)){void pln.node.setProperty(scrollPane,'scrollTop','0');void pln.node.setProperty(scrollPane,'position','relative');void pln.node.setProperty(scrollPane,'overflow',autoScroll?'auto':'hidden');void pln.node.setProperty(scrollPane,'width',_width+'px');void pln.node.setProperty(scrollPane,'height',_height+'px');var innerTable=pln.node.getByPath('table',scrollPane);var innerCell=pln.node.getByPath('table.tbody.tr.td',scrollPane);void pln.node.setProperty(innerTable,'width','100%');void pln.node.setProperty(innerCell,'width','100%');void pln.node.setProperty(innerTable,'height','100%');void pln.node.setProperty(innerCell,'height','100%');var layer=_container.getElement();if(pln.isHtmlElement(layer)){var table=pln.node.getByPosition(0,layer);if(pln.isHtmlElement(table)){var newWidth=Math.max(1,_width-(pln.node.getProperty(table,'offsetWidth')-_width));var newHeight=Math.max(1,_height-(pln.node.getProperty(table,'offsetHeight')-_height));void pln.node.setProperty(scrollPane,'width',newWidth+'px');void pln.node.setProperty(scrollPane,'height',newHeight+'px');if(autoScroll){var scrollBarWidth=pln.getScrollBarWidth();var needHorizontalScrollBar=width-_width>0;var needVerticalScrollBar=height-_height>0;if(needHorizontalScrollBar&&!needVerticalScrollBar){if(_height+scrollBarWidth<=windowDimension.height){void _container.setDimension(_width,_height+scrollBarWidth);void pln.node.setProperty(scrollPane,'height',(newHeight+scrollBarWidth)+'px');}}if(needVerticalScrollBar&&!needHorizontalScrollBar){if(_width+scrollBarWidth<=windowDimension.width){void _container.setDimension(_width+scrollBarWidth,_height);void pln.node.setProperty(scrollPane,'width',(newWidth+scrollBarWidth)+'px');}}}}}}}if(_isOpened){void nvi.eventManager.dispatchEvent(_host.getId(),nvi.eventManager.events.__resized);}}};function manageContentDisplay(element,display){var childLength=pln.node.getLength(element);for(var i=0;i<childLength;i++){var node=pln.node.getByPosition(i,element);void pln.node.setProperty(node,'display',display?'':'none');}};this.getDimension=function(){return _container.created?_container.getDimension():{width:_width,height:_height};};this.getContentDimension=function(){var dimension=_container.getContentDimension();var width=0;var height=0;var widthModifier=0;var heightModifier=0;if(_scrollPaneId!=null){var scrollPane=pln.node.getById(_scrollPaneId);var innerTable=pln.node.getByPath('table',scrollPane);var innerCell=pln.node.getByPath('table.tbody.tr.td',scrollPane);void pln.node.setProperty(innerTable,'width','');void pln.node.setProperty(innerCell,'width','');void pln.node.setProperty(innerTable,'height','');void pln.node.setProperty(innerCell,'height','');width=pln.node.getProperty(scrollPane,'width');height=pln.node.getProperty(scrollPane,'height');if(width=='auto')width=pln.node.getProperty(scrollPane,'offsetWidth');if(height=='auto')height=pln.node.getProperty(scrollPane,'offsetHeight');var inner=pln.node.getByPath('table.tbody.tr.td',scrollPane);widthModifier=pln.node.getProperty(inner,'offsetWidth');heightModifier=pln.node.getProperty(inner,'offsetHeight');void pln.node.setProperty(innerTable,'width','100%');void pln.node.setProperty(innerCell,'width','100%');void pln.node.setProperty(innerTable,'height','100%');void pln.node.setProperty(innerCell,'height','100%');}dimension.width=(dimension.width-width)+widthModifier;dimension.height=(dimension.height-height)+heightModifier;return dimension;};this.resizeToContent=function(autoScroll){if(!pln.isNull(_container)){var dimension=_host.getContentDimension();if(!pln.isNull(dimension)){if(_maximized){_cachedWidth=dimension.width;_cachedHeight=dimension.height;return;}void _host.setDimension(dimension.width,dimension.height,autoScroll);}else{void _container.resizeToContent();}void _host.setPosition();}};this.followTheMouse=function(follow){if(pln.isBoolean(follow))_followTheMouse=follow;};this.setAlignment=function(alignment){if(pln.isString(alignment)&&!pln.isEmpty(alignment))_alignment=alignment.toUpperCase();};this.calculatePositionWithMouse=function(eventObject,element){var mousePosition=pln.isNull(eventObject)?null:pln.events.getMousePosition(eventObject);try{this.setPosition(element,mousePosition.x,mousePosition.y);}catch(error){}};this.open=function(eventObject,element){if(!_container.created)return;void problematicFlash.initialize();void problematicFlash.hideElements();_isOpened=true;void _container.open();if(_followTheMouse){void pln.events.addListener(document,'mousemove',_host,_host.calculatePositionWithMouse,element);}else{void _host.setPosition(element);void _host.setDimension();}void manageMinimizeButtons(false);void manageRegisteredControls(true,'open');void nvi.eventManager.dispatchEvent(_host.getId(),nvi.eventManager.events.__opened);};this.close=function(eventObject,element){if(!_container.created)return;void problematicFlash.showElements();_isOpened=false;if(_followTheMouse){}if(_maximized)_host.minimize();void manageRegisteredControls(false,'open');void nvi.eventManager.dispatchEvent(_host.getId(),nvi.eventManager.events.__closed);void _container.close();void pln.events.removeListener(document,'scroll',null,manageScrolling);};this.maximize=function(){if(!_maximized){_maximized=true;var dimension=_host.getDimension();if(pln.isNull(_width))_width=dimension.width;if(pln.isNull(_height))_height=dimension.height;_cachedWidth=_width;_cachedHeight=_height;void manageMaximizeButtons(false);void manageMinimizeButtons(true);var windowSize=pln.events.getWindowSize();void _host.setDimension(windowSize.width,windowSize.height,true);void _host.setPosition();void pln.events.addListener(document,'scroll',null,manageScrolling,pln.events.getScrollOffset());}};function manageScrolling(eventObject,scrollLocation){void scroll(scrollLocation.x,scrollLocation.y);};function manageMaximizeButtons(display){var collection=_collection['maximize'];for(var i=0;i<collection.length;i++){void pln.node.setProperty(collection[i].id,'display',display?'':'none');}};this.minimize=function(){if(_maximized){_maximized=false;void manageMaximizeButtons(true);void manageMinimizeButtons(false);void _host.setDimension(_cachedWidth,_cachedHeight,true);void _host.setPosition();void pln.events.removeListener(document,'scroll',null,manageScrolling);}};function manageMinimizeButtons(display){var collection=_collection['minimize'];for(var i=0;i<collection.length;i++){void pln.node.setProperty(collection[i].id,'display',display?'':'none');}};this.pushContent=function(elementId,cloneAndRemove){if(!isValidString(elementId))return;void _container.pushContent(elementId,cloneAndRemove);};this.removeAllContent=function(flushCollection){var flush=pln.isBoolean(flushCollection)?flushCollection:false;if(pln.isObject(_container)){void _container.removeAllContent(flush);if(flush){_collection={open:[],close:[],drag:[],maximize:[],minimize:[]};}}};this.isNavigatorScrollBarActive=function(){var windowDimension=pln.events.getWindowSize();var bodyDimension=pln.events.getBodySize();return bodyDimension.width>windowDimension.width||bodyDimension.height>windowDimension.height;};function isValidString(element){return pln.isString(element)&&!pln.isEmpty(element);};this.registerIdAsOpenButton=function(elementId,eventName){void manageCollection(true,'open',elementId,eventName||'mouseover',_host,_host.open,false,[elementId]);};this.registerIdAsCloseButton=function(elementId,eventName){void manageCollection(true,'close',elementId,eventName||'mouseout',_host,_host.close,false);};this.registerIdAsMaximizeButton=function(elementId,eventName){void manageCollection(true,'maximize',elementId,eventName||'click',_host,_host.maximize,false);};this.registerIdAsMinimizeButton=function(elementId,eventName){void manageCollection(true,'minimize',elementId,eventName||'click',_host,_host.minimize,false);};this.registerIdAsDragHandle=function(elementId){void manageCollection(true,'drag',elementId,'null',null,null,false);};this.registerIdAsScrollPane=function(elementId){if(pln.isString(elementId)&&!pln.isEmpty(elementId)){if(_scrollPaneId!=null){void nvi.logManager.log('A modal can only have one scroll pane. The current scrollpane is '+_scrollPaneId+'.','Warning','class_nvi_layer','registerIdAsScrollPane');}else{_scrollPaneId=elementId;}}};function manageCollection(add,collectionName,elementId,eventName,scope,callback,active,args){if(!pln.isString(elementId)||pln.isEmpty(elementId))return;if(!pln.isString(eventName)||pln.isEmpty(eventName))return;var collection=_collection[collectionName];if(add){void collection.push({id:elementId,eventName:eventName,active:active,scope:scope,callback:callback,args:pln.isArray(args)?args:[]});}else{for(var i=0;i<collection.length;i++){var entry=collection[i];if(entry.id==elementId){void collection.splice(i,1);break;}}}};function manageRegisteredControls(activate,collectionException){var collectionException=collectionException||null;for(var i in _collection){if(!pln.isNull(collectionException)&&i==collectionException)continue;var subCollection=_collection[i];for(var j=0;j<subCollection.length;j++){var entry=subCollection[j];if(activate!=entry.active){var element=pln.node.getById(entry.id);if(!pln.isHtmlElement(element))continue;if(i!='drag'){var args=[element,entry.eventName,entry.scope,entry.callback].concat([element],entry.args);void pln.events[activate?'addListener':'removeListener'].apply(null,args);}else{var panelId=_host.getId();var instance=class_nvi_drag.getInstance(panelId,element,_container);void instance.enableHandle(activate);if(!activate)void class_nvi_drag.deleteInstance(panelId);}entry.active=activate;}}}};this.getSharedRessources=function(){return{type:'tooltip',id:this.getId(),parameters:{complementaryData:this.getComplementaryDataObject()}};};};class_nvi_tooltip_panel.extend=class_nvi_basic_panel;function class_nvi_modal_panel(){var _host=this;var _overlay;var _overlayContent;var _background='#000000 url(/resources/default/default/img/background/bg_tile_01.gif)repeat top left';var _alpha=70;var _opened=false;var _overlayIsInteractive=true;var _cachedSize={width:0,height:0};var _autoCentering=true;this.__constructor=function(id){void __super.__constructor(id);};this.toString=function(){return "Nvi Modal Panel Class";};this.initialize=function(){void create();void __super.initialize();};this.terminate=function(){void __super.terminate();};this.deleteInstance=function(){void this.terminate();void _overlay.deleteInstance();delete _overlay;void __super.deleteInstance();};function resizeOverlay(){var scrollWidth=pln.getScrollBarWidth();var bProps=pln.events.getBodySize();var wProps=pln.events.getWindowSize();var n1=wProps.width-_cachedSize.width;var n2=wProps.height-_cachedSize.height;if(n1!=0||n2!=0){var tempWidth=n1!=0?1:_cachedSize.width;var tempHeight=n2!=0?1:_cachedSize.height;void _overlay.setDimension(tempWidth,tempHeight);bProps=pln.events.getBodySize();wProps=pln.events.getWindowSize();var _w={max:Math.max(bProps.width,wProps.width),min:Math.min(bProps.width,wProps.width)};var _h={max:Math.max(bProps.height,wProps.height),min:Math.min(bProps.height,wProps.height)};var width=_cachedSize.width;var height=_cachedSize.height;if(_w.max-_cachedSize.width!=0){width=_w.max;}else if(_w.min-_cachedSize.width!=0){width=_w.min-_cachedSize.width<0?_w.max:_w.min;}if(_h.max-_cachedSize.height!=0){height=_h.max;}else if(_h.min-_cachedSize.height!=0){height=_h.min-_cachedSize.height<0?_h.max:_h.min;}if(_opened){if(bProps.width>wProps.width)height-=scrollWidth;if(bProps.height>wProps.height)width-=scrollWidth;_cachedSize.width=width;_cachedSize.height=height;void _overlay.setDimension(width,height);}}void _host.setPosition();};function create(){if(!pln.isset(_overlay)){var overlayId="overlay_"+_host.getId();var overlayContent=pln.node.add(pln.node.create('div'),document.body);overlayContent.id=overlayId;_overlay=new class_nvi_layer(overlayId);_overlay.initialize();void pln.node.setProperty(overlayContent,'background',_background);void pln.node.setProperty(overlayContent,'alpha',_alpha);void pln.node.setProperty(overlayContent,'width','100%');void pln.node.setProperty(overlayContent,'height','100%');_overlayContent=_overlay.pushContent(overlayId);if(_overlayIsInteractive){void pln.events.addListener(_overlayContent,'click',_host,_host.close);}void pln.events.addListener(window,'resize',null,resizeOverlay);void resizeOverlay();}};this.disableOverlayInteraction=function(){_overlayIsInteractive=false;};this.setPosition=function(element,x,y){if(isset(element)&&isFunction(element.stopPropagation))element=null;if(!pln.isNumber(x)||!pln.isNumber(y)){var wProps=pln.events.getWindowSize();var bProps=pln.events.getBodySize();var scrollWidth=pln.getScrollBarWidth();var propsC=this.getDimension();var x=0;var y=0;if(!_host.isNavigatorScrollBarActive()||propsC.width<wProps.width-scrollWidth){x=Math.floor((wProps.width / 2)-(propsC.width / 2));if(x<0)x=0;}if(!_host.isNavigatorScrollBarActive()||propsC.height<wProps.height-scrollWidth){y=Math.floor((wProps.height / 2)-(propsC.height / 2));if(y<0)y=0;}var scrollOffset=pln.events.getScrollOffset();x=x+scrollOffset.x;y=y+scrollOffset.y;__super.setPosition(null,x,y);}if(pln.isNumber(x)&&pln.isNumber(y))__super.setPosition(element,x,y);};this.setDimension=function(width,height,autoScroll){void __super.setDimension(width,height,autoScroll);void _host.setPosition();};this.manageScrollAutoCentering=function(enable){if(pln.isBoolean(enable))_autoCentering=enable;};function manageAutoCentering(enable){if(_autoCentering){var modal_dimension=_host.getDimension();var window_dimension=pln.events.getWindowSize();var activate=true;if(modal_dimension.width>=window_dimension.width||modal_dimension.height>=window_dimension.height)activate=false;if(activate){void pln.events[enable?'addListener':'removeListener'](window,'scroll',_host,_host.setPosition);}}};this.open=function(eventObject,element,elementId){if(pln.isString(elementId)){void nvi.eventManager.dispatchEvent(elementId,nvi.eventManager.events.__triggered);}_opened=true;void _overlay.open();void __super.open();void this.setPosition();void manageAutoCentering(true);void resizeOverlay();};this.close=function(){_opened=false;void manageAutoCentering(false);void __super.close();void _overlay.close();};this.setBackground=function(background){if(pln.isString(background)){_background=background;void pln.node.setProperty(_overlayContent,'background',_background);}};this.setAlpha=function(alpha){if(pln.isNumber(alpha)){_alpha=alpha;void pln.node.setProperty(_overlayContent,'alpha',_alpha);}};this.registerIdAsOpenButton=function(elementId,eventName){void __super.registerIdAsOpenButton(elementId,eventName||'click');};this.registerIdAsCloseButton=function(elementId,eventName){void __super.registerIdAsCloseButton(elementId,eventName||'click');};this.getSharedRessources=function(){return{type:'modal',id:this.getId(),parameters:{complementaryData:this.getComplementaryDataObject()}};};};class_nvi_modal_panel.extend=class_nvi_tooltip_panel;function class_nvi_layer(id,createTableAsFirstChild){var _parentId=pln.isString(id)?id:null;var _layer;var _iefix;var _createTableAsFirstChild=pln.isBoolean(createTableAsFirstChild)?createTableAsFirstChild:false;var _container;var _x=0;var _y=0;var _width='auto';var _height='auto';var _host=this;var _contentConfiguration=[];var _contentQueue;var _contentNotFoundCollection=[];var _set=pln.node.setProperty;var _get=pln.node.getProperty;this.__constructor=function(){};this.toString=function(){return "Nvi Layer Class";};this.initialize=function(){void create();for(var i=0;i<_contentNotFoundCollection.length;i++){void _host.pushContent(_contentNotFoundCollection[i],true,true);}};this.terminate=function(){};this.created=false;this.deleteInstance=function(){void pln.node.remove(_layer);if(pln.isHtmlElement(_iefix))void pln.node.remove(_iefix);};function displayLayer(display){var state=display?'block':'none';void _set(_layer,'display',state);if(pln.isset(_iefix))void _set(_iefix,'display',state);};function create(){if(_host.created)return;_layer=pln.node.add(pln.node.create('div'),document.body);if(_createTableAsFirstChild){var rWidth=_width=='auto'?'width:auto;':'';var rHeight=_height=='auto'?'height:auto;':'';var innerStructure='';innerStructure+='<table style="background:none;backgroundColor:transparent;padding:0px;borderCollapse:collapse;borderSpacing:0px;border:0px;borderWidth:0px;borderStyle:none;'+rWidth+rHeight+'">';innerStructure+='<tbody><tr><td style="background:none;backgroundColor:transparent;padding:0px;border:0px;verticalAlign:top;'+rWidth+rHeight+'"></td></tr><tbody>';innerStructure+='</table>';void _set(_layer,'innerHTML',innerStructure);}void _set(_layer,'position','absolute');void _set(_layer,'left',_x+'px');void _set(_layer,'top',_y+'px');if(_width!='auto')void _set(_layer,'width',_width+'px');if(_height!='auto')void _set(_layer,'height',_height+'px');void _set(_layer,'overflow','hidden');try{void _set(_layer,'overflow','-moz-scrollbars-none');}catch(e){}try{void _set(_layer,'overflow-x','hidden');void _set(_layer,'overflow-y','hidden');}catch(e){}var _bInfo=pln.getBrowserInfo();if(_bInfo.name=='msie'&&_bInfo.version=='6.0'){_iefix=pln.node.add(pln.node.create('div'),document.body);void _set(_iefix,'position','absolute');void _set(_iefix,'overflow','hidden');void _set(_iefix,'left','0px');void _set(_iefix,'top','0px');void _set(_iefix,'width',(_width+(!isNaN(_width)?'px':'')));void _set(_iefix,'height',(_height+(!isNaN(_height)?'px':'')));var iframe=pln.node.add(pln.node.create('iframe'),_iefix);void _set(iframe,'display','block');void _set(iframe,'position','absolute');void _set(iframe,'margin','0px');void _set(iframe,'padding','0px');void _set(iframe,'border','0px');void _set(iframe,'zIndex','-1');void _set(iframe,'filter','mask()');void _set(iframe,'width','3000px');void _set(iframe,'height','3000px');void _set(iframe,'left','0px');void _set(iframe,'top','0px');}_host.created=true;void displayLayer(false);};this.open=function(){if(pln.isArray(_contentQueue)){var container=_layer;if(_createTableAsFirstChild)container=pln.node.getByPath('table.tbody.tr.td',_layer);for(var i=0;i<_contentQueue.length;i++){if(pln.isHtmlElement(_contentQueue[i])){var contentNode=pln.node.add(_contentQueue[i],container);try{void pln.node.setProperty(contentNode,'width','100%');void pln.node.setProperty(contentNode,'height','100%');}catch(error){}}}}void displayLayer(true);void _host.bringToFront();void manageContentPanels(true);};this.close=function(){void manageContentPanels(false);void displayLayer(false);void _host.removeAllContent();};function manageContentPanels(enable){if(!pln.isBoolean(enable)||!pln.isString(_parentId))return;var collection={};var subElementsCollection=pln.node.getByAttribute('id',_layer);var removedElementsCollection=nvi.memoryIdManager.findByParentId(_parentId);if(pln.isNull(subElementsCollection))return;for(var i=0;i<subElementsCollection.length;i++)collection[subElementsCollection[i].id]={};for(var i=0;i<removedElementsCollection.length;i++)collection[removedElementsCollection[i]]={};for(var j in collection){if(j!=_parentId){try{void nvi.panelManager.getInstance(j)[enable?'initialize':'terminate']();}catch(error){}}}};this.setPosition=function(x,y){_x=!pln.isset(x)?_x:x;_y=!pln.isset(y)?_y:y;void _set(_layer,'left',x+'px');void _set(_layer,'top',y+'px');if(pln.isset(_iefix)){void _set(_iefix,'left',x+'px');void _set(_iefix,'top',y+'px');}void nvi.eventManager.dispatchEvent(_parentId,nvi.eventManager.events.__moved);};this.getPosition=function(){return{x:_x,y:_y};};this.setDimension=function(width,height){_width=!pln.isset(width)?_width:width;_height=!pln.isset(height)?_height:height;if(!pln.isset(_layer))return;var wUnit=!isNaN(_width)?'px':'';var hUnit=!isNaN(_height)?'px':'';void _set(_layer,'width',_width+wUnit);void _set(_layer,'height',_height+hUnit);if(pln.isset(_iefix)){void _set(_iefix,'width',_width+wUnit);void _set(_iefix,'height',_height+hUnit);}};this.getDimension=function(){var width=isNaN(_width)?pln.node.getProperty(_layer,'offsetWidth'):_width;var height=isNaN(_height)?pln.node.getProperty(_layer,'offsetHeight'):_height;return{width:width,height:height};};this.getContentDimension=function(){if(_createTableAsFirstChild){var widthBackup=pln.node.getProperty(_layer,'width');var heigthBackup=pln.node.getProperty(_layer,'height');if(widthBackup=='auto')widthBackup=pln.node.getProperty(_layer,'offsetWidth');if(heigthBackup=='auto')heigthBackup=pln.node.getProperty(_layer,'offsetHeight');void pln.node.setProperty(_layer,'width','auto');void pln.node.setProperty(_layer,'height','auto');var container=pln.node.getByPath('table',_layer);var width=pln.node.getProperty(container,'offsetWidth');var height=pln.node.getProperty(container,'offsetHeight');void pln.node.setProperty(_layer,'height',widthBackup+'px');void pln.node.setProperty(_layer,'height',heigthBackup+'px');return{width:width,height:height};}else{return null;}};this.resizeToContent=function(){var dimension=_host.getContentDimension();if(!pln.isNull(dimension)){_host.setDimension(dimension.width,dimension.height);}};this.pushContent=function(elementId,cloneAndRemove,previouslyNotFound){if(!pln.isString(elementId))return;var previouslyNotFound=pln.isBoolean(previouslyNotFound)?previouslyNotFound:false;var cloneAndRemove=pln.isString(cloneAndRemove)?cloneAndRemove:true;var element=pln.node.getById(elementId);if(!pln.isHtmlElement(element)){if(!previouslyNotFound){void nvi.logManager.log('The element with the following id '+elementId+' have not been found in the document. We will try to locate it on initialize...','Warning','class_nvi_layer','pushContent');void _contentNotFoundCollection.push(elementId);}return;}var clone;var collection=pln.node.getByAttribute('id',element);try{for(var i=0;i<collection.length;i++){void nvi.memoryIdManager.add({id:collection[i].id,parentId:_parentId});}}catch(error){}if(cloneAndRemove){var iframeCollection=pln.node.getByName('iframe',element);if(pln.isArray(iframeCollection)){for(var j=0;j<iframeCollection.length;j++){if(!pln.isset(nvi.panelManager.getInstance(iframeCollection[j].id))){void nvi.logManager.log('The instance is not a valid instance of a panel. You must instanciate a panel before pushing it to a layer','Error','class_nvi_layer','pushContent');}}}clone=pln.node.clone(element);void pln.node.remove(element);}else{clone=element;}if(!pln.isArray(_contentQueue))_contentQueue=[];void _contentQueue.push(clone);return clone;};this.removeAllContent=function(flushCollection){if(pln.isBoolean(flushCollection)&&flushCollection)_contentQueue=[];if(pln.isset(_layer)){void pln.node.clear(_createTableAsFirstChild?pln.node.getByPath('table.tbody.tr.td',_layer):_layer);}};this.bringToFront=function(){void _set(_layer,'zIndex',999999);if(pln.isset(_iefix))void _set(_iefix,'zIndex',999998);};this.displayContent=function(display,type){if(!pln.isBoolean(display))display=false;if(pln.isString(type)){var nodeCollection=pln.node.getByName(type,_layer);if(pln.isArray(nodeCollection)){for(var i=0;i<nodeCollection.length;i++){var node=nodeCollection[i];if(pln.isHtmlElement(node))void pln.node.setProperty(node,'visibility',display?'visible':'hidden');}}}else{for(var i=0;i<pln.node.getLength(_layer);i++){var node=pln.node.getByPosition(i);if(pln.isHtmlElement(node))void pln.node.setProperty(node,'visibility',display?'visible':'hidden');}}};this.getElement=function(){return _layer;};};function class_nvi_drag(){var _handleElement;var _dragContainer;var _isDragging=false;var _initialMousePosition;var _mouseMoveCount=0;var _isIE6=validateBrowser();var _distanceX;var _distanceY;this.__constructor=function(handleElement,dragContainer){if(pln.isHtmlElement(handleElement))_handleElement=handleElement;if(pln.isObject(dragContainer))_dragContainer=dragContainer;};this.toString=function(){return "Nvi Drag Handle Class";};function validateBrowser(){var browserInformation=pln.getBrowserInfo();return browserInformation.name=='msie'&&browserInformation.version.indexOf('6')!=-1;};function moveTarget(eventObject){if(_isIE6){if(_mouseMoveCount>3){void setTargetPosition(eventObject);_mouseMoveCount=0;}else{_mouseMoveCount++;}}else{void setTargetPosition(eventObject);}};function setTargetPosition(eventObject){var mousePosition=pln.isNull(eventObject)?null:pln.events.getMousePosition(eventObject);if(pln.isNull(mousePosition)){_dragContainer.displayContent(true,'iframe');_distanceX=null;_distanceY=null;return;}else{_dragContainer.displayContent(false,'iframe');}var layerPosition=_dragContainer.getPosition();var layerDimension=_dragContainer.getDimension();if(!pln.isNumber(_distanceX))_distanceX=_initialMousePosition.x-layerPosition.x;if(!pln.isNumber(_distanceY))_distanceY=_initialMousePosition.y-layerPosition.y;var n1=mousePosition.x-_distanceX;var n2=mousePosition.y-_distanceY;var windowInfo=pln.events.getWindowSize();var scrollOffset=pln.events.getScrollOffset();var _xLimit={min:scrollOffset.x,max:windowInfo.width+scrollOffset.x};var _yLimit={min:scrollOffset.y,max:windowInfo.height+scrollOffset.y};n1=n1<_xLimit.min?_xLimit.min:n1;n1=n1+layerDimension.width>_xLimit.max?_xLimit.max-layerDimension.width:n1;n2=n2<_yLimit.min?_yLimit.min:n2;n2=n2+layerDimension.height>_yLimit.max?_yLimit.max-layerDimension.height:n2;if(layerDimension.width>=windowInfo.width)n1=0;if(layerDimension.height>=windowInfo.height)n2=0;_dragContainer.setPosition(n1,n2);};function cancelImageDrag(){return false;};function start(eventObject){try{eventObject.preventDefault();}catch(e){}_isDragging=true;void pln.events.enableSelection(document.body,false);_initialMousePosition=pln.events.getMousePosition(eventObject);void pln.events.addListener(document,'mousemove',null,moveTarget);void setDragCursor(true);};function stop(){if(!_isDragging)return;void setTargetPosition(null);void pln.events.removeListener(document,'mousemove',null,moveTarget);void setDragCursor(false);void pln.events.enableSelection(document.body,true);};function setDragCursor(eventObject,dragging){var dragging=pln.isBoolean(dragging)?dragging:false;void pln.node.setProperty(_handleElement,'cursor',dragging?'move':'default');};this.enableHandle=function(enable){if(!pln.isBoolean(enable))return;void pln.events[enable?'addListener':'removeListener'](_handleElement,'mousedown',null,start);void pln.events[enable?'addListener':'removeListener'](document,'mouseup',null,stop);void pln.events[enable?'addListener':'removeListener'](document,'dragstart',null,cancelImageDrag);void pln.events[enable?'addListener':'removeListener'](_handleElement,'mouseover',null,setDragCursor,true);void pln.events[enable?'addListener':'removeListener'](_handleElement,'mouseout',null,setDragCursor,false);if(!enable)void setDragCursor(null,false);};};class_nvi_drag.collection={};class_nvi_drag.getInstance=function(id,handleElement,dragContainer){if(!pln.isString(id))return null;return pln.isObject(class_nvi_drag.collection[id])?class_nvi_drag.collection[id]:class_nvi_drag.collection[id]=pln.compiler.createClass(class_nvi_drag,handleElement,dragContainer);};class_nvi_drag.deleteInstance=function(id){try{delete class_nvi_drag.collection[id];}catch(errorObject){}};}var problematicFlash=new function(){var _count=0;var _activeCount=0;var _defaultIdPrefix="_problematicFlashElement_";var _collection={};void pln.events.addListener(document,'__documentReady',null,initialize);function initialize(){if(_activeCount!=0)return;void validateObject(document.getElementsByTagName("embed"));void validateObject(document.getElementsByTagName("object"));};this.initialize=initialize;this.hideElements=function(){_activeCount++;if(_activeCount==1)void manageElements(false);};this.showElements=function(){if(_activeCount-1>=0)_activeCount--;if(_activeCount==0)void manageElements(true);};function manageElements(display){for(var i in _collection){void pln.node.setProperty(i,'visibility',display?'visible':'hidden');}};function validateObject(collection){for(var i=0;i<collection.length;i++){var element=collection[i];var nodeName;var type;var classid;try{type=element.type.toLowerCase();}catch(error){type=null;}try{nodeName=element.nodeName.toLowerCase();}catch(error){nodeName=null;}try{classid=element.classid.toLowerCase();}catch(error){classid=null;}if(nodeName=='embed'){if(type!='application/x-shockwave-flash')continue;if(element.parentNode.nodeName.toLowerCase()=='object')continue;}if(nodeName=='object'){if(classid!='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'){var haveFlashEmbedAsChild=false;for(var j=0;j<element.childNodes.length;j++){var child=element.childNodes[j];var childNodeName;try{childNodeName=child.nodeName.toLowerCase();}catch(error){childNodeName=null;}if(childNodeName=='embed'&&child.type=='application/x-shockwave-flash'){haveFlashEmbedAsChild=true;break;}}if(!haveFlashEmbedAsChild)continue;}}try{if(element.getAttribute('wmode').toLowerCase()=="transparent")continue;}catch(error){}var id=element.id;if(id==null||id.match(/\S+/)==null)element.id=id="_forcedID"+_count;if(typeof _collection[_defaultIdPrefix+id]=='undefined'){void addWrapper(element,_defaultIdPrefix+id);_collection[_defaultIdPrefix+id]={};_count++;}}};function addWrapper(element,id){var container=pln.node.create('div');container.id=id;void pln.node.add(container,pln.node.getParent(1,element),element,true);void pln.node.add(element,container);};};
