﻿function killErrors() {
    return true;
}
window.onerror = killErrors;
//function AutoHeight(control, W, H) {
//    var theX; //浏览器窗口宽度
//    if (document.documentElement.clientWidth < document.body.clientWidth && document.documentElement.clientWidth) {
//        theX = document.documentElement.clientWidth;
//    } else {
//        theX = document.body.clientWidth;
//    }

//    var theY; //浏览器窗口高度
//    if (document.documentElement.clientHeight <= document.body.clientHeight && document.documentElement.clientHeight) {
//        theY = document.documentElement.clientHeight;
//    } else {
//        theY = document.body.clientHeight;
//    }
//    if (theX == 0)
//        theX = 900;
//    if (theY == 0)
//        theY = 450;
//    if (parseInt(H) > 0) {
//        if (null != document.getElementById(control))
//            document.getElementById(control).style.height = eval(theY - H) + "px";
//        if (parseInt(W) > 0) {
//            if (null != document.getElementById(control))
//                document.getElementById(control).style.width = eval(theX - W) + "px";
//        }
//    }
//}
function AutoHeight(control, W, H) {
    var BodyHeight = document.documentElement.clientHeight;
    if (window.innerHeight) {
        nowHeight = window.innerHeight;
    }
    var form1 = document.getElementById("form1");
    if (form1 != null) {
        form1.style.height = (BodyHeight - 5) + "px";
    }
    if (BodyHeight == 0)
        BodyHeight = 450;
    if (parseInt(H) > 0) {
        if (null != document.getElementById(control))
            document.getElementById(control).style.height = eval(BodyHeight - H) + "px";
        var clientWidth = document.documentElement.clientWidth;
        if (window.innerWidth) {
            clientWidth = window.innerWidth;
        } 
        if (clientWidth == 0)
            clientWidth = 900;
        if (parseInt(W) > 0) {
            if (null != document.getElementById(control))
                document.getElementById(control).style.width = eval(clientWidth - W) + "px";
        }
    }
}
function _tab() {
    if (window.event.keyCode == 13)
        window.event.keyCode = 9;
}
function senfe(o, a, b, c) 
{
    if (null != document.getElementById(o)) 
    {
        if (null != document.getElementById(o).getElementsByTagName("tr")) 
        {
            var t = document.getElementById(o).getElementsByTagName("tr");
            for (var i = 0; i < t.length; i++) 
            {
                t[i].style.backgroundColor = (t[i].sectionRowIndex % 2 == 0) ? a : b;
                t[i].onclick = function() 
                {
                    this.x = "0";
                    this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a : b;
                }
                t[i].onmouseover = function() 
                {
                    if (this.x != "1") this.style.backgroundColor = c;
                }
                t[i].onmouseout = function() 
                {
                    if (this.x != "1") this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a : b;
                }
            }
        }
    }
}
var t_id = setInterval(animate, 20);
var pos = 0; var dir = 2; var len = 0;
function animate() {
    var elem = document.getElementById('progress');
    if (elem != null) {
        if (pos == 0) len += dir;
        if (len > 32 || pos > 79) pos += dir;
        if (pos > 79) len -= dir;
        if (pos > 79 && len == 0) pos = 0;
        elem.style.left = pos;
        elem.style.width = len;
    } 
}
function remove_loading() {
    this.clearInterval(t_id);
    var targelem = document.getElementById('loader_container');
    targelem.style.display = 'none';
    targelem.style.visibility = 'hidden';
}
