
function initAppMenu()
{if(self.currFupId!="")
{if(document.getElementById("BG_"+self.currFupId))
{changeToClickAppMenu(self.currFupId);}
return;}}
function resetAppMenu(iFupId,iAppId)
{if(iAppId!=self.currAppId)
{var url=getAppMenuUrl();url=Helper.setUrlValueByParam("rq_TargetId",iFupId,url);url=Helper.setUrlValueByParam("rq_AppId",iAppId,url);document.location.href=url;}
else if(self.currFupId!=iFupId)
{self.currFupId=iFupId;if(document.getElementById("BG_"+iFupId))
{changeToClickAppMenu(iFupId);}
else
{if(idLastClicked&&idLastClicked!="")
{changeStyleAppMenu(idLastClicked,FGmenuClickClass,BGmenuClickClass,"visited");}}}
return;}
function getAppMenuUrl()
{var url=self.oHtmlRoot.oUp.connector;if(!Helper.getCookieValueByParam("co_SId"))
{if(Helper.getQsValueByParam("rq_SId"))
var url=Helper.setUrlValueByParam("rq_SId",Helper.getQsValueByParam("rq_SId"),url);}
var url=Helper.setUrlValueByParam("rq_Template","internal/layout/vm/html/"+oHtmlRoot.oUp.oFormatInfo.layoutDir+"/frames/appmenu.vm",url);return url;}
function changeToClickAppMenu(iFupId)
{if(typeof idLastClicked=="undefined"||idLastClicked==iFupId)return;if(idLastClicked!="")
{changeStyleAppMenu(idLastClicked,FGmenuOutClass,BGmenuOutClass,"normal");}
customClick(iFupId);idLastClicked=iFupId;changeStyleAppMenu(iFupId,FGmenuClickClass,BGmenuClickClass,"visited");return;}
function changeToHoverAppMenu(iFupId)
{if(idLastClicked==iFupId)return;changeStyleAppMenu(iFupId,FGmenuHoverClass,BGmenuHoverClass,"hover");customHover(iFupId);return;}
function changeToOutAppMenu(iFupId)
{if(idLastClicked==iFupId)return;changeStyleAppMenu(iFupId,FGmenuOutClass,BGmenuOutClass,"normal");customOut(iFupId);return;}
function changeStyleAppMenu(iFupId,FGClass,BGClass,state)
{var oBgElement=document.getElementById("BG_"+iFupId);var oFgElement=document.getElementById("FG_"+iFupId);if(!oFgElement||!oBgElement)
return;clearForegroundStyleProps(oFgElement);clearBackgroundStyleProps(oBgElement);oFgElement.className=FGClass;oBgElement.className=BGClass;setSpecificStyleProps(state+"_BG_"+iFupId,oBgElement);setSpecificStyleProps(state+"_FG_"+iFupId,oFgElement);if(state=="visited")
{oFgElement.blur();}
return;}
function clearForegroundStyleProps(oElement)
{oElement.style.color="";oElement.style.fontFamily="";oElement.style.fontSize="";oElement.style.fontStyle="";oElement.style.fontWeight="";oElement.style.textDecoration="";return;}
function clearBackgroundStyleProps(oElement)
{oElement.style.paddingBottom="";oElement.style.paddingLeft="";oElement.style.paddingRight="";oElement.style.paddingTop="";oElement.style.backgroundAttachment="";oElement.style.backgroundColor="";oElement.style.backgroundImage="";oElement.style.backgroundRepeat="";oElement.style.borderStyle="";oElement.style.borderWidth="";oElement.style.borderLeftColor="";oElement.style.borderTopColor="";oElement.style.borderRightColor="";oElement.style.borderBottomColor="";return;}
function setSpecificStyleProps(stateAndGuid,oElement)
{var aCurrStyles={};aCurrStyles=aMenuGuid[stateAndGuid];if(!aCurrStyles)
return;for(var styleProp in aCurrStyles)
eval("oElement.style."+styleProp+"="+"\""+aCurrStyles[styleProp]+"\"");return;}
