function SiteWrapper(){this.siteConfig= new SiteConfig(); this.fom = new FormObjectsManager(); this.winManager= new WindowsManager(); this.positionFinder= new PositionFinder(); this.parent= null; this.view= null; this.init= init;this.destroy = destroy;this.openWindow= openWindow;this.openModalWindow = openModalWindow;this.send= send;this.wipeVertical= wipeVertical;this.wipe= wipe;this.openEditor= openEditor;this.openMiniEditor= openMiniEditor;this.openSuperContourEditor= openSuperContourEditor;function init(){ if(window.ViewWrapper){this.view = new ViewWrapper(this); this.view.init(); }if(this.fom.getObject("superviewer")){dchTagList = document.getElementsByTagName("dch"); while(dchTagList.length){dchTag = dchTagList.item(0); dchTagType = dchTag.getAttribute("type");if(dchTagType == 'sv'){sv = new SuperViewer2(dchTag);sv.deploy();}else if(dchTagType == 'otro'){}}} }function destroy(){ if(window.ViewWrapper){this.view.destroy(); }}function updateClock(){}function openMiniEditor(evnt){var pos = this.positionFinder.getCursorPosition(evnt);var featObj = this.siteConfig.getWindowFeatures('minieditor');featObj.posX = pos.x;featObj.posY = pos.y;this.winManager.openModalWindow('/minieditor.html','minieditor',featObj);}function openEditor(cid){var featObj = this.siteConfig.getWindowFeatures('editor');this.winManager.openWindow('/editor.html?op=cargar&id=' + cid,'e' + cid, featObj);}function openSuperContourEditor(imgFileName){this.openWindow('/sceditor.html?cat=articulos&file='+imgFileName,'sceditor','sceditor');}function openWindow(url,n,fs){var objFeat = this.siteConfig.getWindowFeatures(fs);this.winManager.openWindow(url,n,objFeat);}function openModalWindow(url,n,fs){var objFeat = this.siteConfig.getWindowFeatures(fs);this.winManager.openModalWindow(url,n,objFeat);}function send(nAction, nMode){if(nMode == "href"){top.location.href = nAction;}else{document.forms[0].action = nAction;	document.forms[0].method = nMode;	document.forms[0].submit();}}function wipe(pub,size){this.wipeVertical(pub,size);} function wipeVertical(pub,to){fom = new FormObjectsManager();obj = fom.getObject(pub);aHeight = parseInt(obj.style.height);steps = 14; if(aHeight < to){if(aHeight + steps >= to){aHeight = aHeight + 1;}else{aHeight = aHeight + steps;}obj.style.height = aHeight + "px";f = function(){wipeVertical(pub,to);};setTimeout(f,10);}}}var site = null;function init(){site = new SiteWrapper();site.init();}function destroy(){site.destroy();}
