/*
========================================
 Horizontal First-Level Sub Menus v1.0
 Add-on for SmartMenus v6.0+
========================================
 (c)2008 ET VADIKOM-VASIL DINKOV
========================================
*/


c_horizontal_subs={}; // do not remove this line

c_horizontal_subs['Menu1']=[ // Apply the add-on for the menu tree with id="Menu1"
'FLSubs',	// CSS Class for the first-level sub menus (one of the defined in section 2 of the config file)
'default',	// Alignment for the first-level sub menus ('default','left','center-to-container','center-to-parent-item','right')
0,		// X SubMenuOffset (pixels)
2		// Y SubMenuOffset
];


// ===
c_adH={};c_adH.fL=function(u){var l=u.firstChild;while(c_nN(l)!="LI")l=l.nextSibling;return l};c_adH.lL=function(u){var l=u.lastChild;while(c_nN(l)!="LI")l=l.previousSibling;return l};c_adH.sI=function(a){c_sC(a,'INACTIVE')};c_adH.rI=function(a){a.className=(" "+a.className).replace(/\sINACTIVE/,"").substring(1)};c_adH.S=function(){var i,u,l,a;for(i in c_horizontal_subs){u=c_horizontal_subs[i][5];if(u){l=u.parentNode;c_S[1]=l.parentNode;a=c_gA(l);if(u.style.display!="block"){c_mV();c_c=a;c_sM(1);if(c_keepHighlighted)a.className=a.CN}c_adH.rI(a)}}};c_adH.H=function(l,u){var U=c_horizontal_subs[u.MM][5];if(U&&U.style.display=="block"&&U.parentNode!=l){c_adH.hM(U);c_adH.sI(c_gA(U.parentNode))}};c_adH.iM=c_iM;c_iM=function(m,r){var H=c_horizontal_subs[m];if(!H){c_adH.iM(m,r);return}r.ADHR=1;var i,u,us,p,l,fl,ll,a,S,C,s,U=[];fl=c_r?c_adH.lL(r):c_adH.fL(r);ll=c_r?c_adH.fL(r):c_adH.lL(r);c_sC(ll,"NOSEPARATOR");r.style.height=fl.offsetHeight+'px';H[4]=r.offsetWidth;if(fl.offsetTop==ll.offsetTop){var L=[],w,d,k;l=c_r?ll:fl;L[0]=l;while(l){if(c_nN(l)=="LI")L[L.length]=l;l=l.nextSibling}w=ll.offsetLeft+ll.offsetWidth-fl.offsetLeft;d=parseInt((H[4]-w)/L.length);k=(H[4]-w)%L.length;for(i=0;i<L.length;){var a=c_gA(L[i++]).firstChild;a.style.width=a.offsetWidth+d+(k-->0?1:0)+'px'}}us=c_gT(r,"ul");for(i=0;i<us.length;){u=us[i++];u.LV=2;p=u.parentNode.parentNode;while(p!=r){u.LV++;p=p.parentNode.parentNode}if(u.LV==2){u.ADH=1;U[U.length]=u;if(!u.className)u.className=H[0];u=u.style;u.left="-10000px";u.width=H[4]+"px";u.borderWidth='0';u.padding='0';u.backgroundColor='transparent';u.backgroundImage='none'}else if(u.LV==3&&!u.className){u.className=c_menus[m][1][5]}}c_adH.iM(m,r);for(i=0;i<U.length;){u=U[i++];l=c_adH.fL(u);if(c_r)c_sC(l,"NOSEPARATOR");while(l){if(c_nN(l)=="LI"){a=c_gA(l);a.ADH=1;C=c_styles[u.className][1];s="float:"+(c_r?"right":"left")+";width:auto;border-width:0 "+(C[18]=="transparent"?0:C[16])+"px 0 0;padding:0 "+(C[16]>0?C[18]=="transparent"?C[19]*2+C[16]:C[19]:0)+"px 0 0;margin:0 "+(C[16]>0&&C[18]!="transparent"?C[19]:0)+"px 0 0;";if(c_iEWo||c_iEMn)l.runtimeStyle.cssText=s;else c_iE?l.style.cssText=s:l.setAttribute("style",s);S=a.style;S.whiteSpace="nowrap";if(c_iEW){S.height="auto";if(c_iEWo&&!c_r)S.position="relative"}if(c_iEM)S.styleFloat=c_r?"right":"left"}l=l.nextSibling}if(c_r){l=c_gL(a);l.className=(" "+l.className).replace(/\sNOSEPARATOR/,"").substring(1)}}l=r.firstChild;while(l){if(c_nN(l)=="LI"&&l.SH){a=c_gA(l);if(a.className&&/CURRENT/.test(a.className)){H[5]=c_gT(l,"ul")[0];break}}l=l.nextSibling}c_adH.S()};c_adH.pA=c_pA;c_pA=function(a,C,r,h,l){if(!l&&a.ADH)l=1;c_adH.pA(a,C,r,h,l)};c_adH.pM=c_pM;c_pM=function(u){var h=u.parentNode.parentNode.ADH;if(h){var H,M,x,y,a;H=c_horizontal_subs[u.MM];M=c_menus[u.MM][1];x=M[0];y=M[1];a=c_gA(u.parentNode);M[0]=-H[2]+a.offsetWidth;M[1]=H[3]+a.offsetHeight}c_adH.pM(u);if(h){M[0]=x;M[1]=y}};c_adH.hM=c_hM;c_hM=function(o,f,h){if(o.ADH&&!h){var a=c_gA(o.parentNode);if(a.className&&/CURRENT/.test(a.className))return}c_adH.hM(o,f)};c_adH.sM=c_sM;c_sM=function(c){var l,u;l=c_gL(c_c);u=l.parentNode;if(u.ADHR){c_adH.H(l,u);var kW=c_kW;c_kW=function(){return {x:0,y:0}}}c_adH.sM(c);if(u.ADHR)c_kW=kW};c_adH.sH=c_sH;c_sH=function(u){if(u.ADH){var w,H,S,fl,ll,l,a,x,X;H=c_horizontal_subs[u.MM];w=H[4];S=u.style;S.width=w+"px";fl=c_r?c_adH.lL(u):c_adH.fL(u);ll=c_r?c_adH.fL(u):c_adH.lL(u);if(fl.offsetTop==ll.offsetTop){w=ll.offsetLeft+ll.offsetWidth-fl.offsetLeft;S.width=w+"px"}l=u.parentNode;a=c_gA(l);if(H[1]!="default"){x=l.offsetLeft-(c_r?c_adH.lL(l.parentNode):c_adH.fL(l.parentNode)).offsetLeft;switch(H[1]){case "left":X=-x;break;case "center-to-container":X=parseInt((H[4]-w)/2)-x;break;case "center-to-parent-item":X=-parseInt((w-a.offsetWidth)/2);if(X<-x)X=-x;else if(X>H[4]-w-x)X=H[4]-w-x;break;default:X=H[4]-w-x}if(c_nS){S.marginLeft=X+"px"}else{S.left=X+"px";if(c_F[0]){var ifr=u.previousSibling.style;ifr.left=X+"px";ifr.width=w+"px"}}}c_adH.rI(a)}c_adH.sH(u)};c_adH.hD=c_hD;c_hD=function(u){c_adH.hD();c_adH.S()}
