function AddToPersonalCostCenterList(ID) {
    aWindow = window.open("/psAdmin/CostCenterSelection.asp?ID=" + ID, "Personal_List", 'width=720,height=400,toolbar=no,menubar=no,status=no,resizable=yes');
}

function openHelp(page) {
    aWindow = window.open(page, "Help", 'width=440,height=310,toolbar=no,menubar=no,status=no,resizable=yes');
}

function openWin(page) {
    aWindow = window.open(page, "Details", 'width=600, height=450,resizable=yes');
}

function PleaseWait() {
    aWindow = window.open("/main/PleaseWait.htm", "wait", 'width=400,height=100,toolbar=no,menubar=no,status=no,resizable=no');
}
function openShipping(ID) {
    aWindow = window.open("/go/shipping_details.asp?ID=" + ID, "Shipping", 'width=560,height=225,toolbar=no,menubar=no,status=no,resizable=yes');
}

function isaPosNumb(s)
//	the size of the number can be dealt with here, 
//	or the input field MAXLENGTH can be used to manage the magnitude of the value.
{
    return (parseInt(s) >= 0)
}

function IsNumeric(strValue) {
    var returnVal = true
    var strLen = strValue.value.length;

    //	alert ("strValue: "+strValue.value);	
    //	alert ("strLen: "+strLen);

    //	if the value is not a positive number, we do have a problem!
    //	if (!isaPosNumb(strValue.value) || strLen==0 || strValue.value==null )
    if (!isaPosNumb(strValue.value) && strLen > 0) {
        alert("Please enter a positive number.");
        returnVal = false;
    }
    return returnVal;
}

function CloseWindow() {
    window.opener = 'X';
    window.open('', '_parent', '');
    window.close();
}

//     *********************************************************
//     * You may use this code for free on any web page provided that 
//     * these comment lines and the following credit remain in the code.
//     * Floating Div from http://www.javascript-fx.com
//     ********************************************************  
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy) {
    var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.layers[id];
    var px = document.layers ? "" : "px";
    window[id + "_obj"] = el;
    if (d.layers) el.style = el;
    el.cx = el.sx = sx; el.cy = el.sy = sy;
    el.sP = function (x, y) { this.style.left = x + px; this.style.top = y + px; };

    el.floatIt = function () {
        var pX, pY;
        pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
		    document.documentElement && document.documentElement.clientWidth ?
		    document.documentElement.clientWidth : document.body.clientWidth;
        pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
		    document.documentElement.scrollTop : document.body.scrollTop;
        if (this.sy < 0)
            pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
		    document.documentElement.clientHeight : document.body.clientHeight;
        this.cx += (pX + this.sx - this.cx) / 6; this.cy += (pY + this.sy - this.cy) / 6;
        this.sP(this.cx, this.cy);
        setTimeout(this.id + "_obj.floatIt()", 10);
    }
    return el;
}
