﻿/* VAUDE master javascript */

function OpenWindow (sUrl, sWindowName, iWidth, iHeight, sType)
{
    var sFeatures, newWin;

    iWidth = parseInt(iWidth) + 40;
    iHeight = parseInt(iHeight) + 60;

    if (sType == "image")
        sFeatures = "width=" + iWidth + ",height=" + iHeight + ",innerWidth=" + iWidth + ",innerHeight=" + iHeight + ",toolbar=no,status=no,resizable=yes,menubar=no,location=no,scrollbars=yes";
    else
        sFeatures = "width=" + iWidth + ",height=" + iHeight + ",innerWidth=" + iWidth + ",innerHeight=" + iHeight + ",toolbar=yes,status=yes,resizable=yes,menubar=yes,location=yes,scrollbars=yes";

    newWin = window.open(sUrl, sWindowName, sFeatures);

    if (newWin)
        newWin.focus();

    return newWin;
}

function EnableMenuesForIE ()
{
    if (document.all) {
        uls = document.getElementsByTagName('ul');

        for(i = 0; i < uls.length; i++) {

            if (uls[i].className == 'dropdown') {
                var lis = uls[i].getElementsByTagName('li');

                for (i = 0; i < lis.length; i++) {

                    if(lis[i].lastChild.tagName == 'UL') {
                        lis[i].onmouseover = function() { this.lastChild.style.display = 'block'; }
                        lis[i].onmouseout = function() { this.lastChild.style.display = 'none'; }
                    }

                }

            }

        }

    }
}

function LinkToSubCategories (linkUrl, linkNavSignature, linkName)
{
    var currentCategory = document.getElementById("currentCategory");
    var newDiv = document.createElement("div");
    var newAnchor = document.createElement("a");
    var newText = document.createTextNode(linkName);
    var newHref = linkUrl + "&NavSignature=" + linkNavSignature + "&PageSize=99";

    currentCategory.appendChild(newDiv);
    currentCategory.lastChild.appendChild(newAnchor);
    currentCategory.lastChild.lastChild.appendChild(newText);
    currentCategory.lastChild.lastChild.setAttribute("href", newHref);
}
