function hidePdfFeature(event) {
  mainmap.removePdfFeature(mainmapid);
}

function removeToolPdfListeners() {

  if (cw3_tools.indexOf('pdfrotate') == -1){
    for (var i = 0; i < cw3_tools.length; i++ )    {
      if (cw3_tools[i] != 'pdfrotate') {
        elt = xGetElementById(cw3_tools[i]);
        xRemoveEventListener(elt, 'click', hidePdfFeature, false);
        elt = xGetElementById(cw3_tools[i] + "_icon");
        xRemoveEventListener(elt, 'click', hidePdfFeature, false);
      }
    }
  }
}
EventManager.Add(window, 'load', removeToolPdfListeners, false);

