﻿function killErrors() {
    return true;
}
var Fe = Fe || {
    version: "20080809",
    emptyFn: function() {}
};
Fe.isIE = /MSIE (\d+(\.\d+)?)/.test(navigator.userAgent) ? RegExp.$1: 0;
var isIE6 = function(){ if (Fe.isIE == '6.0') return true; else return false;}
Fe.isFirefox = /Firefox(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent) ? RegExp.$2: 0;
Fe.isSafari = (navigator.userAgent.indexOf("Safari") > -1 && /Version\/(\d+(\.\d+)?)/.test(navigator.userAgent)) ? RegExp.$1: 0;
Fe.isWebkit = (navigator.userAgent.indexOf("KHTML") > -1 && /AppleWebKit\/([^\s]*)/.test(navigator.userAgent)) ? RegExp.$1: 0;
Fe.isOpera = (window.opera && /Opera(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent)) ? RegExp.$2: 0;
Fe.G = function() {
    for (var A = [], B = arguments.length - 1; B > -1; B--) {
        var C = arguments[B];
        A[B] = null;
        if (typeof C == "object" && C && C.dom) {
            A[B] = C.dom;
        } else {
            if ((typeof C == "object" && C && C.tagName) || C == window || C == document) {
                A[B] = C;
            } else {
                if (typeof C == "string" && (C = document.getElementById(C))) {
                    A[B] = C;
                }
            }
        }
    }
    return A.length < 2 ? A[0] : A;
};
function runcode(codeBtn) {
    var codeText = codeBtn.parentNode.firstChild;
    var codeValue = codeText.value;
    var rng = window.open('', '', '');
    rng.opener = null;
    rng.document.write(codeValue);
    rng.document.close();
}
function copycode(codeBtn) {
    var codeText = codeBtn.parentNode.firstChild;
    var rng = codeText.createTextRange();
    rng.moveToElementText(codeText);
    rng.scrollIntoView();
    rng.select();
    rng.execCommand("Copy");
    rng.collapse(false);
}
function savecode(codeBtn) {
    var winname = window.open('about:blank', '_blank', 'top=100');
    winname.document.open();
    winname.document.write(codeBtn.parentNode.firstChild.value);
    winname.document.execCommand('saveas', '', 'runcode.htm');
    winname.close();
}
function urlEncode(str) {
    str = str.replace(/./g,
    function(sHex) {
        window.EnCodeStr = "";
        window.sHex = sHex;
        window.execScript('window.EnCodeStr=Hex(Asc(window.sHex))', "vbscript");
        return window.EnCodeStr.replace(/../g, "%$&");
    });
    return str;
}
function show(index) {
    Fe.G('nav_n_' + index).style.display = "block";
}
function dis(index) {
    Fe.G('nav_n_' + index).style.display = "none";
}
function trim(s) {
    return s.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.trim = function() {return this.replace(/(^\s*)|(\s*$)/g, "");}
function get(v) {return document.getElementById(v);}
