﻿
// Surpress client javascript errors
window.onerror = function() { return true; }

// Set the focus to the called window
function focusThisWindow() { try{ window.focus(); return true; }catch(e){} }

// Close the current window
function closeWin() { try{ window.close(); }catch(e){} }  

/*- PopUp -*/
var winPopUp;
function repairPopUp(caller, title) {
  // talk to current window - if so, just get out now
  if (winPopUp) {
    try { if (winPopUp.focusThisWindow()) return true; } catch(e) {}
  }
  // else close window just in case
  try { winPopUp.close(); } catch(e) {}
  // open new one
  try {
    winPopUp = window.open("Repairs-popup.aspx?caller=" + caller.toString() + "&title=" + encodeURIComponent(title),"repairpopup" + caller.toString(),"toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no,width=650,height=485");
  } catch(e) {
    alert("Error opening Repairs Popup window:\n"+e);
  }
}
