function populateBanners() {  var acronyms = document.getElementsByTagName("acronym"), ids = []; for (var i = 0, len = acronyms.length; i < len; i++) ids[ids.length] = acronyms[i].id.split("_BANNER_")[1]; if (ids.length && ids.length > 0) { var bannersiframe = document.createElement('iframe'); bannersiframe.id = 'bannersiframe'; bannersiframe.style.display = 'none'; bannersiframe.src = "BannersHandler.axd?mainID=" + nodeId + "&langID=" + langId + "&ids=" + ids.join(","); document.body.appendChild(bannersiframe); } }
function CreateFlashControl(DivID, WIDTH, HEIGHT, URL, WMODE, MENU) { var d = document.getElementById(DivID); FlObj = '<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0  width=' + WIDTH + ' height=' + HEIGHT + '>'; FlObj = FlObj + '<param name="movie" value=' + URL + '>'; FlObj = FlObj + '<param name="wmode" value=' + WMODE + '>'; FlObj = FlObj + '<param name="menu" value=' + MENU + '>'; FlObj = FlObj + '<embed src=' + URL + '  wmode=' + WMODE + ' quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=' + WIDTH + ' height=' + HEIGHT + '></embed></object>'; d.innerHTML = FlObj; }
function clearf() { for (var i = 0; i < document.forms[0].elements.length; i++) { if (document.forms[0].elements[i].type == "text" || document.forms[0].elements[i].type == "textarea" || document.forms[0].elements[i].type == "password") document.forms[0].elements[i].value = ""; else if (document.forms[0].elements[i].type == "select-one") document.forms[0].elements[i].selectedIndex = 0; else if (document.forms[0].elements[i].type == "checkbox") document.forms[0].elements[i].checked = false; } }
function SetJS(location, tag) { var objRef = document.getElementById('__BANNER_' + location); objRef.innerHTML = tag; }
function setListeners() {
    inputList = document.getElementsByTagName("INPUT"); for (i = 0; i < inputList.length; i++) {
        if (inputList[i].attachEvent) inputList[i].attachEvent("onpropertychange", restoreStyles); else if (inputList[i].addEventListener) inputList[i].addEventListener("propertychange", restoreStyles, false); else
            inputList[i].onpropertychange = restoreStyles; inputList[i].style.backgroundColor = "";
    } selectList = document.getElementsByTagName("SELECT"); for (i = 0; i < selectList.length; i++) {
        if (selectList[i].attachEvent) selectList[i].attachEvent("onpropertychange", restoreStyles); else if (selectList[i].addEventListener) selectList[i].addEventListener("propertychange", restoreStyles, false); else
            selectList[i].onpropertychange = restoreStyles; selectList[i].style.backgroundColor = "";
    }
}
function restoreStyles() { if (event.srcElement.style.backgroundColor != "") event.srcElement.style.backgroundColor = ""; }
function SetFlashJS(location, d, s, tag, width, height) { CreateFlashControl('__BANNER_' + location, width, height, tag, 'Transparent', ''); }
function showPicture(src) { window.open('ImageView.aspx?img=' + src, 'picture', 'scrollbar:no statusbar:no'); }
function createBookmarkLink() { if (window.sidebar) window.sidebar.addPanel(document.title, location.href, ''); else if (window.external) window.external.AddFavorite(location.href, document.title); else if (window.opera && window.print) return true; }

$.fn.watch = function(props, func, interval, id) {
    /// <summary>
    /// Allows you to monitor changes in a specific
    /// CSS property of an element by polling the value.
    /// when the value changes a function is called.
    /// The function called is called in the context
    /// of the selected element (ie. this)
    /// </summary>    
    /// <param name="prop" type="String">CSS Property to watch. If not specified (null) code is called on interval</param>    
    /// <param name="func" type="Function">
    /// Function called when the value has changed.
    /// </param>    
    /// <param name="func" type="Function">
    /// optional id that identifies this watch instance. Use if
    /// if you have multiple properties you're watching.
    /// </param>
    /// <param name="id" type="String">A unique ID that identifies this watch instance on this element</param>  
    /// <returns type="jQuery" /> 
    if (!interval)
        interval = 200;
    if (!id)
        id = "_watcher";

    return this.each(function() {
        var _t = this;
        var el = $(this);
        var fnc = function() { __watcher.call(_t, id) };
        var itId = null;

        if (typeof (this.onpropertychange) == "object")
            el.bind("propertychange." + id, fnc);
        else if ($.browser.mozilla)
            el.bind("DOMAttrModified." + id, fnc);
        else
            itId = setInterval(fnc, interval);

        var data = { id: itId,
            props: props.split(","),
            func: func,
            vals: []
        };
        $.each(data.props, function(i) { data.vals[i] = el.css(data.props[i]); });
        el.data(id, data);
    });

    function __watcher(id) {
        var el = $(this);
        var w = el.data(id);

        var changed = false;
        var i = 0;
        for (i; i < w.props.length; i++) {
            var newVal = el.css(w.props[i]);
            if (w.vals[i] != newVal) {
                w.vals[i] = newVal;
                changed = true;
                break;
            }
        }
        if (changed && w.func) {
            var _t = this;
            w.func.call(_t, w, i)
        }
    }
}
$.fn.unwatch = function(id) {
    this.each(function() {
        var w = $(this).data(id);
        var el = $(this);
        el.removeData();

        if (typeof (this.onpropertychange) == "object")
            el.unbind("propertychange." + id, fnc);
        else if ($.browser.mozilla)
            el.unbind("DOMAttrModified." + id, fnc);
        else
            clearInterval(w.id);
    });
    return this;
}