﻿if (!window.console) { window.console = {}; window.console.log = function () { } }

function hideDiv(divName) {
    if (document.getElementById) { // DOM3 = IE5, NS6 
        document.getElementById(divName).style.display = 'none';
    }
}
function showDiv(divName) {
    if (document.getElementById) { // DOM3 = IE5, NS6 
        document.getElementById(divName).style.display = 'inline';
    }
}
function PopupDialog(mylink, windowname, options) {
    if (!window.focus) return true;
    var href;
    if (typeof (mylink) == 'string') href = mylink; else href = mylink.href;
    hnd = window.open(href, windowname, options);
    hnd.focus();
}
function PopupDialogWithReturn(mylink, windowname, options) {
    if (!window.focus) return true;
    var href;
    if (typeof (mylink) == 'string') href = mylink; else href = mylink.href;
    hnd = window.open(href, windowname, options);
    hnd.focus();
    return false;
}
function clickButton(e, buttonid) {
    var evt = e ? e : window.event;
    var bt = document.getElementById(buttonid);
    if (bt) { if (evt.keyCode == 13) { bt.click(); return false; } }
}
function RedirectDropdownlist(loc) {
    window.location.href = loc;
    return false;
}
function encodeMyHtml(toEncode) {
	return toEncode.replace(/&/gi, '&amp;').replace(/\"/gi, '&quot;').replace(/</gi, '&lt;').replace(/>/gi, '&gt;');
}
function decodeMyHtml(toEncode) {
	return toEncode.replace(/&amp;/gi, '&').replace(/&quot;/gi,'"').replace(/&lt;/gi,"<").replace(/&gt;/gi,">");
}
function noHTML(toEncode) {
    return toEncode.replace(/<(?:.|\s)*?>/g, '');
}
function OnDropDownChangeURL(dropdown) {
    var myindex = dropdown.selectedIndex
    var SelValue = dropdown.options[myindex].value
    if (SelValue != '') { top.location.href = SelValue; }
    return true;
}

