
function doDDSSearch(library){
  document.location = "ddssearch.jsp?cl="+library+"&smd=1";
}

function doDDSBrowse(library){
  url = "ddssearch.jsp?cl="+library+"&smd=2";
  if(library == 'library1_lib'){
    url+='&nn=Photographs&nt=series&snt=series';
  }
  if(library == 'library3_lib'){
    url+='&nn=Artifacts&nt=series&snt=series';
  }
  if(library == 'library4_lib'){
    url+='&nn=Finding Aids&nt=series&snt=series';
  }
    
  document.location = url;
}

function searchMetalib(){
  document.location = 'http://ahecmetalib.carlisle.army.mil:8331/V/?func=meta-1-check&mode=advanced&find_request_1=&find_code_2=WRD&find_request_2='+document.getElementById('search_str_id').value+'&find_op_1=AND&find_code_3=WRD&find_request_3=&group_number=000000114&ckbox=MHI00719&ckbox=MHI00711&ckbox=MHI00716&ckbox=MHI00718&ckbox=MHI00724&metalib.x=35&metalib.y=8';
}
function searchArchivalWare(){
   url       = "http://ahecwebdds.carlisle.army.mil/awweb/guest.jsp";
   if(document.getElementById('search_str_id') && document.getElementById('search_str_id').value.length>0)
      document.location = url+'?un=public1&ps=ptfs&smd=1&cl=all_lib&qs='+document.getElementById('search_str_id').value;
   else
      document.location = url+'?un=public1&ps=ptfs&smd=1&cl=all_lib&donew=1';
}

function showMollusText(){
  var pos = getPosition(document.getElementById('imgmollus'));
  document.getElementById('mollustitle').style.left = (pos[0]-415)+'px';
  document.getElementById('mollustitle').style.top  = (pos[1]-30)+'px';
  document.getElementById('mollustitle').style.display='block';
}
function hideMollusText(){
  document.getElementById('mollustitle').style.display='none';
}
function showCarlisleText(){
  var pos = getPosition(document.getElementById('imgcarlisle'));
  document.getElementById('carlisletitle').style.left = (pos[0]+225)+'px';
  document.getElementById('carlisletitle').style.top  = (pos[1]-30)+'px';
  document.getElementById('carlisletitle').style.display='block';
}
function hideCarlisleText(){
  document.getElementById('carlisletitle').style.display='none';
}
function getPosition(object) {
  var left = object.offsetLeft;
  var top = object.offsetTop;
  object = object.offsetParent;
  while (object) {
    left += object.offsetLeft;
    top += object.offsetTop;
    object = object.offsetParent;
  }
  return [left, top];
}

function pressButton(vl){
  document.form1.smd.value=vl;
  document.form1.submit();
}
