/*
/===============================================================================
/ ITQua Menu Lite (AMG revision) client script
/===============================================================================
/ Copyright (c)2004-2006 Sergei Baranov
/ sergei_baranov@tut.by
/===============================================================================
*/
var _CURSOR_HAND="pointer";var _BR_VER=itq_mnult_detVer();var itq_mnult_arrProvodka=new Array();function itq_mnult_mnuiClick(sID){try{document.location.href=sID;/*onMnuiClick(sID);*/}catch(theError){void(0);}}function itq_mnult_mnuiOver(e){if(_BR_VER=="IEN")e=event;var toEl=itq_mnult_getETo(e);if(!toEl)return 0;toEl=itq_mnult_claimbToMenu(toEl);if(toEl.tagName.toUpperCase()!="TD")return 0;var idTd=toEl.id;if(idTd.indexOf("menuitem")==-1)return 0;var idChild=idTd.replace("menuitem","menu");var anchEl=itq_mnult_gEBId(idTd.replace("menuitem","link"));if(toEl.className.indexOf("_H")==-1)toEl.className=toEl.className+"_H";if(anchEl){if(anchEl.className.indexOf("_H")==-1)anchEl.className=anchEl.className+"_H";}var arrParts=idTd.split("menuitem");if(itq_mnult_arrProvodka[itq_mnult_arrProvodka.length-1]!=arrParts[1])itq_mnult_arrProvodka[itq_mnult_arrProvodka.length]=arrParts[1];var elChild=itq_mnult_gEBId(idChild);if(elChild)itq_mnult_posMenu(toEl,elChild);}function itq_mnult_claimbToMenu(theNd){if(theNd.nodeType==3)theNd=theNd.parentNode;while(theNd.id.indexOf("menu")==-1&&theNd.parentNode)theNd=theNd.parentNode;return theNd;}function itq_mnult_mnuiOut(e){if(_BR_VER=="IEN"){e=event;var toEl=itq_mnult_getETo(e);var fromEl=itq_mnult_getEFrom(e);}else{var fromEl=itq_mnult_getETo(e);var toEl=itq_mnult_getEFrom(e);}if(!fromEl)return 0;fromEl=itq_mnult_claimbToMenu(fromEl);if(fromEl.id.indexOf("menu")==-1)return 0;if(fromEl.id.indexOf("menuitem")!=-1){var arrParts=fromEl.id.split("menuitem");}else{var arrParts=fromEl.id.split("menu");}var sPrefix=arrParts[0];var sPrefixMnu=sPrefix+"menu";var sPrefixMnui=sPrefix+"menuitem";if((!toEl)||(!itq_mnult_isInMnusFam(toEl,sPrefix)))return itq_mnult_cutProvodka(sPrefix+"menuitem0",true,"");toEl=itq_mnult_claimbToMenu(toEl);var sFromId=fromEl.id;if(!sFromId)sFromId="";var sToId=toEl.id;if(!sToId)sToId="";var iIndexMnu=sFromId.indexOf(sPrefixMnu);var iIndexMnui=sFromId.indexOf(sPrefixMnui);if(fromEl==toEl)return 0;if(iIndexMnu==-1)return 0;var toDivEl=itq_mnult_upToDiv(toEl);var toDivId=toDivEl.id;if(!toDivId)toDivId="";var toDivBase=toDivId.replace(sPrefixMnu,"");if(iIndexMnui!=-1){var fromDivEl=itq_mnult_upToDiv(fromEl);if(toDivEl.nodeType==1){var fromDivId=fromDivEl.id;if(toDivId&&fromDivId){var fromDivBase=fromDivId.replace(sPrefixMnu,"");var toElBase=sToId.replace(sPrefixMnui,"");var fromElBase=sFromId.replace(sPrefixMnui,"");if(fromDivBase==toDivBase){itq_mnult_cutProvodka(sFromId,true,"");}else if(fromDivBase==toElBase){itq_mnult_cutProvodka(sFromId,true,"");}else if(toDivBase!=fromElBase){itq_mnult_cutProvodka(toDivBase,false,sPrefix);}}}}else if(iIndexMnu!=-1){var fromElBase=sFromId.replace(sPrefixMnu,"");if(toDivBase!=fromElBase)itq_mnult_cutProvodka(toDivBase,false,sPrefix);}}function itq_mnult_posMenu(elMnuItem,elMnu){if(elMnu.className.indexOf("_V")==-1)elMnu.className=elMnu.className+"_V";var arrScrSzs=itq_mnult_retScrSizes();var scrRight=arrScrSzs[2]+arrScrSzs[0];var scrBottom=arrScrSzs[3]+arrScrSzs[1];var mnuiLeft=itq_mnult_retAbsLeft(elMnuItem);var mnuiTop=itq_mnult_retAbsTop(elMnuItem);var mnuiWidth=elMnuItem.offsetWidth;var mnuiHeight=elMnuItem.offsetHeight;var mnuiRight=mnuiLeft+mnuiWidth;var mnuiBottom=mnuiTop+mnuiHeight;var mnuW=elMnu.offsetWidth;var mnuH=elMnu.offsetHeight;var theTBody=itq_mnult_gEBId(itq_mnult_IdMnuiToMnubdy(elMnuItem.id));var posType=0;if(theTBody.rows.length>1||theTBody.rows[0].cells.length<2)posType=1;if(posType){		var xMbLeft=mnuiRight-2;if(xMbLeft+mnuW>scrRight)xMbLeft=mnuiLeft-mnuW+2;if(xMbLeft<arrScrSzs[2])xMbLeft=mnuiRight-2;var yMbTop=mnuiTop+2;if(yMbTop+mnuH>scrBottom)yMbTop=mnuiBottom-mnuH-2;if(yMbTop<arrScrSzs[3])yMbTop=mnuiTop+2;}else{var xMbLeft=mnuiLeft+2;if(xMbLeft+mnuW>scrRight)xMbLeft=mnuiRight-mnuW-2;if(xMbLeft<arrScrSzs[2])xMbLeft=mnuiLeft+2;yMbTop=mnuiBottom;if(yMbTop+mnuH>scrBottom)yMbTop=mnuiTop-mnuH+2;if(yMbTop<arrScrSzs[3])yMbTop=mnuiBottom;}while(((xMbLeft+mnuW+4)>scrRight)&&(xMbLeft>arrScrSzs[2]))xMbLeft-=8;
while(((yMbTop+mnuH+4)>scrBottom)&&(yMbTop>arrScrSzs[3]))yMbTop-=2;itq_mnult_setAPos(elMnu,xMbLeft,yMbTop,-1.1,-1.1)}function itq_mnult_cutProvodka(tdId,bCutLatest,sPrefix){if(!sPrefix){var arrParts=tdId.split("menuitem");sPrefix=arrParts[0];var idBase=arrParts[1];}else{var idBase=tdId;}var idNext="";var elTd=null;var elDiv=null;var anchEl=null;var i=0;if(itq_mnult_arrProvodka.length>0){for(i=(itq_mnult_arrProvodka.length-1);i>=0&&itq_mnult_arrProvodka[i]!=idBase;i--){if(Array.prototype.pop){idNext=itq_mnult_arrProvodka.pop();}else{idNext=itq_mnult_arrProvodka[i];}elTd=itq_mnult_gEBId(sPrefix+"menuitem"+idNext);if(elTd)elTd.className=elTd.className.replace("_H","");anchEl=itq_mnult_gEBId(sPrefix+"link"+idNext);if(anchEl)anchEl.className=anchEl.className.replace("_H","");elDiv=itq_mnult_gEBId(sPrefix+"menu"+idNext);if(elDiv)elDiv.className=elDiv.className.replace("_V","");}if(!Array.prototype.pop){var j=0;var arrTmp=itq_mnult_arrProvodka;itq_mnult_arrProvodka=new Array();for(j=0;j<i;j++)itq_mnult_arrProvodka[j]=arrTmp[j];}}if(bCutLatest){elTd=itq_mnult_gEBId(sPrefix+"menuitem"+idBase);if(elTd)elTd.className=elTd.className.replace("_H","");anchEl=itq_mnult_gEBId(sPrefix+"link"+idBase);if(anchEl)anchEl.className=anchEl.className.replace("_H","");if(idBase){elDiv=itq_mnult_gEBId(sPrefix+"menu"+idBase);if(elDiv)elDiv.className=elDiv.className.replace("_V","");}}return 0;}function itq_mnult_upToDiv(theEl){try{while(theEl.parentNode){if(theEl.tagName){if((theEl.tagName.toUpperCase()=="DIV"||theEl.tagName.toUpperCase()=="TABLE")&&theEl.id.indexOf("menu")!=-1)return theEl;}theEl=theEl.parentNode;}}catch(theError){void(0);}return theEl;}function itq_mnult_isInMnusFam(theEl,sPrefix){var answer=false;var elId;do{elId=theEl.id;if(elId){if(elId.indexOf(sPrefix+"menu")!=-1){answer=true;break;}}theEl=theEl.parentNode;}while(theEl.parentNode);return answer;}function itq_mnult_IdMnuiToMnubdy(sIdMnui){var arrParts=sIdMnui.split("menuitem");var sPrefix=arrParts[0];var sIndex=arrParts[1];var arrIndexes=sIndex.split("-");if(Array.prototype.pop){arrIndexes.pop();}else{var j=0;var arrTmp=arrIndexes;arrIndexes=new Array();for(j=0;j<arrTmp.length-1;j++)arrIndexes[j]=arrTmp[j];	}if(arrIndexes.length>0){arrParts[1]=arrIndexes.join("-");}else{arrParts[1]="0";}return arrParts.join("menubody");}function itq_mnult_addEvent(theEl,strEvent,theFunc,sBubbles){if(_BR_VER=="IEN"||_BR_VER=="OPR"){eval("theEl.attachEvent('on"+strEvent+"',"+theFunc+");");}else if(_BR_VER=="NNN"){eval("theEl.addEventListener('"+strEvent+"',"+theFunc+","+sBubbles+");");}}function itq_mnult_gEBId(sId){return document.getElementById(sId);}function itq_mnult_eCanc(e){if(_BR_VER=="IEN"){event.returnValue=false;}else if(_BR_VER=="NNN"){e.returnValue=false;}}function itq_mnult_getETo(ev){var answer=null;try{if(_BR_VER=="IEN"){answer=ev.toElement;}else{answer=ev.target;}}catch(theError){void(0);}return answer;}function itq_mnult_getEFrom(ev){var answer=null;try{if(_BR_VER=="IEN"){answer=ev.fromElement;}else{answer=ev.relatedTarget;}}catch(theError){void(0);}return answer;}function itq_mnult_setAPos (theEl,intLeft,intTop,intWidth,intHeight){var theParEl=theEl.offsetParent;if(theParEl&&theParEl.style&&(theParEl.style.position==="absolute"||theParEl.style.position==="relative")){var arrParPosition=itq_mnult_AbsPos(theParEl);intLeft-=arrParPosition[0];intTop-=arrParPosition[1];}theEl.style.position="absolute";if(intLeft!=(-1.1))theEl.style.left=intLeft+"px";if(intTop!=(-1.1))theEl.style.top=intTop+"px";if(intWidth!=(-1.1))theEl.style.width=intWidth+"px";if(intHeight!=(-1.1))theEl.style.height=intHeight+"px";}function itq_mnult_retAbsLeft(theEl){var arrPosition=itq_mnult_AbsPos(theEl);return arrPosition[0];}function itq_mnult_retAbsTop(theEl){var arrPosition=itq_mnult_AbsPos(theEl);return arrPosition[1];}function itq_mnult_AbsPos(theObj) {var arrAnswer=new Array();arrAnswer[0]=0;arrAnswer[1]=0;while(theObj.offsetParent){arrAnswer[0]+=theObj.offsetLeft;arrAnswer[1]+=theObj.offsetTop;theObj=theObj.offsetParent;}return arrAnswer;}function itq_mnult_retScrSizes(){var answer=new Array();if(_BR_VER=="NNN"){answer[0]=window.innerWidth;answer[1]=window.innerHeight;answer[2]=window.pageXOffset;answer[3]=window.pageYOffset;}else{answer[0]=document.body.clientWidth;answer[1]=document.body.clientHeight;answer[2]=document.body.scrollLeft;answer[3]=document.body.scrollTop;}return answer;}function itq_mnult_detVer(){if(document.attachEvent){if(document.execCommand){if(document.createComment){_BR_VER="IEN";return _BR_VER;}else{_BR_VER="IEN";return _BR_VER;}}else{_BR_VER="OPR";return _BR_VER;}}else if(document.addEventListener){_BR_VER="NNN";return _BR_VER;}else{_BR_VER="OLD";return _BR_VER;}}