// ///////////////////////////////////////////////////////////////////////////////////////////
//      SCRIPT NAME:	erdb.js
//    SCRIPT AUTHOR:	Mark Vega/Johnny Lam
//      SCRIPT DATE:	May 2007
//  SCRIPT LOCATION:	pitcairn://target1s3/Web2/htdocs/www/online/resources/javascript/
//  SCRIPT FUNCTION:	
//     SCRIPT NOTES:	Part of Eresources Locator suite.		
// OTHER FILES USED:
//    LAST MODIFIED:	
//
// ///////////////////////////////////////////////////////////////////////////////////////////
//

// preload collapse and expand images
var imgExpand = new Image();
imgExpand.src = "images/expand.gif";
var imgCollapse = new Image();
imgCollapse.src = "images/collapse.gif";

//
// TEXT RESPONSE HANDLER FUNCTION FOR ERDB HTTP REQUEST
//
// called by including function name as _rqsthandler parameter in call to sendRequest function.
//  
function getResetResponse() {
var textDoc = '';

// check value of readystate
if (httpRequest.readyState == 4) {
// check value of http status
if (httpRequest.status == 200) {
// set value of statusresponse
textDoc = httpRequest.responseText;
}
}
// clear timeout
if (window.requestTimeout) {
window.clearTimeout(requestTimeout);
}
return;
}

//
// FUNCTION TO EXPAND, COLLAPSE BROWSE BY SUBJECT TABLE
//
function expand(expandId,textId,imgId) {
// get html elements to be changed
var expandElemId = document.getElementById(expandId);
var textElemId = document.getElementById(textId);
var imgElemId = document.getElementById(imgId);

// check and change current state and expand link
if (expandElemId.style.display == "none") {
expandElemId.style.display = "block";
textElemId.innerHTML = "collapse";
imgElemId.src = imgCollapse.src;
} else if (expandElemId.style.display == "block") {
expandElemId.style.display = "none";
textElemId.innerHTML = "expand";
imgElemId.src = imgExpand.src;
} else {
expandElemId.style.display = "block";
textElemId.innerHTML = "collapse";
imgElemId.src = imgCollapse.src;
}
return;
}

//
//
//
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
