﻿
function $() {
    var elements = new Array();

    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == "string")
            element = document.getElementById(element);
        if (arguments.length == 1) 
            return element;
        elements.push(element);
    }
    return elements;
}

// 浮动提示层
function ShowPopUp(tips, flag, width, height) {
    var my_tips = document.all.mytips;
    if (flag) {
        my_tips.style.display = "";
        my_tips.innerHTML = tips;
        my_tips.style.left = document.body.scrollLeft + event.clientX - width;
        my_tips.style.top = document.body.scrollTop + event.clientY - height;
    }
    else {
        my_tips.style.display = "none";
    }
}

// 将一个元素放置到另一个元素上
function Cover(bottom, top, ignoreSize) {
    var location = Sys.UI.DomElement.getLocation(bottom);
    top.style.position = "absolute";
    top.style.top = location.y + "px";
    top.style.left = location.x + "px";
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
    }
}

