/*Popup Window Constructor*/
function PopupWindow(sPage, iWidth, iHeight){
this.src=sPage;
this.width=iWidth!=null?iWidth:screen.availWidth*.75;
this.height=iHeight!=null?iHeight:screen.availHeight*.75;
this.x="center";
this.y="middle";
this.chrome=1;
this.menubar=0;
this.location=0;
this.directories=0;
this.toolbar=0;
this.status=0;
this.scrollbars=1;
this.resizable=0;
this.behind=0;
this.modal=true;
this.name="_blank";
this.show=function() {
if(navigator.appName.indexOf("Microsoft") != -1 && this.modal){
sArgs="dialogWidth:"+this.width+'px;dialogHeight:'+this.height+"px;resizable:"+this.resizable+";status:"+this.status+";";
oWin=window.showModelessDialog(this.src, document,sArgs);
return oWin;
} else {
sArgs='menubar='+this.menubar+',location='+this.location+',scrollbars='+this.scrollbars+',directories='+this.directories+',toolbar='+this.toolbar+',status='+this.status+',resizable='+this.resizable+',fullscreen='+Number(!this.chrome)+',width='+this.width+',height='+this.height+'';
var oWin = this.window=window.open(this.src, this.name, sArgs );
if(this.behind){window.focus();}
iW = Math.floor(this.width);
iH = Math.floor(this.height);
oWin.resizeTo(iW,iH);
var aW = screen.availWidth;
var aH = screen.availHeight;
}
return oWin;
}}

function setCookie(sName, sValue, sExpires) {
sExpires = sExpires != null ? "; expires=" + sExpires : "";
document.cookie = sName + "=" + escape(sValue) + sExpires;
}

function getCookie(sName){
// cookies are separated by semicolons
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0]) return unescape(aCrumb[1]);
}
return null;
}