﻿

function tableheight() {

    var theWidth, theHeight;
    // Window dimensions: 
    if (window.innerWidth) {
        theWidth = window.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientWidth) {
        theWidth = document.documentElement.clientWidth;
    }
    else if (document.body) {
        theWidth = document.body.clientWidth;
    }
    if (window.innerHeight) {
        theHeight = window.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) {
        theHeight = document.documentElement.clientHeight;
    }
    else if (document.body) {
        theHeight = document.body.clientHeight;
    }

    //
    document.getElementById("mastertable").style.height = theHeight;
    //  document.getElementById("Splitter1").style.height = theHeight - 200;
    //  document.getElementById("SplitPane1").style.height = theHeight - 210;
    //  document.getElementById("SplitPane2").style.height = theHeight - 210;
    //     document.getElementById("SplitPane2").setAttribute
    //window.newh.innerHTML = document.getElementById("Splitter1").style.height
    //window.mastertable.style.height = theHeight;
    //document.getElementById("mastertable").style.height = document.documentElement.clientHeight;
    //document.getElementById("bodykol").style.height = document.documentElement.clientHeight - 150;
    // document.getElementById("MyTabs1").style.height = document.documentElement.clientHeight-200;
    return true
}
//    function getBrowserWidth()
//    {
//	    if (window.innerWidth)
//	    {
//		    return window.innerWidth;
//	    }
//	    else if (document.documentElement && document.documentElement.clientWidth != 0)
//	    {
//		    return document.documentElement.clientWidth;
//	    }
//	    else if (document.body)
//	    {
//		    return document.body.clientWidth;
//	    }
//    	
//	    return 0;
//    };

function setWidth() {
    var theWidth = getBrowserWidth();
    if (theWidth >= 950) {
        document.getElementById("mastertable").width = 1000;
        document.getElementById("mynav").width = 250;
    }
    else {
        document.getElementById("mastertable").width = 900;
        document.getElementById("mynav").width = 150;
    }
    return true
};

function checkscript() {
    em = document.getElementById("Email0").value;
    posa = em.indexOf("@");
    posd = em.lastIndexOf(".");

    if (document.getElementById("verf").value.length != 6) {
        // something is wrong
        alert('Geef svp de verificatie code op');
        return false;
    }
    else if (posa < 1 || posd - posa < 2) {
        // something else is wrong
        alert('Voer svp een correct email adres in');
        return false;
    }

    // If the script makes it to here, everything is OK,
    // so you can submit the form

    return true;
}
function NavigateContentPane(node) {
    ContentPane.SetContentUrl(node.Value);
}
function nodeRename(node) {
    document.getElementById('MyVisitCo_feedbacklabel').innerHTML = "ClientSide_Renamed '" + node.OldText + "' to '" + node.Text + "'";
}
function UpdateLabel(arg_text) {
    Popup.HidePopup();
    var labelEle = document.getElementById("MyVisitCo_feedbacklabel");
    labelEle.innerHTML = arg_text;
}

function alertme(xx) {
    //
}

function DoP(xPage) {
    //var MenuID = document.myForm.MenuID.value
    var SiteCode = document.myForm.SiteCode.value;
    var Language = document.myForm.Language.value;
    parent.hoofd.location.href = 'Site.aspx?MenuID=' + xPage + '&SiteCode=' + SiteCode + '&Language=' + Language
}

function DoA(xPage) {
    //var MenuID = document.myForm.MenuID.value
    var SiteCode = document.myForm.SiteCode.value;
    var Language = document.myForm.Language.value;
    parent.hoofd.location.href = 'Arts.aspx?MenuID=' + xPage + '&SiteCode=' + SiteCode + '&Language=' + Language
}


stuHover = function () {
    var cssRule;
    var newSelector;
    for (var i = 0; i < document.styleSheets.length; i++)
        for (var x = 0; x < document.styleSheets[i].rules.length; x++) {
            cssRule = document.styleSheets[i].rules[x];
            if (cssRule.selectorText.indexOf("LI:hover") != -1) {
                newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
                document.styleSheets[i].addRule(newSelector, cssRule.style.cssText);
            }
        }
    var getElm = document.getElementById("nav").getElementsByTagName("LI");
    for (var i = 0; i < getElm.length; i++) {
        getElm[i].onmouseover = function () {
            this.className += " iehover";
        }
        getElm[i].onmouseout = function () {
            this.className = this.className.replace(new RegExp(" iehover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", stuHover);


