
popupWins = new Array();


function popup(theurl,height, width) {
var name='SelectWindow';
var defaultsize= 'height=600,width=820,';
var windowprops = "top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,"; 
var vargs= '';
/******************************* 
the popupWins array stores an object reference for
each separate window that is called, based upon
the name attribute that is supplied as an argument
*******************************/
if (!(height)) {
   args=windowprops+defaultsize;
   }
else {
   args=windowprops+'HEIGHT='+height+',WIDTH='+width;
   }

if ( typeof( popupWins[name] ) != "object" ){
   popupWins[name] = window.open(theurl,name,args);
   } else {
   if (!popupWins[name].closed){
      popupWins[name].location.href = theurl;
      } else {
      popupWins[name] = window.open(theurl, name,args);
      }
   }
popupWins[name].focus();
}

