﻿var o;
function PickerClose() {
    document.getElementById("doublePicker").className = "closePicker1";
}
function setValue(id, val) {
    document.getElementById(id).value = val;
}
function show() {
    document.getElementById("doublePicker").className = "openPicker";
}
function PickerShow(obj, oid) {
    document.getElementById("doublePicker").className = "openPicker";
    o = obj
    document.getElementById(oid).value = obj.id;
    var pos = getPosition(obj);
    var objDiv = document.getElementById("doublePicker");
    objDiv.style.position = "absolute";
    var tempheight = pos.y;
    var tempwidth1, tempheight1;
    var windowwidth = document.body.clientWidth;
    var isIE5 = (navigator.appVersion.indexOf("MSIE 5") > 0) || (navigator.appVersion.indexOf("MSIE") > 0 && parseInt(navigator.appVersion) > 4);
    var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5") > 0);
    var isIE6 = (navigator.appVersion.indexOf("MSIE 6") > 0);
    var isIE7 = (navigator.appVersion.indexOf("MSIE 7") > 0);

    if (isIE5 || isIE55 || isIE6 || isIE7) { var tempwidth = pos.x + 305; } else { var tempwidth = pos.x + 312; }

    if (tempwidth > windowwidth) {
        tempwidth1 = tempwidth - windowwidth
        objDiv.style.left = (pos.x - tempwidth1) + "px";
    }
    else {
        if (isIE5 || isIE55 || isIE6 || isIE7) { objDiv.style.left = (pos.x) + "px"; } else { objDiv.style.left = (pos.x) + "px"; }
    }
    if (isIE5 || isIE55 || isIE6 || isIE7) { objDiv.style.top = (pos.y + 22) + "px"; } else { objDiv.style.top = (pos.y + 22) + "px"; }


}