ExplorerPopup = {};
ExplorerPopup.x = 0; // (screen.availWidth/2) - 395;
ExplorerPopup.y = 0; // (screen.availHeight/2) - 270;
ExplorerPopup.winOptions = "top=" + ExplorerPopup.x + ",left=" + ExplorerPopup.y + ",width=600,height=400,status=0,location=0,menubar=0,scrollbars=0";
ExplorerPopup.popup = null;
ExplorerPopupWin = null;
ExplorerPopup.count = 0;
ExplorerPopup.open = function( theme ) {

  var agt=navigator.userAgent.toLowerCase();
  var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;

  if (is_safari) {
      var oldPopup = ExplorerPopupWin;
      var newHref = "explorer_popup.jsp?theme=" + theme;
      ExplorerPopupWin = window.open(newHref, "ExplorerPopupWindow"+ExplorerPopup.count++, ExplorerPopup.winOptions);
      oldPopup.close();
  }
  else {
    if (ExplorerPopupWin == null || ExplorerPopupWin.closed ) {
      ExplorerPopupWin = window.open("blank.html", "ExplorerPopupWindow", ExplorerPopup.winOptions);
    }
    ExplorerPopup.navigate( theme );
  }
  ExplorerPopupWin.opener = window;
  ExplorerPopupWin.focus();
}
ExplorerPopup.navigate = function(theme) {
  if ( theme != ExplorerPopupWin.explorerTheme ) {
    var newHref = "explorer_popup.jsp?theme=" + theme;
    ExplorerPopupWin.location.href=newHref;
  }
}

