var TxMenuBrowserInt=navigator.userAgent.toLowerCase();var TxMenuIsNavigatorInt=((TxMenuBrowserInt.indexOf('mozilla')!=-1)&&(TxMenuBrowserInt.indexOf('compatible')==-1));var TxMenuIsChromeInt=(TxMenuBrowserInt.indexOf('chrome')!=-1);var TxMenuDirInt;var TxMenuArrowInt;var TxMenuArrowOffsetInt;var TxMenuFontInt;var TxMenuFontSizeInt;var TxMenuSpacingInt;var TxMenuRulesInt;var TxMenuRuleAttrInt;var TxMenuRuleSpacingInt;var TxMenuRuleOffsetInt;var TxMenuWidthInt;var NewsWidth;var NewsTop;var NewsLeft;function DisplayTextMenu(Choices,MenuPath,DynamicText,MenuTop,MenuLeft,Extended)
{var CurrPos=4;var MenuFont,MenuRuleAttr;if(typeof(TxMenuDir)!='undefined'){TxMenuDirInt=TxMenuDir;}
else{TxMenuDirInt='/Controls/TextMenuImages/';}
if(typeof(TxMenuArrow)!='undefined'){TxMenuArrowInt=TxMenuArrow;}
else{TxMenuArrowInt='Black';}
if((typeof(TxMenuArrowOffset)!='undefined')&&!isNaN(TxMenuArrowOffset))
{TxMenuArrowOffsetInt=TxMenuArrowOffset;}
else{TxMenuArrowOffsetInt=0;}
if(typeof(TxMenuFont)!='undefined'){MenuFont=TxMenuFont;}
else
{MenuFont='font-family: Helvetica, Arial, san-serif; font-size: 12px; '+'font-weight: bold; text-decoration: none;';}
if((typeof(TxMenuFontSize)!='undefined')&&!isNaN(TxMenuFontSize)&&(TxMenuFontSize>0)){TxMenuFontSizeInt=TxMenuFontSize;}
else{TxMenuFontSizeInt=12;}
if((typeof(TxMenuSpacing)!='undefined')&&!isNaN(TxMenuSpacing)&&(TxMenuSpacing>0)){TxMenuSpacingInt=TxMenuSpacing;}
else
{if(TxMenuFontSizeInt<=12){TxMenuSpacingInt=11;}
else{TxMenuSpacingInt=8;}}
if((typeof(TxMenuRules)!='undefined')&&!isNaN(TxMenuRules)&&(TxMenuRules>0)){TxMenuRulesInt=TxMenuRules;}
else{TxMenuRulesInt=0;}
if(typeof(TxMenuRuleAttr)!='undefined'){MenuRuleAttr=TxMenuRuleAttr;}
else{MenuRuleAttr='border-collapse: collapse; border: 1px solid #808080;';}
if((typeof(TxMenuRuleSpacing)!='undefined')&&!isNaN(TxMenuRuleSpacing)&&(TxMenuRuleSpacing>=0)){TxMenuRuleSpacingInt=TxMenuRuleSpacing;}
else{TxMenuRuleSpacingInt=TxMenuFontSizeInt;}
if((typeof(TxMenuRuleOffset)!='undefined')&&!isNaN(TxMenuRuleOffset)&&(TxMenuRuleOffset>=0)){TxMenuRuleOffsetInt=TxMenuRuleOffset;}
else{TxMenuRuleOffsetInt=3;}
if((typeof(TxMenuWidth)!='undefined')&&!isNaN(TxMenuWidth)&&(TxMenuWidth>0)){TxMenuWidthInt=TxMenuWidth;}
else{TxMenuWidthInt=150;}
if(typeof(MenuPath)=='number'){MenuPath=''+MenuPath;}
else if(typeof(MenuPath)!='string'){MenuPath='';}
if((typeof(MenuTop)!='undefined')&&!isNaN(MenuTop)&&(MenuTop>0)){CurrPos+=MenuTop;}
if((typeof(MenuLeft)=='undefined')||isNaN(MenuLeft)||(MenuLeft<=0)){MenuLeft=20;}
if(typeof(DynamicText)!='string'){DynamicText='';}
if(typeof(Extended)!='boolean'){Extended=false;}
var StyleRE=new RegExp(':');if(MenuFont.match(StyleRE)){TxMenuFontInt='style="'+MenuFont+'"';}
else{TxMenuFontInt='class="'+MenuFont+'"';}
if(MenuRuleAttr.match(StyleRE))
{TxMenuRuleAttrInt='style="'+MenuRuleAttr+'"';}
else{TxMenuRuleAttrInt='class="'+MenuRuleAttr+'"';}
NewsWidth=TxMenuWidthInt-35;NewsLeft=MenuLeft;document.write('
');CurrPos+=TxMenuDrawInt(Choices,MenuPath,DynamicText,CurrPos,MenuLeft,Extended,1);if(TxMenuRulesInt>0)
{document.write('
'+'
');}
NewsTop=CurrPos+TxMenuFontSizeInt+3;document.write('
');return;}
function TxMenuDrawInt(Tree,MenuPath,DynamicText,CurrPos,CurrIndent,Extended,Level)
{var TreeDepth=Tree.length;var OrigPos=CurrPos;var CurrElem=0;var PathElems;var PathElem=-1
var TerminalLevel=false;var ItemHeight,ItemWidth,ItemSlot;var ItemText;var ItemTextRE=/\|/g;var ArrowPos;if(Level>1){CurrElem=1;}
if(MenuPath.length>0)
{PathElems=MenuPath.split('.');if(Level<=PathElems.length)
{PathElem=parseInt(PathElems[Level-1]);if(Level<=1){PathElem--;}
if(Level==PathElems.length){TerminalLevel=true;}}
else{PathElem=0;}}
ItemWidth=TxMenuWidthInt-CurrIndent;while(CurrElem0)
{ItemText=ItemText.substring(ItemText.indexOf('=')+1,ItemHeight-1);}
else{ItemText=ItemText.substring(ItemText.indexOf('=')+1);}}
else if(ItemText.substr(0,5)=='size=')
{ItemHeight=ItemText.indexOf(',');if(ItemHeight>0){ItemText=ItemText.substring(ItemHeight+1);}
else{ItemText='';}}
if(ItemText.length<=0){CurrElem++;continue;}
ItemHeight=TxMenuHeightInt(ItemText,ItemWidth);ItemSlot=ItemHeight+TxMenuSpacingInt;if(Level<=TxMenuRulesInt)
{document.write(''+'
');}
ItemText=ItemText.replace(ItemTextRE,'
');if((TerminalLevel&&(CurrElem==PathElem)&&(DynamicText==''))||(((Extended)?Tree[CurrElem][3].length:Tree[CurrElem][1].length)<=0))
{document.write(''+''+ItemText+''+'
');}
else
{if(TxMenuIsNavigatorInt)
{document.write(''+''+ItemText+'
');}
else
{document.write('');}}
ArrowPos=CurrPos+Math.floor(ItemHeight/2)
-Math.floor(TxMenuFontSizeInt/3)+TxMenuArrowOffsetInt;CurrPos+=ItemSlot;if(TerminalLevel&&(CurrElem==PathElem))
{if(DynamicText!='')
{var DynamicParms;var DynamicIndent=8;if((typeof(TxDynamicTextParms)=='string')&&(TxDynamicTextParms.length>0))
{var PrevSpacing=TxMenuSpacingInt;var DynamicElem=[['','','',TxDynamicTextParms]];DynamicParms=TxMenuParseSubmenuInt(DynamicElem);CurrPos-=(PrevSpacing-TxMenuSpacingInt);DynamicIndent=DynamicParms[2];}
ItemHeight=TxMenuHeightInt(DynamicText,ItemWidth);ItemSlot=ItemHeight+TxMenuSpacingInt;if(Level'+'
');}
DynamicText=DynamicText.replace(ItemTextRE,'
');document.write(''+''+DynamicText+''+'
');ArrowPos=CurrPos+Math.floor(ItemHeight/2)
-Math.floor(TxMenuFontSizeInt/3)+TxMenuArrowOffsetInt;if((typeof(DynamicParms)=='object')&&(DynamicParms[3].length>0)){eval(DynamicParms[3]);}
CurrPos+=ItemSlot;}
if(TxMenuArrowInt!='')
{document.write(''+'
'+'
');}}
if(Extended&&((PathElem<0)||(CurrElem==PathElem))&&(typeof(Tree[CurrElem][2])=='object'))
{var HeightAdj=TxMenuSpacingInt;var SubmenuParms=TxMenuParseSubmenuInt(Tree[CurrElem][2]);HeightAdj-=TxMenuSpacingInt;CurrPos-=HeightAdj;CurrPos+=TxMenuDrawInt(Tree[CurrElem][2],MenuPath,DynamicText,CurrPos,CurrIndent+SubmenuParms[2],Extended,Level+1);if(SubmenuParms[3].length>0){eval(SubmenuParms[3]);}
CurrPos+=HeightAdj;}
CurrElem++;}
return(CurrPos-OrigPos);}
function TxMenuHeightInt(ItemText,ItemWidth)
{var ItemHeight=0;var DummyItem,DummyText;var DummyTextRE=/\|/g;try
{DummyItem=document.createElement('textarea');DummyItem.style.borderWidth='0px';DummyItem.style.margin='0px';DummyItem.style.padding='0px';if(TxMenuFontInt.substr(0,6)=='class=')
{DummyItem.className=TxMenuFontInt.substr(6,TxMenuFontInt.length-1);}
else
{var Matches;var FontFamRE=/font-family:\s*([^;]+)/i;var FontStlRE=/font-style:\s*([^;]+)/i;var FontWtRE=/font-weight:\s*([^;]+)/i;var FontDecRE=/text-decoration:\s*([^;]+)/i;if((Matches=TxMenuFontInt.match(FontFamRE)))
{DummyItem.style.fontFamily=Matches[1];}
if((Matches=TxMenuFontInt.match(FontStlRE)))
{DummyItem.style.fontStyle=Matches[1];}
if((Matches=TxMenuFontInt.match(FontWtRE)))
{DummyItem.style.fontWeight=Matches[1];}
if((Matches=TxMenuFontInt.match(FontDecRE)))
{DummyItem.style.textDecoration=Matches[1];}}
DummyItem.style.fontSize=TxMenuFontSizeInt+'px';DummyItem.style.display='block';DummyItem.style.visibility='hidden';DummyItem.style.position='absolute';DummyItem.style.height='1px';DummyItem.style.width=(ItemWidth+((TxMenuIsChromeInt)?3:0))+'px';DummyText=ItemText.replace(DummyTextRE,'\n');DummyItem.innerHTML=DummyText;document.body.appendChild(DummyItem);if(DummyItem.scrollWidth!=ItemWidth)
{DummyItem.style.width=((ItemWidth*2)-DummyItem.scrollWidth
+((TxMenuIsChromeInt)?3:0))+'px';}
ItemHeight=DummyItem.scrollHeight;document.body.removeChild(DummyItem);}
catch(except)
{ItemHeight=0;if((typeof(DummyItem)!='undefined')&&(DummyItem.parentNode===document.body))
{document.body.removeChild(DummyItem);}}
if(ItemHeight<=0)
{var FontFam=-1;var FontType=0;var FontRatio=0.526;var Items=ItemText.split('|');var CurrItem=0;if(TxMenuFontInt.substr(0,6)!='class=')
{var FontRatios=[[0.537,0.537,0.557],[0.599,0.600,0.599],[0.537,0.539,0.558],[0.514,0.509,0.535]]
var Matches,Matched;var FontFamRE=/font-family:\s*([^;]+)/i;var FontStlRE=/font-style:\s*([^;]+)/i;var FontWtRE=/font-weight:\s*([^;]+)/i;if((Matches=TxMenuFontInt.match(FontFamRE)))
{Matched=Matches[1].toLowerCase();if((Matched.substr(0,5)=='arial')||(Matched.substr(0,6)=='tahoma')||(Matched.substr(0,9)=='san-serif'))
{FontFam=0;}
else if(Matched.substr(0,8)=='courrier'){FontFam=1;}
else if(Matched.substr(0,9)=='helvetica'){FontFam=2;}
else if((Matched.substr(0,5)=='times')||(Matched.substr(0,9)=='san-serif'))
{FontFam=3;}}
if((Matches=TxMenuFontInt.match(FontStlRE)))
{Matched=Matches[1].toLowerCase();if((Matched.substr(0,6)=='italic')||(Matched.substr(0,7)=='oblique')){FontType=1;}}
if((Matches=TxMenuFontInt.match(FontWtRE)))
{Matched=Matches[1].toLowerCase();if(Matched.substr(0,4)=='bold'){FontType=2;}}}
if(FontFam>=0){FontRatio=FontRatios[FontFam][FontType];}
while(CurrItem0))
{var Parms;var Font='',FontSize='',MenuSpacing='';var BorderBetween,BorderColor,BorderWidth;var ColorOff,ColorSel;var FontFamily,FontSize,FontBold,FontItalic;var TextAlign,TextPadLeft,TextPadTop;var TextColorOff,TextColorSel;var PageBreak;var FontFamilyOff,FontSizeOff,FontBoldOff,FontItalicOff;var FontFamilySel,FontSizeSel,FontBoldSel,FontItalicSel;var HoverUnderline,HoverBold,HoverItalic,HoverColor;Parms=Submenu[0][3].replace(/=/g,'=\'');Parms=Parms.replace(/,/g,'\',');Parms+='\'';try{eval(Parms);}
catch(except)
{Font='';FontSize='';MenuSpacing='';}
if(Font.length>0)
{Restore+=('TxMenuFontInt = \''+TxMenuFontInt+'\', ');if(Font.match(/:/))
{var FamStart=Font.indexOf('font-family:');var FamEnd,Family;if(FamStart!=-1)
{Family=Font.substr(FamStart+12);if((FamEnd=Family.indexOf(';'))!=-1)
{Family=Family.substr(0,FamEnd);TxMenuFontInt='style="'+Font.substr(0,FamStart+12)+
Family.replace(/:/g,',')+Font.substr(FamStart+FamEnd+12)+'"';}
else
{TxMenuFontInt='style="'+Font.substr(0,FamStart+12)+
Family.replace(/:/g,',')+'"';}}
else{TxMenuFontInt='style="'+Font+'"';}}
else{TxMenuFontInt='class="'+Font+'"';}}
if(FontSize.length>0)
{Restore+=('TxMenuFontSizeInt = '+TxMenuFontSizeInt+', ');TxMenuFontSizeInt=parseInt(FontSize);}
if(MenuSpacing.length>0)
{Restore+=('TxMenuSpacingInt = '+TxMenuSpacingInt+', ');TxMenuSpacingInt=parseInt(MenuSpacing);}
if(Restore.length>0){Restore=Restore.substr(0,Restore.length-2);}}
return([MenuType,MenuSubtype,parseInt(Indent),Restore]);}