
function TPageMenu(){var _1="";var _2="left";var _3=false;var _4=false;var _5=0;var _6=false;var _7="";this.MenuSpacing=1;this.SubMenuSpacing=1;this.ShowDelay=200;this.HideDelay=200;this.ShadowOffsetX=0;this.ShadowOffsetY=0;this.StylePrefix="TPAGEMENU_";this.Items=new Array();this.ObjectReference="";this.Focused=false;this.ButtonID=null;this.ShowingTimer=null;this.HidingTimer=null;this.TAjaxLoad=null;this.insertElementIn=function(_8,_9,_a){var _b=null;if((typeof(_8)=="undefined")||(_8=="")){window.alert("TPageMenu Class Error: A required parameter ObjectName is not specified when calling method insertElementIn.");return false;}
if(typeof(_9)=="undefined"){_9=_2;}
if((_9.toString().toLowerCase()!="left")&&(_9.toString().toLowerCase()!="right")&&(_9.toString().toLowerCase()!="top")&&(_9.toString().toLowerCase()!="bottom")){_9=_2;}
if(typeof(_a)=="undefined"){_a=false;}
_1=_8;_2=_9.toString().toLowerCase();_3=_a;_4=(document.all)?true:false;if(_3.toString().toLowerCase()=="not_ie"){if(_4){_3=false;}else{_3=true;}}
if(_3.toString().toLowerCase()=="ie_only"){if(_4){_3=true;}else{_3=false;}}
_b=document.getElementById(_1);if(_b==null){window.alert("TPageMenu Class Error: An object called '"+_1+"', which is specified in ObjectName parameter, is not exist.");return false;}
_b.innerHTML=this.getHTML();_b.TPageMenu=this;return true;};this.insertResultIn=function(_c,_d,_e,_f,_10){var Obj=null;if((typeof(_c)=="undefined")||(_c=="")){window.alert("TPageMenu Class Error: A required parameter ObjectName is not specified when calling method insertResultIn.");return false;}
this.TAjaxLoad=null;this.TAjaxLoad=new TAjaxLoad();if(typeof(_d)=="undefined"){_d=this.TAjaxLoad.RunBeforeRequest;}
if(typeof(_e)=="undefined"){_e=this.TAjaxLoad.RunAfterLoad;}
if(typeof(_f)=="undefined"){_f=this.TAjaxLoad.RunAfterFail;}
if(typeof(_10)=="undefined"){_10=this.TAjaxLoad.ExecScripts;}
_7=_c;this.TAjaxLoad.RunBeforeRequest=_d;this.TAjaxLoad.RunAfterLoad=_e;this.TAjaxLoad.RunAfterFail=_f;this.TAjaxLoad.ExecScripts=_10;Obj=document.getElementById(_7);if(Obj==null){window.alert("TPageMenu Class Error: An object called '"+_7+"', which is specified in ObjectName parameter, is not exist.");return false;}
_6=true;};this.addItem=function(_12,URL,_14){function _15(_16,URL,_18,_19,_1a){this.Caption=_16;this.URL=URL;this.Items=new Array();this.NoAjax=_18;this.ObjectReference=_1a;this.SubMenuID=null;this.ButtonID=null;this.ShadowID=null;this.Focused=false;this.addItem=_19.addItem;this.GetItem=_19.GetItem;this.FindItem=_19.FindItem;};if(typeof(_12)=="undefined"){_12="";}
if(typeof(URL)=="undefined"){URL="";}
if(typeof(_14)=="undefined"){_14=false;}
var _1b=this.Items.length;this.Items[_1b]=new _15(_12,URL,_14,this,this.ObjectReference+".Items["+_1b+"]");return this.Items[_1b];};this.GetItem=function(_1c,_1d){if((typeof(_1d)=="undefined")||(_1d<0)){_1d=0;}
if(_1d>this.Items.length-1){_1d=this.Items.length-1;}
var i;if(this.Items.length>0){for(i=_1d;i<this.Items.length;i++){if(this.Items[i].Caption==_1c){return this.Items[i];}}
return null;}else{return null;}};this.FindItem=function(_1f){var i,Obj;if(this.Items.length>0){for(i=0;i<this.Items.length;i++){if(this.Items[i].Caption==_1f){return this.Items[i];}
Obj=this.Items[i].FindItem(_1f);if(Obj!=null){return Obj;}}
return null;}else{return null;}};this.unhideSubMenu=function(_22,_23,_24){var Obj=document.getElementById(_23.SubMenuID);var Shd=document.getElementById(_23.ShadowID);if(Obj!=null){this.hideSubMenuInverse(_22,_23);this.locateSubMenu(_23,_24);Obj.style.visibility="visible";if(Shd!=null){Shd.style.visibility="visible";}
_23.ButtonID=_24;this.makeButtonSelected(_24,true);}};this.hideSubMenu=function(_27){var Obj=document.getElementById(_27.SubMenuID);var Shd=document.getElementById(_27.ShadowID);if(Obj!=null){Obj.style.visibility="hidden";if(Shd!=null){Shd.style.visibility="hidden";}
this.makeButtonSelected(_27.ButtonID,false);}
var i;var l=_27.Items.length;for(i=0;i<l;i++){this.hideSubMenu(_27.Items[i]);}};this.hideSubMenuInverse=function(_2c,_2d){var i;var l=_2c.Items.length;for(i=0;i<l;i++){if(_2c.Items[i]!==_2d){this.hideSubMenu(_2c.Items[i]);}}};this.mouseOverButton=function(_30,_31,_32){window.clearTimeout(this.ShowingTimer);this.makeButtonUnselectedInverse(_30,_31);var _33=_1+".TPageMenu"+_30.ObjectReference;var _34=_1+".TPageMenu"+_31.ObjectReference;if(_32!="NoSubMenu"){this.ShowingTimer=window.setTimeout(_1+".TPageMenu.unhideSubMenu("+_33+", "+_34+", \""+_32+"\")",this.ShowDelay);}else{this.ShowingTimer=window.setTimeout(_1+".TPageMenu.hideSubMenuInverse("+_33+", "+_34+")",this.ShowDelay);}};this.mouseOutButton=function(){window.clearTimeout(this.ShowingTimer);};this.mouseOver=function(_35){_35.Focused=true;this.makeButtonSelected(_35.ButtonID,true);};this.mouseOut=function(_36){_36.Focused=false;window.clearTimeout(this.HidingTimer);this.HidingTimer=window.setTimeout(_1+".TPageMenu.checkHide()",this.HideDelay);};this.checkHide=function(){var i;if(!this.isFocused(this)){for(i=0;i<this.Items.length;i++){this.hideSubMenu(this.Items[i]);}}
window.clearTimeout(this.HidingTimer);};this.isFocused=function(_38){var R=_38.Focused;if(!R){var i;var l=_38.Items.length;for(i=0;i<l;i++){if(this.isFocused(_38.Items[i])){R=true;break;}}}
return R;};this.makeButtonSelected=function(_3c,_3d){if((_3c!=null)&&_3){var S="";var Stl="SUB";if(_3c.toString().search(_1+"_TPageMenu_MainMenu")!=-1){Stl="MAIN";}
if(_4){var Obj=document.getElementById(_3c+"_A");if(Obj!=null){if(_3d){S=this.StylePrefix+Stl+"_ITEM_IE_selected";}else{S=this.StylePrefix+Stl+"_ITEM_IE";}
if(Obj.className!=S){Obj.className=S;}}}else{var Obj=document.getElementById(_3c+"_Div");if(Obj!=null){if(_3d){S=this.StylePrefix+Stl+"_ITEM_selected";}else{S=this.StylePrefix+Stl+"_ITEM";}
if(Obj.className!=S){Obj.className=S;}}}}};this.makeButtonUnselectedInverse=function(_41,_42){var i;var l=_41.Items.length;for(i=0;i<l;i++){if(_41.Items[i]!==_42){this.makeButtonSelected(_41.Items[i].ButtonID,false);}}};this.getHTML=function(){var _45=_1+"_TPageMenu_MainMenu";var R=this.getMenuHTML(this,true,_45);var i;for(i=0;i<this.Items.length;i++){if(this.Items[i].Items.length>0){R=R+this.getSubMenuChain(this.Items[i]);}}
return R;};this.getSubMenuChain=function(_48){var _49=_1+"_TPageMenu_SubMenu"+_5;var _4a=_1+"_TPageMenu_Shadow"+_5;var R=this.getShadowHTML(_4a);R+=this.getMenuHTML(_48,false,_49);_48.SubMenuID=_49;_48.ShadowID=_4a;_5++;var i;for(i=0;i<_48.Items.length;i++){if(_48.Items[i].Items.length>0){R=R+this.getSubMenuChain(_48.Items[i]);}}
return R;};this.getMenuHTML=function(_4d,_4e,_4f){var Stl="SUB";if(_4e){Stl="MAIN";}
var _51="onmouseover='"+_1+".TPageMenu.mouseOver("+_1+".TPageMenu"+_4d.ObjectReference+")' ";var _52="onmouseout='"+_1+".TPageMenu.mouseOut("+_1+".TPageMenu"+_4d.ObjectReference+")' ";var R="<table name='"+_4f+"' id='"+_4f+"' "+_51+_52+"border='0' cellspacing='0' cellpadding='0' class='"+this.StylePrefix+Stl+"_OUTERTABLE'>"+"<tr>"+"<td name='"+_4f+"_LT' id='"+_4f+"_LT' class='"+this.StylePrefix+Stl+"_L_T'></td>"+"<td class='"+this.StylePrefix+Stl+"_M_T'></td>"+"<td name='"+_4f+"_RT' id='"+_4f+"_RT' class='"+this.StylePrefix+Stl+"_R_T'></td>"+"</tr>"+"<tr>"+"<td class='"+this.StylePrefix+Stl+"_L_M'></td>"+"<td align='center' valign='top' class='"+this.StylePrefix+Stl+"_M_M'>"+this.getItemsHTML(_4d,_4e,_4f)+"</td>"+"<td class='"+this.StylePrefix+Stl+"_R_M'></td>"+"</tr>"+"<tr>"+"<td name='"+_4f+"_LB' id='"+_4f+"_LB' class='"+this.StylePrefix+Stl+"_L_B'></td>"+"<td class='"+this.StylePrefix+Stl+"_M_B'></td>"+"<td name='"+_4f+"_RB' id='"+_4f+"_RB' class='"+this.StylePrefix+Stl+"_R_B'></td>"+"</tr>"+"</table>";return R;};this.getItemsHTML=function(_54,_55,_56){var R="";var K="";var _59="";var _5a="";var _5b="";var _5c="";var _5d="";var i;var l=_54.Items.length;if(l>0){var Stl="SUB";var Stm="";var _62=true;if(_55){Stl="MAIN";if(_2=="left"){_62=true;}
if(_2=="right"){_62=true;}
if(_2=="top"){_62=false;}
if(_2=="bottom"){_62=false;}}
if(_4){var STA=" class='"+this.StylePrefix+Stl+"_ITEM_IE'";var STD="";}else{var STA=" class='"+this.StylePrefix+Stl+"_ITEM'";var STD=" class='"+this.StylePrefix+Stl+"_ITEM'";}
if(!_62){K=K+"<tr>";}
for(i=0;i<l;i++){_59=_56+"_Button"+i;_5a=_1+".TPageMenu"+_54.ObjectReference;if(_54.Items[i].Items.length>0){_5b="onmouseover='"+_1+".TPageMenu.mouseOverButton("+_5a+", "+_5a+".Items["+i+"], \""+_59+"\")' ";_5c="onmouseout='"+_1+".TPageMenu.mouseOutButton()' ";if(_2=="right"){_5d=" class='"+this.StylePrefix+Stl+"_ARROW_LEFT'";}else{if((_2=="top")&&_55){_5d=" class='"+this.StylePrefix+Stl+"_ARROW_DOWN'";}else{if((_2=="bottom")&&_55){_5d=" class='"+this.StylePrefix+Stl+"_ARROW_UP'";}else{_5d=" class='"+this.StylePrefix+Stl+"_ARROW_RIGHT'";}}}}else{_5b="onmouseover='"+_1+".TPageMenu.mouseOverButton("+_5a+", "+_5a+".Items["+i+"], \"NoSubMenu\")' ";_5d=" class='"+this.StylePrefix+Stl+"_ARROW_NONE'";}
if(_62){K=K+"<tr>";}
K=K+"<td name='"+_59+"' id='"+_59+"' "+_5b+_5c+"class='"+this.StylePrefix+Stl+"_ITEM'>"+"<a name='"+_59+"_A' id='"+_59+"_A' "+this.getHref(_54.Items[i])+STA+">"+"<div"+STD+"' name='"+_59+"_Div' id='"+_59+"_Div'>"+"<div"+_5d+">"+_54.Items[i].Caption+"</div>"+"</div>"+"</a>"+"</td>";if(_62){K=K+"</tr>";}}
if(!_62){K=K+"</tr>";}
if(_55&&_62){Stm="_V";}else{if(_55){Stm="_H";}}
R="<table border='0' cellspacing='0' cellpadding='0' class='"+this.StylePrefix+Stl+"_INNERTABLE"+Stm+"'>"+K+"</table>";}else{R="<span style='font-size: 1px; font-weight: normal;'>&nbsp;</span>";}
return R;};this.getHref=function(_65){if(_6&&(!_65.NoAjax)){return"href=\"javascript:"+_1+".TPageMenu.startRequest('"+_65.URL+"')\"";}else{return"href='"+_65.URL+"'";}};this.getShadowHTML=function(_66){var R="<table name='"+_66+"' id='"+_66+"' border='0' cellspacing='0' cellpadding='0' class='"+this.StylePrefix+"SHADOW_OUTERTABLE'>"+"<tr>"+"<td class='"+this.StylePrefix+"SHADOW_L_T'></td>"+"<td class='"+this.StylePrefix+"SHADOW_M_T'></td>"+"<td class='"+this.StylePrefix+"SHADOW_R_T'></td>"+"</tr>"+"<tr>"+"<td class='"+this.StylePrefix+"SHADOW_L_M'></td>"+"<td class='"+this.StylePrefix+"SHADOW_M_M'>&nbsp;</td>"+"<td class='"+this.StylePrefix+"SHADOW_R_M'></td>"+"</tr>"+"<tr>"+"<td class='"+this.StylePrefix+"SHADOW_L_B'></td>"+"<td class='"+this.StylePrefix+"SHADOW_M_B'></td>"+"<td class='"+this.StylePrefix+"SHADOW_R_B'></td>"+"</tr>"+"</table>";return R;};this.locateSubMenu=function(_68,_69){var X=0,Y=0;var _6c=document.getElementById(_68.SubMenuID);var _6d=document.getElementById(_68.ShadowID);if(_6c!=null){var _6e=this.getElementPosition(_1+"_TPageMenu_MainMenu");var _6f=this.getElementPosition(_69);var _70=this.getElementPosition(_68.SubMenuID);var _71=this.getElementPosition(_68.SubMenuID+"_LT");var _72=this.getElementPosition(_68.SubMenuID+"_RB");var _73=(_69.toString().search(_1+"_TPageMenu_MainMenu")==-1);var _74=Number(this.getElementStyle(_69,"padding-left").toString().replace(/([A-Z])/gi,""));var _75=this.getScreenSize();var _76=this.MenuSpacing;if(_73){_76=this.SubMenuSpacing;}
var _77=_6f.left-_70.width-_76;var _78=_6f.left+_6f.width+_76;var _79=_6f.left-_71.width+_74;var _7a=_6f.left+_6f.width-_70.width+_72.width;var _7b=_6f.top-_71.height;var _7c=_6f.top+_6f.height-(_70.height-_72.height);var _7d=_6f.top+_6f.height+_76;var _7e=_6f.top-_70.height-_76;_6c.style.position="absolute";if(_73){X=_78;if(_2=="right"){X=_77;}
Y=_7b;}else{if(_2=="left"){X=_78;Y=_7b;}else{if(_2=="right"){X=_77;Y=_7b;}else{if(_2=="top"){X=_79;Y=_7d;}else{if(_2=="bottom"){X=_79;Y=_7e;}}}}}
if((X+_70.width)>_75.width){if(_73){X=_77;}else{if((_2=="top")||(_2=="bottom")){X=_7a;}}}
if(X<0){X=_78;}
if(_73){if((Y+_70.height)>_75.height){Y=_7c;}
if(Y<0){Y=_7b;}}
if((_2=="left")&&(X<(_6e.left+_6e.width))){X=_78;}
if((_2=="right")&&((X+_70.width)>_6e.left)){X=_77;}
if((_2=="top")&&(Y<(_6e.top+_6e.height))&&_73){Y=_7b;}
if((_2=="bottom")&&((Y+_70.height)>_6e.top)&&_73){Y=_7c;}
_6c.style.left=X;_6c.style.top=Y;if(_6d!=null){_6d.style.position="absolute";_6d.style.left=X+this.ShadowOffsetX;_6d.style.top=Y+this.ShadowOffsetY;_6d.style.width=_70.width+"px";_6d.style.height=_70.height+"px";}}};this.getElementPosition=function(_7f){var _80=document.getElementById(_7f);if(_80!=null){var w=_80.offsetWidth;var h=_80.offsetHeight;var l=0;var t=0;while(_80){l+=_80.offsetLeft;t+=_80.offsetTop;_80=_80.offsetParent;}
return{"left":l,"top":t,"width":w,"height":h};}else{return{"left":0,"top":0,"width":0,"height":0};}};this.getElementStyle=function(_85,_86){var _87=document.getElementById(_85);var R="";if(_87!=null){if(document.defaultView&&document.defaultView.getComputedStyle){if(_86.match(/[A-Z]/)){_86=_86.replace(/([A-Z])/g,"-$1").toLowerCase();}
R=document.defaultView.getComputedStyle(_87,"").getPropertyValue(_86);}else{if(_87.currentStyle){var i;while((i=_86.indexOf("-"))!=-1){_86=_86.substr(0,i)+_86.substr(i+1,1).toUpperCase()+_86.substr(i+2);}
R=_87.currentStyle[_86];}}}
return R;};this.getScreenSize=function(){var w,h;w=(window.innerWidth?window.innerWidth:(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.offsetWidth));h=(window.innerHeight?window.innerHeight:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.offsetHeight));return{"width":w,"height":h};};this.startRequest=function(URL){if(!this.TAjaxLoad.IsLoading){this.TAjaxLoad.loadContentIn(URL,_7);}};};