﻿/// <reference path="CustomScripts.js" />
var intPadding = 4;
var intMarginLeft = 0;
var intMarginRight = 0;


function fun() {

    var aryDivs = document.getElementsByTagName('DIV');
    var intHeight = 0;

    for (var x = 0; x <= aryDivs.length - 1; x++) {
        if (aryDivs[x].getAttribute('AreaItem') != null) {
            aryDivs[x].parentNode.style.marginRight = "0px";
            aryDivs[x].parentNode.style.marginBottom = "0px";
            aryDivs[x].parentNode.style.marginLeft = "0px";
            aryDivs[x].parentNode.style.padding = "0px";
            intHeight = Sys.UI.DomElement.getBounds(aryDivs[x].parentNode).height;
            aryDivs[x].style.height = intHeight + 'px';
            aryDivs[x].style.minHeight = intHeight + 'px';
            aryDivs[x].style.maxHeight = intHeight + 'px';
            aryDivs[x].parentNode.style.height = intHeight + 'px';
            aryDivs[x].parentNode.style.maxHeight = intHeight + 'px';
        }
    }
    try {
        AddHomePageRollOverHandlers();
    } catch (e) {

}

}
function MouseEv(elm) {
    if (elm.getElementsByTagName('UL').length > 0) {
        elm.getElementsByTagName('UL').item(0).style.display = '';
        if (elm.getElementsByTagName('UL').item(0).getElementsByTagName('UL').length > 0) {
            var aryUls = elm.getElementsByTagName('UL').item(0).getElementsByTagName('UL');
            for (var x = 0; x <= aryUls.length - 1; x++) {
                aryUls[x].style.display = '';
            }
        }
    }
    return false;
}

function ShowFlyoutMenu(elm) {
    var elmParent = elm.parentNode;
    var ulElm = elmParent.getElementsByTagName('UL')[0];
    showAllChildrensChildren(ulElm);
}

function showAllChildrensChildren(elm) {
    elm.style.display = 'block';
    elm.style.width = '200px';
    if (elm.childNodes.length > 0) {
        for (var x = 0; x <= elm.childNodes.length - 1; x++) {
            switch (String(elm.childNodes[x].nodeName).toLowerCase()) {
                case '#text':
                    break;
                case '#comment':
                    break;
                default:
                    showAllChildrensChildren(elm.childNodes[x]);
                    break;
            }
        }
    }
}

function HideFlyout(li) {
    var ul = li.getElementsByTagName('UL').item(0);

    ul.style.display = 'none';
}
function IsMoz() {
    return (navigator.appName.toLowerCase().indexOf('netscape') > -1 || navigator.appName.toLowerCase().indexOf('firefox') > -1 || navigator.appName.toLowerCase().indexOf('moz') > -1);
}

function Do_AsyncPostBack(eventName, eventArgs, optional_onPostBackEndHandler) {
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    if (!Array.contains(prm._asyncPostBackControlIDs, eventName)) {
        prm._asyncPostBackControlIDs.push(eventName);
    }

    if (!Array.contains(prm._asyncPostBackControlClientIDs, eventName)) {
        prm._asyncPostBackControlClientIDs.push(eventName);
    }

    __doPostBack(eventName, eventArgs);

    try {
        if (mobjLastAdded_endRequestHandler != null) {
            prm.remove_endRequest(mobjLastAdded_endRequestHandler);
        }
    } catch (e) { }

    if (optional_onPostBackEndHandler != null) {
        mobjLastAdded_endRequestHandler = optional_onPostBackEndHandler;
        prm.add_endRequest(optional_onPostBackEndHandler);
    }
}