function Is() {
        var agent   = navigator.userAgent.toLowerCase();
        this.major  = parseInt(navigator.appVersion);
        this.minor  = parseFloat(navigator.appVersion);
        this.ns     = ((agent.indexOf('mozilla') != -1) && (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera') == -1) && (agent.indexOf('webtv') == -1));
        this.ns2    = (this.ns && (this.major == 2));
        this.ns3    = (this.ns && (this.major == 3));
        this.ns4    = (this.ns && (this.major == 4));
        this.ns6    = (this.ns && (this.major >= 5));
        this.ie     = (agent.indexOf("msie")!= -1);
        this.ie3    = (this.ie && (this.major < 4));
        this.ie4    = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
        this.ie5    = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
        this.ieX    = (this.ie && !this.ie3 && !this.ie4);
}

function popUp(window_url, width, height) {

  var is = new Is();    
  var win_width = width;
  var win_height = height;

  //the above function detects the browser
  var available_width;
  var available_height;

  if (is.ns4 || is.ns6) 
  {
    available_width=screen.width;
    available_height=screen.height;
  } 
  else if(is.ie4 ||is.ie5) 
  {
    available_width=screen.width;
    available_height=screen.height;           
  }

   var winprop = "width="+win_width+",height="+win_height+",top=" + Math.round(available_height/2-win_height/2) + ",left=" + Math.round(available_width/2-win_width/2);  
   popupWindow = window.open(window_url,'','toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no,directories=no,location=no,' + winprop );
   if (document.images) { 
       if (popupWindow) popupWindow.focus()
   }
}


