
// jae v3 - added
function goback() {
// returns the user to their last search or collection result set
  document.frm.action.value = "return";
  document.frm.submit();
}
// end jae v3

function linksearch(fieldname, fieldvalue, style)
{
  document.frm.action.value = 'searchrequest';  document.frm.linkfieldname.value = fieldname;  document.frm.linkfieldvalue.value = fieldvalue;
  document.frm.style.value = style;  document.frm.submit();
}
function singleview(newpage)
{
  document.frm.action.value = 'newpage';  document.frm.style.value = 'single';  document.frm.singlepage.value = newpage;
  document.frm.submit();
}

function submitpage(action,para)
{
  window.document.frm['action'].value = action;

  switch (action)
  {
    case 'newpage' :
      document.frm.currentpage.value = para;
      break
    case 'style' :
      document.frm.style.value = para;
      break
    case 'collection' :
      document.frm.collection.value = para;
      break
    case 'searchbutton' :
      document.frm.action.value = 'quicksearch';
      document.frm.term.value = document.frm.basicterm.value;
      break
    case 'sort' :
      document.frm.sortstring.value = para;
      document.frm.currentpage.value = 1;
      break;
    default :
      break
  }
  document.frm.submit();
}

function submitcollection(colname,colid)
{

  document.frm.action.value = 'collection';
  document.frm.collectionname.value = colname;
  document.frm.collection.value = colid;

  document.frm.submit();
}

function setMedia(mediaId) {
	//selects a particular media record for enlarging
	eval("var oFilename = document.frm.filename"+mediaId);
	eval("var oCaption = document.frm.caption"+mediaId);
	eval("var oTitle = document.frm.title"+mediaId);
	eval("var oMediatype = document.frm.mediatype"+mediaId);
	document.frm.filename.value = oFilename.value;
	document.frm.caption.value = oCaption.value;
	document.frm.title.value = oTitle.value;
	document.frm.mediatype.value = oMediatype.value;
}

function spawn(url, nameW, w, h) {
  if (navigator.appVersion.indexOf('4') != -1) {
    // Vars for centering the new window on Version 4 Browsers
    x4 = screen.width/2 - (w/2);
    y4 = screen.height/2 - (h/2);
    window.open(url, nameW, 'height='+h+',width='+w+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=' + x4 + ',top=' + y4 + '');
  } else {
    window.open(url, nameW, 'height='+h+',width='+w+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
  }
}

function openImage(imgName,sTitle,sCaption){
  var sHTML = "<html><head><title>"+sTitle+"</title><link rel='stylesheet' href='../txtStyle.css' type='text/css'/></head><body><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr valign='top'><td class='title'>"+sTitle+"</td><td align='right' class='txt'><a href='javascript:window.close();'>Close</a></td></tr><tr><td class='txt'>"+sCaption+"</td><td></td></tr></table><br><img src='getimage.asp?filename="+imgName+"&type=full' width='400' height='400' border='0' alt='"+sTitle+"'></body></html>";
  var theWindow = "";
  theWindow = window.open("","","height=540,width=540,resizable,scrollbars");
  if(theWindow){
    theWindow.document.write(sHTML);
    theWindow.document.close();
  }
}