function RFViewManager(){this.headerDOM;this.menuDOM;this.accountInfoDOM;this.moduleInfoDOM;this.contentDOM;this.quickLinkDOM;this.dxView;this.dyView;this.quickLinkWidth=250;this.LayoutMgr=new RFLayoutManager();this.menuMgr=new RFMenuManager();this.moduleMgr=new RFModuleManager();this.activeModule;this.menuItems=reapfield.G_API.menus;this.subMenuItems=reapfield.G_API.submenus;this.footerMenuItems=[{id:"1",name:"Site Map",moduleIdx:"37",link:"#view/37"},{id:"2",name:"About Us",moduleIdx:"31",link:"#view/31"},{id:"3",name:"Privacy Statement",moduleIdx:"36",link:"#view/36"},{id:"4",name:"Disclaimer",moduleIdx:"35",link:"#view/35"},{id:"5",name:"TACC",moduleIdx:"0",link:"../internal/"},{id:"6",name:"Email",moduleIdx:"0",link:"http://mail.reapfield.com/"}]}RFViewManager.prototype.LoadView=function(a){this.init();this.parentDOM=document.getElementById(a);this.initViewCoordinates();this.LayoutMgr.Load()};RFViewManager.prototype.init=function(){reapfield.G_EventMgr.registerEvent("loadModuleEvent",this,"loadModuleEventListener");reapfield.G_EventMgr.registerEvent("menuItemList",this,"menuItemListListener")};RFViewManager.prototype.IsNumeric=function(b){if(!b){return}var d="0123456789.";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false}}return c};RFViewManager.prototype.initViewCoordinates=function(){var a=reapfield.GetBrowserType();if(a=="NIE"){this.dxView=window.innerWidth;this.dyView=window.innerHeight}else{this.dxView=document.body.offsetWidth;this.dyView=document.body.offsetHeight}};RFViewManager.prototype.menuItemListListener=function(a){this.menuItems=reapfield.G_API.menus;this.subMenuItems=reapfield.G_API.subMenus;this.menuMgr.initialize(this.menuItems,this.menuClickedHandler,this.LayoutMgr.menuSection,this);this.menuMgr.createFooterMenu(this.footerMenuItems,this.LayoutMgr.footerSection);$.history.init(onHashChange);if(!reapfield.hashTag){this.loadDefaultViews()}};RFViewManager.prototype.loadModuleEventListener=function(a){reapfield.updateHash(a.data)};RFViewManager.prototype.loadNewModule=function(a){this.selectMenuRemotely(a.moduleId,2);this.loadModule(a.moduleId);if(a.detailId){this.activeModule.loadDetailData(a.detailId)}};RFViewManager.prototype.loadDefaultViews=function(){if(this.LayoutMgr.activeLayout!="landing"){this.LayoutMgr.createLandingPageLayout()}if(!this.defaultModule){this.defaultModule=new landingModuleHandler()}this.menuMgr.initialize(this.menuItems,this.menuClickedHandler,this.LayoutMgr.menuSection,this);this.defaultModule.loadView("landingPage",this.LayoutMgr.contentSection,this.LayoutMgr.subContentSection)};RFViewManager.prototype.menuClickedHandler=function(d,c,a,b){var e=this;if(d=="subMenuClick"){if(c!=41&&c!=42){reapfield.updateHash({moduleId:c});trace("menu click - "+b)}}else{if(d=="hoverMenuClick"){a.selectMenuRemotely(c,3);a.hideHoverMenu()}else{if(d=="footerMenuClick"){}else{if(d=="menuClick"){a.initSubMenus(c);if(a.curSubMenus.length){a.selectMenuRemotely(a.curSubMenus[0].submenuid,4)}else{a.LayoutMgr.clearInnerLayout()}a.hideHoverMenu()}else{if(d=="menuMouseOver"){a.showHoverMenu(c)}else{if(d=="menuMouseOut"){}}}}}}};RFViewManager.prototype.fixFooterHeight=function(){var c=document.getElementById(this.LayoutMgr.middleSectionId);var b=c.firstChild.nextSibling.offsetHeight,a=c.lastChild.offsetHeight;if(b>a){c.style.height=b+"px"}else{c.style.height=a+"px"}};RFViewManager.prototype.mouseMoveHandler=function(b){if(this.hoverMenuId>0){var a=document.getElementById("RFMenuItem_"+(this.hoverMenuId-1)),c=this.isMouseOverMenu(b,a,this.LayoutMgr.hoverMenuContainer);if(!c){this.hideHoverMenu()}}};RFViewManager.prototype.isMouseOverMenu=function(m,a,j){var h=m.clientX,f=m.clientY,k=this.getXY(a),d=k.X,p=k.Y,c=d+a.offsetWidth,o=p+a.offsetHeight,b=this.getXY(j),n=b.X,g=b.Y,l=n+j.offsetWidth,e=g+j.offsetHeight;if(h>d&&f>p&&h<c&&f<o){return true}else{if(h>n&&f>g&&h<l&&f<e){return true}}return false};RFViewManager.prototype.hideHoverMenu=function(){if(this.hoverMenuId>0){this.LayoutMgr.hoverMenuContainer.style.display="none";this.hoverMenuId=0}};RFViewManager.prototype.showHoverMenu=function(d){var b=this.initHoverMenus(d),a=document.getElementById("RFMenuItem_"+(d-1)),c=this.getXY(a);this.LayoutMgr.hoverMenuContainer.style.left=c.X+"px";this.LayoutMgr.hoverMenuContainer.style.display="block";this.menuMgr.createHoverMenu(b,this.LayoutMgr.hoverMenuContainer);this.hoverMenuId=d};RFViewManager.prototype.getXY=function(b){var e=0;var c=0;if(typeof(b.offsetParent)!="undefined"){for(var a=0,d=0;b;b=b.offsetParent){a+=b.offsetLeft;d+=b.offsetTop}e=a;c=d}else{e=b.offsetLeft;c=b.offsetTop}return{X:e,Y:c}};RFViewManager.prototype.initSubMenus=function(b){this.curSubMenus=[],menuLen=this.subMenuItems.length;for(var a=0;a<menuLen;a++){if(this.subMenuItems[a].menuid==b){this.curSubMenus.push(this.subMenuItems[a])}}};RFViewManager.prototype.initHoverMenus=function(c){var d=[],b=this.subMenuItems.length;for(var a=0;a<b;a++){if(this.subMenuItems[a].menuid==c){d.push(this.subMenuItems[a])}}return d};RFViewManager.prototype.checkCurrentLayout=function(){if(this.LayoutMgr.activeLayout!="inner"){this.LayoutMgr.createInnerPageLayout();this.loadWidgets();this.initSubMenus(1)}};RFViewManager.prototype.loadWidgets=function(){this.searchWidget=new SearchWidgetHandler("searchWidget",this.LayoutMgr.quickSearchSection)};RFViewManager.prototype.loadModule=function(b){this.activeModule=this.moduleMgr.getModuleObj(b);if(this.activeModule){var a=this.moduleMgr.getModuleName(b),c=this.moduleMgr.getPageId(b);this.activeModule.loadView(a,this.LayoutMgr.contentSection,this.LayoutMgr.subContentSection,c);this.fixFooterHeight()}reapfield.G_EventMgr.fireEvent("newModuleLoaded",this.activeModule.myName);if(!reapfield.G_API.isBackEvent){reapfield.G_API.isBackEvent=true}};RFViewManager.prototype.selectMenuRemotely=function(c,b){var a=this.getMenuId(c);this.checkCurrentLayout();if(a>=0){this.initSubMenus(a+1)}this.menuMgr.createSubMenu(this.curSubMenus,this.LayoutMgr.subMenuSection);this.menuMgr.selectSubMenu(c,a)};RFViewManager.prototype.getMenuId=function(b){var c=0;if(this.subMenuItems&&this.subMenuItems.length){for(var a=0;a<this.subMenuItems.length;a++){if(this.subMenuItems[a].submenuid==b){c=(this.subMenuItems[a].menuid-1);break}}}return c};