// FONT SIZER VERSION 1.0
// Developed by fluidByte (http://www.fluidbyte.net)

// FONT SIZER VERSION 1.0
// Developed by fluidByte (http://www.fluidbyte.net)

function fontResizer(smallFont,medFont,largeFont)
{
function clearSelected() { $(".smallFont").removeClass("curFont"); $(".medFont").removeClass("curFont"); $(".largeFont").removeClass("curFont"); }
function saveState(curSize) {	var date = new Date(); date.setTime(date.getTime()+(7*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = "fontSizer"+"="+curSize+expires+"; path=/"; }

$(".smallFont").click(function(){ $('html').css('font-size', smallFont); clearSelected(); $(".smallFont").addClass("curFont"); saveState(smallFont); });

$(".medFont").click(function(){ $('html').css('font-size', medFont); clearSelected(); $(".medFont").addClass("curFont"); saveState(medFont); });

$(".largeFont").click(function(){ $('html').css('font-size', largeFont); clearSelected(); $(".largeFont").addClass("curFont"); saveState(largeFont); });

function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; }

var savedSize = getCookie('fontSizer');

if (savedSize!="") { $('html').css('font-size', savedSize); switch (savedSize) { case smallFont: $(".smallFont").addClass("curFont"); break; case medFont: $(".medFont").addClass("curFont"); break; case largeFont: $(".largeFont").addClass("curFont"); break; default: $(".medFont").addClass("curFont"); } }
else { $('html').css('font-size', medFont); $(".medFont").addClass("curFont"); }
}



$(document).ready(function() {
  fontResizer('12px','13px','15px');
});


/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////















// poprawić przełączanie dla stylów active
// poprawić pozycjonowanie poziome
// zrobić dodawanie kodu z funckji zdarzeń i modyfikacja funkcji, która to robi.

naw=navigator.appName;
naw2=navigator.userAgent;

explorer=null
explorer6=null;
firefox2=null
firefox1=null

konqueror=2;
if (naw2.indexOf("Firefox/2")!=-1) {firefox2=1;}
if (naw2.indexOf("Firefox/1")!=-1) {firefox1=1;}

// Okazało się po jakimś czasie, że są problemy z FF2
if (firefox1||firefox2) {
	document.writeln('<style type="text/css"><!--');
	document.writeln('	ul.menu2 li a {display: table;}');
	document.writeln('	ul.menu2 li a img {display: table-cell;border: 1px solid transparent;background: url("/images/poz_sluchawka.png") no-repeat;}');

	document.writeln('	ul.menu2 li + li a img {background-image: url("/images/poz_2_ludziki.png");}');
	document.writeln('	ul.menu2 li + li + li a img {background-image: url("/images/poz_koperta.png");background-position: 0px -1px}');
	document.writeln('	ul.menu2 li + li + li + li a img {background-image: url("/images/poz_kalkulator.png");background-position: 0px -2px}');

	document.writeln('	ul.menu2 li a i {display: table-cell;padding-left: 3px;padding-bottom: 3px;}');
	document.writeln('--></style>');
	
}








/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/



/*
ul.menu2 {margin: 0; padding: 0 0 20px 0;text-align: right;float: left;text-align: left;}
ul.menu2 li {display: inline;list-style: none;color: #e0003f;}
ul.menu2 li a {display: block; width: 178px; padding-left: 21px;margin: 0 0 6px 0;height: 42px;text-decoration: none;color: #e0003f;font: 11px Verdana;background: url("/images/pozyc_2.gif")}
ul.menu2 li a:hover {color: #e0003f;background: url("/images/pozyc_2.gif")}
ul.menu2 li a img {vertical-align:middle;position: relative}
ul.menu2 li a i {padding-left: 3px;vertical-align:middle;font-style: normal;display: inline-block;width: 130px;} 
*/



var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
var flashvars = {

};
var params = {
  wmode: "transparent",
  quality: "best"
};	
	
swfobject.embedSWF("images/ban.swf", "kredyty", "523", "165", "9.0.0", "expressInstall.swf", flashvars, params);
swfobject.embedSWF("images/partnerzy.swf", "partnerzy", "160", "100", "9.0.0", "expressInstall.swf", flashvars, params);
swfobject.embedSWF("../../images/partnerzy.swf", "partnerzy2", "160", "100", "9.0.0", "expressInstall.swf", flashvars, params);


















// poprawić przełączanie dla stylów active
// poprawić pozycjonowanie poziome
// zrobić dodawanie kodu z funckji zdarzeń i modyfikacja funkcji, która to robi.

naw=navigator.appName;
naw2=navigator.userAgent;

explorer=null
explorer6=null;
if (naw.indexOf("Explorer")!=-1 && naw2.indexOf("Opera")==-1) {explorer=1;}

if (explorer) {

document.writeln("<style type='text/css'><!--\n .cssMenu div div a {margin-bottom: -1px;}\n--></style>");

if (explorer) {if (naw2.indexOf("MSIE 6.0")!=-1) explorer6=1;}

if (explorer6) {document.writeln("<style type='text/css'><!--\n #specialDivHorizontal {width: 166px;}\n .cssMenu div a {overflow: hidden;}\n.content {height: 340px;}\n--></style>");}


}


horizontalMenu=0; // czy menu jest horyzontalne
menuClickVersion=0; // czy menu działa w systemie klikania, a nie najeżdzania myszką
stopScriptPositioning=0; // czy skrypt ustawia pozycję czy style to robią.
nowrap=1; // czy teksty mają być niełamliwe (gdy długość podmenu'ów jest nieustalona lepiej pozostawić na 1 lub, gdy menu jest pozycjonowane przez skrypt)

// poniższe dwa warunki są proste - domyślnie zalecane jest nieusuwanie ich
if (horizontalMenu) {stopScriptPositioning=0}
if (stopScriptPositioning) {menuClickVersion=1}

/*
 * DO NOT REMOVE THIS NOTICE
 *
 * PROJECT:   mygosuMenu
 * VERSION:   1.1.6
 * COPYRIGHT: (c) 2003,2004 Cezary Tomczak
 * LINK:      http://gosu.pl/dhtml/mygosumenu.html
 * LICENSE:   BSD (revised)
 */

/*
  Todo, bugs to fix:
  - delay.show = 400 , delay.hide = 400
    go Product Three -> Live Demo -> Test Drive -> Test Three , go fast to Product Four.
    Result: 2 elements highlighted in the same section
  - delay.show = 0 , delay.hide = 400
    go Product Three -> Live Demo , section out , section over, seciont out.
    Result: Live Demo is not highlighted
  - active className changing, unnecessary blink
  - opera: hideSection() exceptions are throwed
*/
if (navigator.appName.indexOf("Explorer")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {explorer=1;} else {explorer=0;}

document.collectionToAdd=new Array();
document.actCollectionNr=0;
itr=new Array();
itr2=new Array();
function addSubMenu(beforeNodesM, actSubMenu, firstItem, specIter) {
			nodesM=beforeNodesM.childNodes
			for (itr[specIter]=0;itr[specIter]<nodesM.length;itr[specIter]++) {
					if ((nodesM[itr[specIter]].nodeName.indexOf("text")+'')==-1) {
										 spanAsLi=document.createElement('a')
										 linkM=nodesM[itr[specIter]].getElementsByTagName('a')[0];							
          					 sectionM=nodesM[itr[specIter]].getElementsByTagName('ul')[0];
										 for (i2=0;i2<nodesM[itr[specIter]].attributes.length;i2++) {
												if (nodesM[itr[specIter]].attributes[i2].value!="null"&&nodesM[itr[specIter]].attributes[i2].value!="") {
													 	 spanAsLi.setAttribute(nodesM[itr[specIter]].attributes[i2].name, (nodesM[itr[specIter]].attributes[i2].value)); 
												}
            				 } // uwaga techniczna - przepisywanie atrybutów różnych znaczników (IE szczególnie)
										 
										 if (spanAsLi.getAttribute('disabled')) {spanAsLi.removeAttribute('disabled')}
      							 spanAsLi.style.display="block"
										 
										 
	    							 if (firstItem) {thisItem=1;} else {thisItem=2;}
										 
										 spanAsLi.className="item" + thisItem+" "+(nodesM[itr[specIter]].attributes['class']?nodesM[itr[specIter]].attributes['class'].value:'');
										 
										 spanAsLi.setAttribute('href',linkM.getAttribute('href'))
										 if (spanAsLi.getAttribute("href")=="#"||spanAsLi.className.indexOf("unLink")!=-1) {spanAsLi.setAttribute('href','javascript:void(0)')}
										 
										 
										 
										 if (horizontalMenu&&firstItem) {
										 spanAsLi.setAttribute('style',spanAsLi.getAttribute('style')+';float:left;')
										 if (explorer&&spanAsLi.runtimeStyle) {spanAsLi.runtimeStyle.cssText=spanAsLi.getAttribute('style')+";float:left"}
										 }
										 
										 if (linkM) {
      										 obL=document.createElement('span')
      										 for (i2=0;i2<linkM.attributes.length;i2++) {
															if (!linkM.attributes[i2].value!="null"&&linkM.attributes[i2].value!="") {obL.setAttribute(linkM.attributes[i2].name, (linkM.attributes[i2].value))}
													 }
      										 
													 if (obL.getAttribute('disabled')!="true") {obL.removeAttribute('disabled')}
													 obL.removeAttribute('href')
													 
													 obL.innerHTML=linkM.innerHTML 												 
      										 spanAsLi.appendChild(obL)
      										 actSubMenu.appendChild(spanAsLi)		 
													 obL.style.display="block"
													 
										 }			

      							 if (sectionM) {
												obD=document.createElement('div')
												for (i2=0;i2<sectionM.attributes.length;i2++) {
      											if (sectionM.attributes[i2].value!="null"&&sectionM.attributes[i2].value!="") obD.setAttribute(sectionM.attributes[i2].name, (sectionM.attributes[i2].value))
            						} //przepisanie atrybutów z ul do div
              			    
      									if (!stopScriptPositioning) {
												obD.style.position="absolute";
												} else {obD.style.display="none"}
												
												obD.style.visibility="hidden";
												obD.style.zIndex=-1;
												//if (explorer) obD.style.zoom=1 //usuwa to błąd wyświetlania w IE6

												obD.className="section"+" "+(sectionM.attributes['class']?sectionM.attributes['class'].value:''); 
      									actSubMenu.appendChild(obD) 
												
												if (sectionM.childNodes) {
													document.collectionToAdd[document.actCollectionNr]=new Array();
  												document.collectionToAdd[document.actCollectionNr][0]=sectionM
  												document.collectionToAdd[document.actCollectionNr++][1]=obD
  												document.incrNodesMa++;
      									}  
												if (obD.getAttribute('disabled')!="true") {obD.removeAttribute('disabled')}
										 } 
      							 
      	  }				 
			}

for (itr2[specIter]=0;itr2[specIter]<document.collectionToAdd.length;itr2[specIter]++) {
		
		if (!document.collectionToAdd[itr2[specIter]][2]||document.collectionToAdd[itr2[specIter]][2]!="done") {
    		document.collectionToAdd[itr2[specIter]][2]="done"
    		addSubMenu(document.collectionToAdd[itr2[specIter]][0],document.collectionToAdd[itr2[specIter]][1], 0, ++specIter)		
		} 
}

//addSubMenu(sectionM, obD)
return actSubMenu.innerHTML
}
document.zminnerr=''

intervalVar1=0;

adase=0

function getTrueProperty(element, property) {
return explorer?element.currentStyle[property]:(document.defaultView?document.defaultView.getComputedStyle(element, null).getPropertyValue(property):"");
}


function liOrDivToMenu() {
	if (!document.getElementById('cssMenu').nextSibling) {return} else {clearInterval(intervalV1);}
	objMenu=document.getElementById('cssMenu')
  cont=document.createElement('div')
	if (explorer) zoomIE=""; else {zoomIE=""} 
	cont.innerHTML="<table width='166px' cellspacing='0' cellpadding='0' id='menu1' style='width: 166px !important;' class='ddmx cssMenu'><tbody><tr><td><div id='specialDivHorizontal' style='"+zoomIE+"'></div></td></tr></tbody></table>"
	tx=".childNodes[0]"
	eval('mTD=cont'+tx+tx+tx+tx+tx); 
	
	if (objMenu.childNodes) {
  	 addSubMenu(objMenu,mTD, 1,0);
	}

	objMenu.style.display="none"
  linksTD=objMenu.getElementsByTagName('a')
		
	objMenu.parentNode.insertBefore(cont,objMenu)
	var ddmx = new DropDownMenuX('menu1');
  if (horizontalMenu) {ddmx.type = "horizontal";} else {ddmx.type = "vertical";}
  ddmx.delay.show = 0;
  ddmx.delay.hide = 400;
  ddmx.position.levelX.left = 0;
	ddmx.init();
	
	if (explorer&&!stopScriptPositioning) {
    	menuO4k=document.getElementById(ddmx.id).getElementsByTagName('a')
    	menu04array=new Array();
    	for (i=0;i<menuO4k.length;i++) {
        	if (menuO4k[i].className.indexOf('item2')!=-1) {
        		 menu04array[i]=menuO4k[i].offsetWidth
        	}
    	}
    
    	for (i=0;i<menuO4k.length;i++) {
        	if (menuO4k[i].className.indexOf('item2')!=-1) {
          	menuO4k[i].style.width="2000px";
      			menuO4k[i].style.width=menu04array[i]-(menuO4k[i].offsetWidth-2000)+'px';
        	}
    	}
    


    	menuO4k=document.getElementById(ddmx.id).getElementsByTagName('div')
    	for (i=0;i<menuO4k.length;i++) {
        	if (menuO4k[i].className.indexOf('section')!=-1) {
          	menuO4k[i].style.display="block";
          	menuO4k[i].style.display="none";
        	}
    	}
	
	
	}
	
}

// +----------------------------------------------------------------+
// | Array functions that are missing in IE 5.0                     |
// | Author: Cezary Tomczak [www.gosu.pl]                           |
// | Free for any use as long as all copyright messages are intact. |
// +----------------------------------------------------------------+

// Removes the last element from an array and returns that element.
if (!Array.prototype.pop) {
    Array.prototype.pop = function() {
        var last;
        if (this.length) {
            last = this[this.length - 1];
            this.length -= 1;
        }
        return last;
    };
}

// Adds one or more elements to the end of an array and returns the new length of the array.
if (!Array.prototype.push) {
    Array.prototype.push = function() {
        for (var i = 0; i < arguments.length; ++i) {
            this[this.length] = arguments[i];
        }
        return this.length;
    };
}

// Removes the first element from an array and returns that element.
if (!Array.prototype.shift) {
    Array.prototype.shift = function() {
        var first;
        if (this.length) {
            first = this[0];
            for (var i = 0; i < this.length - 1; ++i) {
                this[i] = this[i + 1];
            }
            this.length -= 1;
        }
        return first;
    };
}

// Adds one or more elements to the front of an array and returns the new length of the array.
if (!Array.prototype.unshift) {
    Array.prototype.unshift = function() {
        if (arguments.length) {
            var i, len = arguments.length;
            for (i = this.length + len - 1; i >= len; --i) {
                this[i] = this[i - len];
            }
            for (i = 0; i < len; ++i) {
                this[i] = arguments[i];
            }
        }
        return this.length;
    };
}

// Adds and/or removes elements from an array.
if (!Array.prototype.splice) {
    Array.prototype.splice = function(index, howMany) {
        var elements = [], removed = [], i;
        for (i = 2; i < arguments.length; ++i) {
            elements.push(arguments[i]);
        }
        for (i = index; (i < index + howMany) && (i < this.length); ++i) {
            removed.push(this[i]);
        }
        for (i = index + howMany; i < this.length; ++i) {
            this[i - howMany] = this[i];
        }
        this.length -= removed.length;
        for (i = this.length + elements.length - 1; i >= index + elements.length; --i) {
            this[i] = this[i - elements.length];
        }
        for (i = 0; i < elements.length; ++i) {
            this[index + i] = elements[i];
        }
        return removed;
    };
}

function DropDownMenuX(id) {

    /* Type of the menu: "horizontal" or "vertical" */
    if (horizontalMenu) {this.type = "horizontal";} else {this.type = "vertical";}

    /* Delay (in miliseconds >= 0): show-hide menu
     * Hide must be > 0 */
    if (menuClickVersion) {
    		this.delay = {
            "show": 0,
            "hide": 0
        }
		} else {
    		this.delay = {
            "show": 0,
            "hide": 400
        }
		}

    /* Change the default position of sub-menu by Y pixels from top and X pixels from left
     * Negative values are allowed */
    this.position = {
        "level1": { "top": 0, "left": 0},
        "levelX": { "top": 0, "left": 0}
    }

    /* fix ie selectbox bug ? */
    this.fixIeSelectBoxBug = true;

    /* Z-index property for .section */
    this.zIndex = {
        "visible": 500,
        "hidden": -1
		};

    // Browser detection
    this.browser = {
				"ie": Boolean(document.body.currentStyle),
        "ie5": (navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1),
        "ie6": (navigator.appVersion.indexOf("MSIE 6.0") != -1||navigator.appVersion.indexOf("MSIE 7") != -1),
    		"ie7": (navigator.appVersion.indexOf("MSIE 7") != -1)
		};
    
    if (!this.browser.ie) {
        this.browser.ie5 = false;
        this.browser.ie6 = false;
    }

    /* Initialize the menu */
    this.init = function() {
        if (!document.getElementById(this.id)) { return alert("DropDownMenuX.init() failed. Element '"+ this.id +"' does not exist."); }
        if (this.type != "horizontal" && this.type != "vertical") { return alert("DropDownMenuX.init() failed. Unknown menu type: '"+this.type+"'"); }
        if (this.browser.ie && this.browser.ie5) { fixWrap(); }
        fixSections();
				parse(document.getElementById(this.id).childNodes, this.tree, this.id);
    }

    /* Search for .section elements and set width for them */
    function fixSections() {
        var arr = document.getElementById(self.id).getElementsByTagName("div");
        var sections = new Array();
        var widths = new Array();
        
        for (var i = 0; i < arr.length; i++) {
            if (arr[i].className == "section") {
                sections.push(arr[i]);
            }
        }
        for (var i = 0; i < sections.length; i++) {
            widths.push(getMaxWidth(sections[i].childNodes));
        }
        for (var i = 0; i < sections.length; i++) {
            sections[i].style.width = (widths[i]) + "px";
        }
        if (self.browser.ie) {
            for (var i = 0; i < sections.length; i++) {
                setMaxWidth(sections[i].childNodes, widths[i]);
            }
        }
    }

    function fixWrap() {
        var elements = document.getElementById(self.id).getElementsByTagName("a");
        for (var i = 0; i < elements.length; i++) {
            if (/item2/.test(elements[i].className)) {
                elements[i].innerHTML = '<div>'+elements[i].innerHTML+'</div>';
            }
        }
    }

    /* Search for an element with highest width among given nodes, return that width */
    function getMaxWidth(nodes) {
        var maxWidth = 0;
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType != 1 || /section/.test(nodes[i].className)) { continue; }
            if (nodes[i].offsetWidth > maxWidth) { maxWidth = nodes[i].offsetWidth; }
        }
        return maxWidth;
    }

    /* Set width for item2 elements */
    function setMaxWidth(nodes, maxWidth) {
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType == 1 && /item2/.test(nodes[i].className) && nodes[i].currentStyle) {
                if (self.browser.ie5) {
                    nodes[i].style.width = (maxWidth) + "px";
                } else {
                    nodes[i].style.width = (maxWidth - parseInt(nodes[i].currentStyle.paddingLeft) - parseInt(nodes[i].currentStyle.paddingRight)) + "px";
                }
            }
        }
    }

		function blurItem() {
			this.blur()			 
		}
		
		document.theHighestItem1=0;
    /* Parse nodes, create events, position elements */
    function parse(nodes, tree, id) {
				for (var i = 0; i < nodes.length; i++) {
            if (1 != nodes[i].nodeType) {
                continue;
            }
						switch (true) {
                // .item1
                case /\bitem1\b/.test(nodes[i].className):
										nodes[i].id = id + "-" + tree.length;
                    tree.push(new Array());
										if (menuClickVersion) {
											nodes[i].onclick = itemOver
										}	else {
  										nodes[i].onmouseover = itemOver;
                      nodes[i].onmouseout = itemOut;
										}									
											nodes[i].onfocus = blurItem
										if (nowrap) {
											 nodes[i].style.whiteSpace="nowrap"
										}
										nodes[i].style.display="block"
										nodes[i].style.position="relative"
										
										
										break;
                // .item2
                case /\bitem2\b/.test(nodes[i].className):
										nodes[i].id = id + "-" + tree.length;
                    tree.push(new Array());
										
										if (menuClickVersion) {
											nodes[i].onclick = itemOver

											if (nodes[i].parentNode.previousSibling&&nodes[i].parentNode.previousSibling.nodeName=="A") {
													nodes[i].parentNode.previousSibling.setAttribute('href', 'javascript: void(0)')
											} else if (nodes[i].parentNode.previousSibling.previousSibling&&nodes[i].parentNode.previousSibling.previousSibling.nodeName=="A") {
													nodes[i].parentNode.previousSibling.previousSibling.setAttribute('href', 'javascript: void(0)')
											} 
											

										}	else {
  										nodes[i].onmouseover = itemOver;
                      nodes[i].onmouseout = itemOut;
										}									
											nodes[i].onfocus = blurItem

										if (nowrap) {
											nodes[i].style.whiteSpace="nowrap"
										}

										nodes[i].style.display="block"
										nodes[i].style.position="relative"
										nodes[i].style.zIndex=500;
										
										break;
                // .section
                case /\bsection\b/.test(nodes[i].className):
                    // id, events
                    nodes[i].id = id + "-" + (tree.length - 1) + "-section";
										if (menuClickVersion) {
											nodes[i].onclick = sectionOver
										}	else {
  										nodes[i].onmouseover = sectionOver;
                      nodes[i].onmouseout = sectionOut;
										}
										nodes[i].onfocus = blurItem
									
                    // position
										var box1 = document.getElementById(id + "-" + (tree.length - 1));
										var box2 = document.getElementById(nodes[i].id);
          				  var el = new Element(box1.id);

										
										//if (explorer) {box2.style.zoom="1";alert(box2.style.pixelWidth)}
    								if (!stopScriptPositioning) {
												if (1 == el.level) {
    											  if ("horizontal" == self.type) {
                                box2.style.top = box1.offsetTop + box1.offsetHeight + self.position.level1.top + "px";
                                if (self.browser.ie5) {
                                    box2.style.left = self.position.level1.left + "px";
                                } else {
                                    box2.style.left = box1.offsetLeft + self.position.level1.left + "px";
                                }
														} else if ("vertical" == self.type) {
                                box2.style.top = box1.offsetTop + self.position.level1.top+ "px";
                                if (self.browser.ie5) {
                                    box2.style.left = box1.offsetWidth + self.position.level1.left + "px";
                                } else {
                                    box2.style.left = box1.offsetLeft + box1.offsetWidth + self.position.level1.left + "px";
                                }
                            }
                        
    										} else {
    												if (navigator.appVersion.indexOf("MSIE 7") != -1) {
    													 box1.style.width="auto"
    												}
    
    												box2.style.top = box1.offsetTop + self.position.levelX.top+ "px";
                            box2.style.left = box1.offsetLeft+ box1.offsetWidth + self.position.levelX.left + "px";
    										}
                   }	
										// sections, sectionsShowCnt, sectionsHideCnt
                    self.sections.push(nodes[i].id);
                    self.sectionsShowCnt.push(0);
                    self.sectionsHideCnt.push(0);
                    if (!stopScriptPositioning&&self.fixIeSelectBoxBug && self.browser.ie6) {
                        nodes[i].innerHTML = nodes[i].innerHTML + '<iframe id="'+nodes[i].id+'-iframe" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; top: 0px; left: 0px; display: none; filter:alpha(opacity=0);"></iframe>';
                    }
                    break;
            }
            if (nodes[i].childNodes) {
                if (/\bsection\b/.test(nodes[i].className)) {
                    parse(nodes[i].childNodes, tree[tree.length - 1], id + "-" + (tree.length - 1));
                } else {
                    parse(nodes[i].childNodes, tree, id);
                }
            }
        }
		}

    /* event, item:onmouseover */
    function itemOver() {
	    zezwol=false;
	    lockforonce=true
	     restoreSectionStyles()
  		if (menuClickVersion) {
    			if (!this.parentNode) return
    					if (this.nextSibling&&this.nextSibling.nodeName=="DIV") {
    					   itemObjV=this.nextSibling
    				} else {
      					 if (this.nextSibling&&this.nextSibling.nextSibling&&this.nextSibling.nodeName!="A"&&this.nextSibling.nextSibling.nodeName=="DIV") {
      					 		itemObjV=this.nextSibling.nextSibling;
      					 } else {
      					 	 	itemObjV=null
      					 }
    				} 
    
    				if (itemObjV&&getTrueProperty(itemObjV, "visibility")=="visible") {
    					 itemObjV.style.visibility="hidden";
    					 itemObjV.style.display="none"
							 if (menuClickVersion) {
  							  if (/item\d-active/.test(this.className)) {
      								this.className = this.className.replace(/(item\d)-active/, "$1");
      								if (this.className.indexOf('specialseparator624')!=-1) this.className=this.className.substring(0,(this.className.indexOf('specialseparator624')-1))
  								}
							 }
							 
    					 sections=itemObjV.getElementsByTagName('div')
    					 for (itm=0;itm<sections.length;itm++) {
    							if (sections[itm].className.indexOf('section')!=-1) {sections[itm].style.visibility="hidden"}
    					 }
    					 return
    				} else {
    					 itemOver(null, this)
    					 if (menuClickVersion) {
  							 if (!/item\d-active/.test(this.className)) {
  				    	 		this.className = this.className.replace(/(item\d)/, "$1-active")+activeClasses(this);
  							    this.blockOnce=1
								 } else this.blockOnce=0;
								 
							 }
							 if (itemObjV) {
    					 sections=itemObjV.getElementsByTagName('div')
    					 itemObjV.style.visibility="visible"
    					 itemObjV.style.display="block"
    					 for (itm=0;itm<sections.length;itm++) {
    					 		if (sections[itm].className.indexOf('section')!=-1) {sections[itm].style.visibility="hidden"}
    					 }
    					 }
    				}
  			}	
				//debug("itemOver("+this.id+") , visible = " + self.visible);
        self.itemShowCnt++;
        var id_section = this.id + "-section";
        if (self.visible.length&&!this.blockOnce) {
            
						var el = new Element(self.visible.getLast());
            el = document.getElementById(el.getParent().id);
            if (/item\d-active/.test(el.className)) {
								el.className = el.className.replace(/(item\d)-active/, "$1");
								if (el.className.indexOf('specialseparator624')!=-1) el.className=el.className.substring(0,(el.className.indexOf('specialseparator624')-1))
						}
        }
        if (self.sections.contains(id_section)) {
            clearTimers();
            self.sectionsHideCnt[self.sections.indexOf(id_section)]++;
            var cnt = self.sectionsShowCnt[self.sections.indexOf(id_section)];
            var timerId = setTimeout(function(a, b) { return function() { self.showSection(a, b); } } (id_section, cnt), self.delay.show);
            self.timers.push(timerId);
        } else {
            if (self.visible.length) {
                clearTimers();
                var timerId = setTimeout(function(a, b) { return function() { self.showItem(a, b); } } (this.id, self.itemShowCnt), self.delay.show);
                self.timers.push(timerId);
            }
        }
    }

    /* event, item:onmouseout */
    function itemOut() {

				//debug("itemOut("+this.id+") , visible = " + self.visible);
        self.itemShowCnt++;
        var id_section = this.id + "-section";
        if (self.sections.contains(id_section)) {
            self.sectionsShowCnt[self.sections.indexOf(id_section)]++;
            if (self.visible.contains(id_section)) {
                var cnt = self.sectionsHideCnt[self.sections.indexOf(id_section)];
                var timerId = setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(id_section, cnt), self.delay.hide);
                self.timers.push(timerId);
            }
        }
    }

    /* event, section:onmouseover */

		function activeClasses(objectWithCl) {
  		firstClasses = objectWithCl.className.split(" ");
  		newClassName=' specialseparator624 '
  		for (te=1;te<firstClasses.length;te++) {
    		if (te==(firstClasses.length-1)) additionalSpace=""; else {additionalSpace=" "}
    		newClassName+=firstClasses[te]+"-active"+additionalSpace;
  		}
		  return newClassName;
		}
		
    function sectionOver() {
				//debug("sectionOver("+this.id+") , visible = " + self.visible);
        self.sectionsHideCnt[self.sections.indexOf(this.id)]++;
        var el = new Element(this.id);
        var parent = document.getElementById(el.getParent().id);
        if (!/item\d-active/.test(parent.className)) {
				    parent.className = parent.className.replace(/(item\d)/, "$1-active")+activeClasses(parent);
				}
		}

    /* event, section:onmouseout */
    function sectionOut() {
        //debug("sectionOut("+this.id+") , visible = " + self.visible);
        self.sectionsShowCnt[self.sections.indexOf(this.id)]++;
        var cnt = self.sectionsHideCnt[self.sections.indexOf(this.id)];
        var timerId = setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(this.id, cnt), self.delay.hide);
        self.timers.push(timerId);
		}

    /* Show section (1 argument passed)
     * Try to show section (2 arguments passed) - check cnt with sectionShowCnt */
    this.showSection = function(id, cnt) {
				if (typeof cnt != "undefined") {
            if (cnt != this.sectionsShowCnt[this.sections.indexOf(id)]) { return; }
        }
        //debug("showSection("+id+", "+cnt+") , visible = " + this.visible);
        this.sectionsShowCnt[this.sections.indexOf(id)]++;
        if (this.visible.length) {
            if (id == this.visible.getLast()) { return; }
            var el = new Element(id);
            var parents = el.getParentSections();
            //debug("getParentSections("+el.id+") = " + parents);
            for (var i = this.visible.length - 1; i >= 0; i--) {
                if (parents.contains(this.visible[i])) {
                    break;
                } else {
                    this.hideSection(this.visible[i]);
                }
            }
        }
        var el = new Element(id);
				var parent = document.getElementById(el.getParent().id);
        if (!/item\d-active/.test(parent.className)) {
            parent.className = parent.className.replace(/(item\d)/, "$1-active")+activeClasses(parent);
				}
        if (document.all) { document.getElementById(id).style.display = "block"; }
        document.getElementById(id).style.visibility = "visible";
        document.getElementById(id).style.display = "block";
        document.getElementById(id).style.zIndex = this.zIndex.visible;
        if (!stopScriptPositioning&&this.fixIeSelectBoxBug && this.browser.ie6) {
            var div = document.getElementById(id);
            var iframe = document.getElementById(id+"-iframe");
            
						if (isNaN(div.currentStyle.borderLeftWidth)) {borL=0;} else {borL=div.currentStyle.borderLeftWidth}
						if (isNaN(div.currentStyle.borderRightWidth)) {borR=0;} else {borR=div.currentStyle.borderRightWidth}
						if (isNaN(div.currentStyle.borderTopWidth)) {borT=0;} else {borT=div.currentStyle.borderTopWidth}
						if (isNaN(div.currentStyle.borderBottomWidth)) {borB=0;} else {borB=div.currentStyle.borderBottomWidth}
						
						iframe.style.width = div.offsetWidth + parseInt(borL) + parseInt(borR);
            iframe.style.height = div.offsetHeight + parseInt(borT) + parseInt(borB);
            iframe.style.top = -parseInt(borT);
            iframe.style.left = -parseInt(borL);
            iframe.style.zIndex = div.style.zIndex - 1;
            iframe.style.display = "block";
        }
        this.visible.push(id);
    }

    /* Emulating an empty non-existent section, we have to hide elements, works like showSection() */
    this.showItem = function(id, cnt) {
        if (typeof cnt != "undefined") {
            if (cnt != this.itemShowCnt) { return; }
        }
        this.itemShowCnt++;
        if (this.visible.length) {
            var el = new Element(id + "-section");
            var parents = el.getParentSections();
            //debug("showItem() getParentSections("+el.id+") = " + parents);
            for (var i = this.visible.length - 1; i >= 0; i--) {
                if (parents.contains(this.visible[i])) {
                    break;
                } else {
                    this.hideSection(this.visible[i]);
                }
            }
        }
    }

    /* Hide section (1 argument passed)
     * Try to hide section (2 arguments passed) - check cnt with sectionHideCnt */
    this.hideSection = function(id, cnt) {
        if (typeof cnt != "undefined") {
            if (cnt != this.sectionsHideCnt[this.sections.indexOf(id)]) { return; }
            if (id == this.visible.getLast()) {
                //debug("hideSectionAll("+id+", "+cnt+") , visible = " + this.visible);
                for (var i = this.visible.length - 1; i >= 0; i--) {
                    this.hideSection(this.visible[i]);
                }
                return;
            }
        
				}
				//debug("hideSection("+id+", "+cnt+") , visible = " + this.visible);
        var el = new Element(id);
        var parent = document.getElementById(el.getParent().id);
        if (/item\d-active/.test(parent.className)) {
            parent.className = parent.className.replace(/(item\d)-active/, "$1");
						if (parent.className.indexOf('specialseparator624')!=-1) parent.className=parent.className.substring(0,(parent.className.indexOf('specialseparator624')-1))
        }
        document.getElementById(id).style.zIndex = this.zIndex.hidden;
        document.getElementById(id).style.visibility = "hidden";
        document.getElementById(id).style.display = "none";
        if (document.all) { document.getElementById(id).style.display = "none"; }
        if (!stopScriptPositioning&&this.fixIeSelectBoxBug && this.browser.ie6) {
            var iframe = document.getElementById(id+"-iframe");
            iframe.style.display = "none";
        }
        if (this.visible.contains(id)) {
            if (id == this.visible.getLast()) {
                this.visible.pop();
            } else {
                //throw "DropDownMenuX.hideSection('"+id+"', "+cnt+") failed, trying to hide a section that is not the deepest visible section";
                return;
            }
        } else {
            //throw "DropDownMenuX.hideSection('"+id+"', "+cnt+") failed, cannot hide element that is not visible";
            return;
        }
        this.sectionsHideCnt[this.sections.indexOf(id)]++;
    }

    /* Element (.section, .item2 etc) */
    function Element(id) {
				this.menu = self;
        this.id = id;
        /* Get Level of given id
         * Examples: menu-1 (1 level), menu-1-4 (2 level) */
        this.getLevel = function() {
            var s = this.id.substr(this.menu.id.length);
            return s.substrCount("-");
        }

        /* Get parent Element */
        this.getParent = function() {
            var s = this.id.substr(this.menu.id.length);
            var a = s.split("-");
            a.pop();
            return new Element(this.menu.id + a.join("-"));
        }

        /* Check whether an element has a parent element */
        this.hasParent = function() {
            var s = this.id.substr(this.menu.id.length);
            var a = s.split("-");
            return a.length > 2;
        }

        /* Check whether an element has a sub-section */
        this.hasChilds = function() {
            return Boolean(document.getElementById(this.id + "-section"));
        }

        /* Get parent section elements for current section */
        this.getParentSections = function() {
            var s = this.id.substr(this.menu.id.length);
            s = s.substr(0, s.length - "-section".length);
            var a = s.split("-");
            a.shift();
            a.pop();
            var s = this.menu.id;
            var parents = [];
            for (var i = 0; i < a.length; i++) {
                s += ("-" + a[i]);
                parents.push(s + "-section");
            }
            return parents;
        }
        
        this.level = this.getLevel();
    }

    /* Clear all timers set with setTimeout() */
    function clearTimers() {
        for (var i = self.timers.length - 1; i >= 0; i--) {
            clearTimeout(self.timers[i]);
            self.timers.pop();
        }
    }

    var self = this;
    this.id = id; /* menu id */
    this.tree = []; /* tree structure of menu */
    this.sections = []; /* all sections, required for timeout */
    this.sectionsShowCnt = [];
    this.sectionsHideCnt = [];
    this.itemShowCnt = 0;
    this.timers = []; // timeout ids
    this.visible = []; /* visible section, ex. Array("menu-0-section", ..) , succession is important: top to bottom */
}

/* Finds the index of the first occurence of item in the array, or -1 if not found */
if (typeof Array.prototype.indexOf == "undefined") {
    Array.prototype.indexOf = function(item) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] === item) {
                return i;
            }
        }
        return -1;
    }
}

/* Check whether array contains given string */
if (typeof Array.prototype.contains == "undefined") {
    Array.prototype.contains = function(s) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] === s) {
                return true;
            }
        }
        return false;
    }
}

/* Counts the number of substring occurrences */
if (typeof String.prototype.substrCount == "undefined") {
    String.prototype.substrCount = function(s) {
        return this.split(s).length - 1;
    }
}

/* Get the last element from the array */
if (typeof Array.prototype.getLast == "undefined") {
    Array.prototype.getLast = function() {
        return this[this.length-1];
    }
}


intervalV1=setInterval("liOrDivToMenu()",100);












// special functions repairing dropdownmenuX when we move fast from off one item onto another and onto outside the menu
// it isn't sometimes able to register the fact of moving on that second item (mouse over) what causes section not to dissapear as it should
// when we are outside all menu
// watch out above that lockforonce variable in the itemOver function becouse every time you mouseover any item just after this event there is invoked
// that of document body onmouseover - it should work just after that event



document.onmouseover= function() {
	if (lockforonce==true) {
		lockforonce=false;return;
	};
	zezwol=true;
	setTimeout('maniponsecions()',1000)
}

lockforonce=true;
countercounterr=0;
countercounterr2=0;

function restoreSectionStyles() {

		wszys=document.getElementById('menu1').getElementsByTagName('*')
		for (i=0;i<wszys.length;i++) {
			if (wszys[i].className.substring(0,7)=="section") {wszys[i].className="section";
				wszys[i].style.width="auto";
				wszys[i].style.overflow="visible";
			}

			if (wszys[i].id.substring(0,7)=="section") {wszys[i].className="section";
				wszys[i].style.width="auto";
				wszys[i].style.overflow="visible";
			}
		}


}

zezwol=true;
function maniponsecions() {

	if (zezwol!=false && document.getElementById('menu1')) {
		wszys=document.getElementById('menu1').getElementsByTagName('*')
		for (i=0;i<wszys.length;i++) {
			if (wszys[i].className.substring(0,5)=="item1") {wszys[i].className="item1";}
			if (wszys[i].className.substring(0,5)=="item2") {wszys[i].className="item2";}
			if (wszys[i].className.substring(0,7)=="section") {wszys[i].className="section";
				wszys[i].style.width="0px";;
				wszys[i].style.overflow="hidden";;
			}
			if (wszys[i].className.indexOf("-active")!=-1) {wszys[i].className=wszys[i].className.substring(0, wszys[i].className.indexOf("-active"));}

			if (wszys[i].id.substring(0,5)=="item1") {wszys[i].className="item1";}
			if (wszys[i].id.substring(0,5)=="item2") {wszys[i].className="item2";}
			if (wszys[i].id.substring(0,7)=="section") {wszys[i].className="section";;}
			if (wszys[i].id.indexOf("-active")!=-1) {wszys[i].className=wszys[i].className.substring(0, wszys[i].className.indexOf("-active"));}
		}
		
	}
}



















