//Copyright 2006 Eric Lic-hang Lee. All rights reserved.

function PopUpPage() {
  this.arrParamPair = new Array();
  this.url = '';
  this.anchor = '';
  this.target = ''
}

PopUpPage.prototype.setTarget = function(target) {
 this.target = target;
}

PopUpPage.prototype.setUrl = function(url) {
 this.url = url;
}

PopUpPage.prototype.setAnchor = function(anchor) {
 this.anchor = anchor;
}

PopUpPage.prototype.addParamPair = function(param, value) {
 var pair = (param+'='+escape(value));
 this.arrParamPair[this.arrParamPair.length] = pair;
}

PopUpPage.prototype.resetParamPair = function() {
 this.arrParamPair = new Array();
}

PopUpPage.prototype.showWindow = function() {
 if(this.win) {
  this.win.close();
 }
 var path = this.arrParamPair.join('&');
 if(this.anchor != '') {
  path += ('#'+this.anchor);
 }
 this.win = window.open((this.url+'?'+path), this.target, "width=600, height=300, left=0, top=0, toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=yes");
}

