<!--
/**********************************************************
* SFX (tm) SFX common javascript file.
* Copyright Ex Libris, Inc.
* Version: $Id: main.js,v 1.6 2005/06/23 14:23:56 am_3 Exp $
***********************************************************/

//---------------------------------------------------------
function OpenWindow(url,winname,w,h,needChild) {
//---------------------------------------------------------
// Standard function for opening an sfx menu window
//---------------------------------------------------------
    if (typeof winname == 'undefined' || ! winname.length) winname = 'openwin';
    if (typeof url     == 'undefined' || ! url.length) url = '';
    var child;
    if (!w && !h){
        child = window.open(url,winname,'width=640,height=800,scrollbars=yes,resizable=yes');
    }else{
        child = window.open(url,winname,"width="+w+",height="+h);
    }
    child.focus();
    if (needChild) return child;
}

//---------------------------------------------------------
function CloseWindow() {
//---------------------------------------------------------
// Standard function for close current window
//---------------------------------------------------------
 window.close();
 }


//---------------------------------------------------------
function gotoPage(pageNumber,form) {
//---------------------------------------------------------
// Resubmits the query but first specifies the desired page
// number.
//---------------------------------------------------------
    if (pageNumber) {
        form.__jump_to.value = pageNumber;
    }
    if (!form.__jump_to.value) {
        alert('No page number specified.');
    }
    else {
        form.submit();
    }
}

//---------------------------------------------------------
function getStyleObject(objectId) {
//---------------------------------------------------------
// Gets an object's style object by its id.
//---------------------------------------------------------
    if(document.getElementById && document.getElementById(objectId)) {
        return document.getElementById(objectId).style;
    }
    else if (document.all && document.all(objectId)) {
        return document.all(objectId).style;
    }
    else if (document.layers && document.layers[objectId]) {
        return document.layers[objectId];
    }
    else {
        return false;
    }
}

//---------------------------------------------------------
function changeObjectVisibility(objectId, newVisibility) {
//---------------------------------------------------------
// Changes an object's visibility by its id.
//---------------------------------------------------------
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
      styleObject.visibility = newVisibility;
      return true;
    }
    else {
      return false;
    }
}

//---------------------------------------------------------
function moveObject(objectId, newXCoordinate, newYCoordinate) {
//---------------------------------------------------------
// get a reference to the cross-browser style object and
// make sure the object exists.
//---------------------------------------------------------
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
        styleObject.left = newXCoordinate;
        styleObject.top = newYCoordinate;
        return true;
    } else {
        // cannot find the object, so cannot move it
        return false;
    }
}

// -->
