var DO_PRINT_DOCUMENT=0;


/**
 * Wird aufgerufen, wenn beliebige Aktion in der Merkliste 
 * aufgerufen wurde (pdg,zip,print usw.).Dabei wird geschaut, welche
 * Aktion jetzt aktuell ist und anschliessend dazugehoerige 
 * Aktion ausgefuehrt.
 * @param lastAction, wenn gleich -1, heisst es, dass die letzte Aktion nicht erfolgreich war
 * @return nichts
 */
function onCompleteBookmarkAction(lastAction){
  DO_PRINT_DOCUMENT=0;
  document.getElementById('progressBarId').style.display='none';
  document.getElementById('contentAreaWithMarginal').style.display='';
  document.getElementById('downloadDiv').style.display='none';
  var actionId=lastAction[0];
  var isSuccess=lastAction[1];
  if (actionId == "" || isSuccess == "false") {
	
	  return;
  }
  if (actionId == "zip") {
	  var zippedFile=lastAction[2];	 
	  if (zippedFile != null && zippedFile != "") {
	  document.getElementById('downloadDivOutputLink').href="./wmresource/binary.load?filePath="+zippedFile; 
	  document.getElementById('downloadDiv').style.display='block';
	  }
	  doSHIBinaryDownload(zippedFile);
  }
  
  if (actionId == "pdf") {
	  var zippedFile=lastAction[2];	 
	  if (zippedFile != null && zippedFile != "") {
	  document.getElementById('downloadDivOutputLink').href="./wmresource/binary.load?filePath="+zippedFile; 
	  document.getElementById('downloadDiv').style.display='block';
	  }
	  doSHIBinaryDownload(zippedFile);
	
  }
  
  if (actionId == "print") {
	  var printFile=lastAction[2];
	  DO_PRINT_DOCUMENT=1;
	 
	  doSHIHTMLPrint(printFile);
	  
  }
  if (actionId == "delete") {
//	  self.location.href=self.location.href+'?tstmp='+(new Date());
	  document.getElementById('outlookform').submit();
  }
}
