/**
 function initSpopUpAPI()
 function seekLayer(doc, name)
 function getRawObject(obj)
 function getObject(obj)
 function shiftTo(obj, x, y)
 function setZIndex(obj, zOrder)
 function Enable()
 */


var isCSS, isW3C, isIE4, isNN4, isIE6CSS;
/**
 Initialize upon load to let all browsers establish content objects
 */
function initSpopUpAPI()
{
    //Enable();
    if (document.images)
    {
        isCSS = (document.body && document.body.style) ? true : false;
        isW3C = (isCSS && document.getElementById) ? true : false;
        isIE4 = (isCSS && document.all) ? true : false;
        isNN4 = (document.layers) ? true : false;
        isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
    }
}
// Set event handler to initialize API
//window.onload = initSpopUpAPI;
function seekLayer(doc, name)
{
    var theObj;
    for (var i = 0; i < doc.layers.length; i++)
    {
        if (doc.layers[i].name == name)
        {
            theObj = doc.layers[i];
            break;
        }

        if (doc.layers[i].document.layers.length > 0)
        {
            theObj = seekLayer(document.layers[i].document, name);
        }
    }
    return theObj;
}

function getRawObject(obj)
{
    var theObj;
    if (typeof obj == "string")
    {
        if (isW3C)
        {
            theObj = document.getElementById(obj);
        }
        else if (isIE4)
        {
            theObj = document.all(obj);
        }
        else if (isNN4)
        {
            theObj = seekLayer(document, obj);
        }
    }
    else
    {
        theObj = obj;
    }
    return theObj;
}

function getObject(obj)
{
    var theObj = getRawObject(obj);
    if (theObj && isCSS)
    {
        theObj = theObj.style;
    }
    return theObj;
}

/**
 Move an object by x and/or y pixels
 */
function shiftTo(obj, x, y)
{
    var theObj = getObject(obj);
    if (theObj)
    {
        if (isCSS)
        {
            var units = (typeof theObj.left == "string") ? "px" : 0

            var xPosi;
            var yPosi;
            if (parseInt(x + units) <= 0)
                xPosi = 2;
            else
                xPosi = parseInt(x + units);

            if (parseInt(y + units) <= 0)
                yPosi = 2;
            else
                yPosi = parseInt(y + units)

            theObj.left = xPosi;
            theObj.top = yPosi;
        }
        else if (isNN4)
        {
            theObj.moveTo(x, y)
        }
    }
}

function setZIndex(obj, zOrder)
{
    var theObj = getObject(obj);
    if (theObj)
    {
        theObj.zIndex = zOrder;
    }
}


/**
 Enable All Contrlos in form
 */
function Enable()
{
    for (var j = 0; j < document.forms[0].elements.length; j++)
    {
        document.forms[0].elements[j].disabled = false
    }

}








