//page - direction up = next, down=previous
//       formID must be an element of the form you wish to submit
//      NOTE: in order for this to work there must be a hidden field in the form whose ID was passed in with the ID "currentPage"
function page(direction,formID){
    var hdCurrentPage = document.getElementById("currentPage");
    var frm = document.getElementById(formID);
    if (direction == "up") {
        hdCurrentPage.value = parseInt(hdCurrentPage.value)+1;
    }else{
        hdCurrentPage.value = parseInt(hdCurrentPage.value)-1;    
    }
    frm.submit();
    }
//showHideLayer
    
function showHideLayer(action, elementID){
    var elem = document.getElementById(elementID);
    if (action == "show"){
        elem.style.display="";
    }else{
        elem.style.display="none";
    }
}

function setAction(frm){
    frm.action = document.location.href;
}

function googleSearch(collection){
    var txtKeyword = document.getElementById("txtKeyword");
    window.location="/search/index.jsp?keywords=" + txtKeyword.value + "&collection=" + collection;
    //return true;
}

function showImageLibrary(openerTarget){
    window.open("/SUNYadmin/fileBrowser/Browser.jsp?openerTarget=" + openerTarget, "MediaLibrary", "location=no,menubar=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=yes");
}

