
var ACTIVE_CLASS_NAME="activeMenutabCell";var MENU_SEP_PREFIX="menusep";var MENU_TEST_ID="menutabTable";var LINK_HIGHLIGHT_COLOR="#0cabba";var isTop=(window.top==window);var nLastIndexHighlighted=null;var pLastMenuHighlighted=null;appendEvent(document,"mousedown",checkClickKill);appendEvent(window,"scroll",scroll);function scroll()
{if(isIE6){hideMenu();}}
var pTopWindow=(isTop)?window:window.top;if(isTop)pTopWindow.currentMenu=-1;function checkClickKill(event)
{if(isTop)
{if((pTopWindow.currentMenu!=-1)&&!isIframeChild(getSrcElement(event)))
{hideMenu();event.returnValue=false;}}
else
{if((window.top.currentMenu!=-1)&&!isIframeChild(getSrcElement(event)))
{window.top.hideMenu();event.returnValue=false;}}
event.returnValue=true;}
function doMenuLink(szHref,szTarget)
{hideMenu();if(szTarget==null)getContentIframe().location.href=szHref;else
{window.top.frames[szTarget].location.href=szHref;}}
function getContentIframe()
{return window.top.frames["_q_detail_"];}
function handleDown(event,nIndex)
{var mnuObj=$("menuframe"+nIndex);var isReady=(isIE)?(mnuObj.readyState=="complete"||mnuObj.readyState=="4"):(true);if(isReady)
{hideMenu();highlightTopLink(event,nIndex);showMenu(nIndex);event.returnValue=false;}}
function handleOut(){}
function handleOver(){}
function hideMenu()
{if(pTopWindow.currentMenu!=-1)
{var mnuObj=pTopWindow.document.getElementById("menuframe"+pTopWindow.currentMenu);mnuObj.style.visibility="hidden";unHighlightTopLink();pTopWindow.currentMenu=-1;}}
function highlightTopLink(event,nIndex)
{pLastMenuHighlighted=getSrcElement(event);nLastIndexHighlighted=nIndex;getSrcElement(event).setAttribute("oldClassName",getSrcElement(event).className);getSrcElement(event).className=ACTIVE_CLASS_NAME;}
function isIframeChild(pElem)
{var pCurrElem=pElem;while(pCurrElem!=null&&pCurrElem!='undefined'&&pCurrElem!=document)
{if(pCurrElem.id==MENU_TEST_ID)
{return true;}
else if(pCurrElem.tagName=="select")
{return false;}
pCurrElem=pCurrElem.parentNode;}
return false;}
function showMenu(nIndex)
{pTopWindow.currentMenu=nIndex;var mnuObj=document.getElementById("menuframe"+currentMenu);if(getCurrStyle(mnuObj).height=="1px")
{var mnuTbl=window.frames["menuframe"+currentMenu].window.document.getElementById("menutabTable");var newHeight=mnuTbl.clientHeight+10;var newWidth=mnuTbl.clientWidth+20;mnuObj.style.height=newHeight;mnuObj.style.width=newWidth;var posEl=mnuObj.getAttribute("posEl");var docWidth=document.getElementsByTagName("body")[0].clientWidth;var positionLeftStart=getRealLeft(posEl);var leftFinal=positionLeftStart-10;var rightEdge=leftFinal+newWidth;if(rightEdge>docWidth-28){leftFinal-=(rightEdge-docWidth+28);}
mnuObj.style.left=leftFinal;mnuObj.style.top=getRealTop(posEl)+$(posEl).clientHeight;}
mnuObj.style.visibility="visible";}
function unHighlightTopLink()
{var pLMH=window.top.pLastMenuHighlighted;if(pLMH!=null)
{pLMH.className=pLMH.getAttribute("oldClassName");}}
function addMenu(nIndex,src,posEl)
{document.write("<iframe id='menuframe"+nIndex+"' name='menuframe"+nIndex+"' src='"+src+"' frameborder='0' scrolling='no' style='height:1px; width:1px;z-index:100;position:absolute;top:0px;left:0px;visibility:hidden;' posEl='"+posEl.id+"'></iframe>");}
