function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
 * DO NOT REMOVE THIS NOTICE
 *
 * PROJECT:   mygosuMenu
 * VERSION:   1.1.3
 * COPYRIGHT: (c) 2003,2004 Cezary Tomczak
 * LINK:      http://gosu.pl/software/mygosumenu.html
 * LICENSE:   BSD (revised)
 */

var menuTimeout = 400;
var menuOffsetWidth = 0;
var menuOffsetHeight = -1;

var menuId = 'menu';
var menuTree = new Array();
var menuSections = new Array();
var menuSectionsCountHide = new Array();
var menuSectionsVisible = new Array();

var menuBrowser = navigator.userAgent.toLowerCase();
var menuBrowserIsOpera = menuBrowser.indexOf('opera') != -1;
var menuBrowserIsIE = menuBrowser.indexOf('msie') != -1 && !menuBrowserIsOpera;
//alert(navigator.userAgent);
    
function menuInit() {
    menuMakeIds(document.getElementById(menuId).childNodes, menuTree, menuId, 0, 0, 0);
    for (var i = 0; i < menuSections.length; i++) {
        menuSectionsCountHide[menuSections[i]] = 0;
    }
    for (var i = 0; i < menuSections.length; i++) {
        menuInitSection(menuSections[i], menuGetTreeById(menuSections[i]));
    }
}

function menuMakeIds(nodes, tree, id, lastOW, lastBLW, lastBRW) {
    for (var i = 0; i < nodes.length; i++) {
        switch (nodes[i].className) {
            case "top":
            case "box-right":
                id = id + "-" + tree.length;
                nodes[i].id = id;
                if (menuBrowserIsIE && document.compatMode && document.compatMode != "BackCompat") {
                    if (nodes[i].className == "box-right" && nodes[i].currentStyle) {
                        var tmp;
                        tmp = lastBLW + lastBRW;
                        if (tmp) {
                            tmp = Math.floor(tmp / 2) + 1;
                        }
                        nodes[i].style.width = lastOW - ( parseInt(nodes[i].currentStyle.paddingLeft) + parseInt(nodes[i].currentStyle.paddingRight) ) - tmp;
                    }
                }
                tree[tree.length] = new Array();
                tree = tree[tree.length - 1];
                break;
            case "box":
                nodes[i].id = id + "-" + tree.length;
                tree[tree.length] = new Array();
                break;
        }
        var className = new String(nodes[i].className);
        if (menuBrowserIsIE && !(document.compatMode && document.compatMode != "BackCompat")) {
            if (className == "box" || className == "box-hover") {
                nodes[i].style.width = "100%";
            }
        }
        if (className == "section") {
            if (!menuBrowserIsIE) {
                nodes[i].style.width = "100%";
            }
            nodes[i].style.left = (lastOW + menuOffsetWidth) + "px";
            nodes[i].style.top = menuOffsetHeight + "px";
        }
        if (className.substr(0, 7) == "section") {
            menuSections[menuSections.length] = id;
            nodes[i].id = id + "-section";
            lastOW = nodes[i].offsetWidth;
            if (nodes[i].currentStyle) {
                lastBLW = parseInt(nodes[i].currentStyle.borderLeftWidth);
                lastBRW = parseInt(nodes[i].currentStyle.borderRightWidth);
            }
        }
        if (nodes[i].childNodes) {
            menuMakeIds(nodes[i].childNodes, tree, id, lastOW, lastBLW, lastBRW);
        }
    }
}

function menuInitSection(id_section, tree) {
    eval("document.getElementById('"+id_section+"').onmouseover = function() {"+
        "menuShow('"+id_section+"');"+
        "if (document.getElementById('"+id_section+"').className == 'box-right') {"+
            "document.getElementById('"+id_section+"').className = 'box-right-hover';"+
        "}"+
    "}");
    eval("document.getElementById('"+id_section+"').onmouseout = function() {"+
        "setTimeout(\"menuTryHide('"+id_section+"', \"+menuSectionsCountHide['"+id_section+"']+\")\", menuTimeout);"+
        "if (document.getElementById('"+id_section+"').className == 'box-right-hover') {"+
            "document.getElementById('"+id_section+"').className = 'box-right';"+
        "}"+
    "}");
    for (var i = 0; i < tree.length; i++) {
        var id = id_section + "-" + i;
        if (tree[i].length == 0) {
            eval("document.getElementById('"+id+"').onmouseover = function() {"+
                "menuShow('"+id_section+"');"+
                "document.getElementById('"+id+"').className = 'box-hover';"+
            "}");
            eval("document.getElementById('"+id+"').onmouseout = function() {"+
                "setTimeout(\"menuTryHide('"+id_section+"', \"+menuSectionsCountHide['"+id_section+"']+\")\", menuTimeout);"+
                "document.getElementById('"+id+"').className = 'box';"+
            "}");
        }
    }
}

function menuShow(id_section) {
    var sections = menuGetIdParentsArrById(id_section, true);
    for (var i = 0; i < sections.length; i++) {
        menuSectionsCountHide[sections[i]]++;
    }
    for (var i = 0; i < menuSectionsVisible.length; i++) {
        if (!menuArrayContains(sections, menuSectionsVisible[i])) {
            menuHide(menuSectionsVisible[i]);
        }
    }
    document.getElementById(id_section + "-section").style.zIndex = 1;
    document.getElementById(id_section + "-section").style.visibility = 'visible';
    menuSectionsVisible = sections;
}

function menuTryHide(id_section, count) {
    if (count == menuSectionsCountHide[id_section]) {
        var sections = menuGetIdParentsArrById(id_section, true);
        if (menuArraysEqual(sections, menuSectionsVisible)) {
            for (var i = 0; i < sections.length; i++) {
                menuHide(sections[i]);
            }
        } else {
            menuHide(id_section);
        }
    }
}

function menuHide(id_section) {
    document.getElementById(id_section + "-section").style.visibility = 'hidden';
    document.getElementById(id_section + "-section").style.zIndex = -1;
}

function menuGetTreeById(id) {
    var a = id.split("-");
    a.shift();
    var s = "";
    for (var i = 0; i < a.length; i++) {
        s += ("[" + a[i] + "]");
    }
    return eval("menuTree" + s);
}

function menuGetIdParentsArrById(id, includeSelf) {
    var a = id.split("-");
    var ret = new Array();
    if (includeSelf) {
        ret[ret.length] = id;
    }
    while (a.length > 2) {
        a.pop();
        ret[ret.length] = a.join("-");
    }
    return ret;
}

function menuArrayContains(a, s) {
    var found = false;
    for (var i = 0; i < a.length; i++) {
        if (a[i] == s) {
            found = true;
            break;
        }
    }
    return found;
}

function menuArraysEqual(a1, a2) {
    if (a1.length != a2.length) {
        return false;
    }
    for (var i = 0; i < a1.length; i++) {
        if (a1[i] != a2[i]) {
            return false;
        }
    }
    return true;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function ShowHide(id, visibility) {
    obj = document.getElementsByTagName("div");
    obj[id].style.visibility = visibility;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function flvFTSS4(){//v1.04
this.style.filter="";}

function flvFTSS3(){//v1.04
var v1=arguments,v2=v1[0],v3=MM_findObj(v2);if (v3&&v3.TSS1!=null){clearTimeout(v3.TSS1);}}

function flvFTSS2(){//v1.04
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4=v1[1],v5=v1[2],v6,v7,v8,v9,v10,v11,v12=document;if (v3&&v3.TSS6){flvFTSS3(v2);v9="flvFTSS2('"+v2+"',"+v4+","+v5+")";if (v4==1){if (!v3.TSS4.complete){v3.TSS1=setTimeout(v9,50);return;}v6=v3.TSS8+1;if (v6>v3.TSS6.length-1){if (v3.TSS9==0){return;}else {v6=0;}}else if (v6<v3.TSS6.length-1){v3.TSS4=new Image();v3.TSS4.src=v3.TSS6[v6+1][0];}}else {if (!v3.TSS2.complete){v3.TSS1=setTimeout(v9,50);return;}v6=v3.TSS8-1;if (v6<0){if (v3.TSS9==0){return;}else {v6=v3.TSS6.length-1;}}else if (v6>0){v3.TSS2=new Image();v3.TSS2.src=v3.TSS6[v6-1][0];}}v10=v3.TSS6[v6][0];v11=v3.TSS6[v6][1];v7=(v3.filters&&!v12.TSS5&&v11<25);if (v7){if (v3.filters[0]&&v3.filters[0].status==2){v3.filters[0].Stop();}if (v11==0){v8="blendTrans(Duration="+v3.TSS7+")";}else {v8="revealTrans(Duration="+v3.TSS7+",Transition="+(v11-1)+")";}v3.style.filter=v8;v3.onfilterchange=flvFTSS4;v3.filters[0].Apply();}v3.src=v10;if (v7){v3.filters[0].Play();}v3.TSS8=v6;if (v5==1){v3.TSS1=setTimeout(v9,v3.TSS3);}}}

function flvFTSS1(){//v1.04
// Copyright 2003, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=document,v3=v1[0],v4=MM_findObj(v3),v5,v6;if (v4){v2.TSS5=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);v4.TSS7=v1[1]/1000;v4.TSS3=v1[2]+v1[1];v6=v1[3];v4.TSS9=v1[4];v4.TSS6=new Array();for (var v7=5;v7<v1.length;v7+=2){v4.TSS6[v4.TSS6.length]=new Array(v1[v7],v1[v7+1]);}v4.TSS8=0;v4.TSS4=new Image();v4.TSS4.src=v1[7];v4.TSS2=new Image();v4.TSS2.src=v1[v1.length-2];if (v6==1){v5="flvFTSS2('"+v3+"',1,"+v6+")";v4.TSS1=setTimeout(v5,v4.TSS3);}}}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
