//functions to be shared when using pseudocookies

var pcookieLastSearch = 'lastSearch';  
var pcookieDocURL     = 'docURL';
var pcookieSegList    = 'SEGMENT_LIST_COOKIE';

//this group is used by citenav_xx.html and docnav_xx.html (pro)
function gotoLastSearch() 
{
  var lastSrch = GetPseudoCookie(pcookieLastSearch); 
  parent.parent.parent.lastSearch(lastSrch);
}

function makeDeliveryCall(callType)
{
  var docURL = GetPseudoCookie(pcookieDocURL);

  if(parent.parent.parent.doDDReq)
  {
     parent.parent.parent.doDDReq(docURL, callType);
  }
  else if(parent.parent.doDDReq)
  {
     parent.parent.doDDReq(docURL, callType);
  }
  else if(parent.doDDReq)
  {
     parent.doDDReq(docURL, callType); 
  }

}

function doFax() 
{
  makeDeliveryCall("fx");
}

function doEmail() 
{
  makeDeliveryCall("em");
}

function doDownload() 
{
  makeDeliveryCall("dl");
}

function doPrint() 
{
  makeDeliveryCall("pr");
}
 
//used by anything that calls delivery.js backToDoc()

function backToDocs(frame)
{
  var docURL = GetPseudoCookie(pcookieDocURL);

  if(frame != null && frame != "")
  {
    frame.location.href = docURL;
  }
  else
  {
    self.location.href = docURL;
  }
}
 
function viewPrnBackToDocs()
{
  var docURL = GetPseudoCookie(pcookieDocURL);
  parent.parent.location.href = docURL;
}

