   function getURLParam(strParamName){
     var strReturn = "";
     var strHref = window.location.href;
     if (strHref.indexOf("?") > -1){
         var strQueryString = strHref.substr(strHref.indexOf("?"));
         var aQueryString = strQueryString.split("&");
         for (var iParam = 0; iParam < aQueryString.length; iParam++){
              if (aQueryString[iParam].indexOf(strParamName + "=") > -1){
                  var aParam = aQueryString[iParam].split("=");
                  strReturn = aParam[1];
                  break;
              }
         }
     }
     
     return unescape(strReturn);
   }
   
   //////////////////////////////////////////////////
   // Open popup window 
   //////////////////////////////////////////////////
   function openPopup(url, winName, popWidth, popHeight, popMenu, popScroll, popStatus, isCenter, isResizable) {
     // popStatus is a new parameter; it is optional so that old calls will not cause an error
     if (isCenter) {
       x = Math.floor((screen.width - popWidth)/2);
	    y = Math.floor((screen.height - popHeight )/2);
	  } else {
	    x = 25;
	    y = 140;
	  }
     var statusBar = (popStatus == null) ? popScroll : popStatus;
     var isResizable = (isResizable == null) ? "no" : isResizable;
     var ns = navigator.appName == "Netscape";
     if (popStatus != null && popStatus == "yes") {
       // 'fix' for Mac IE's problem when including a status bar in the pop up window
       // - the browser chops off the bottom 18 pixels of the window to accomodate for the
       //   the status bar, and so we add 18 pixels to the height
       isMac = (navigator.appVersion.indexOf("Mac") == -1) ? false : true;
       if (!ns && isMac) { popHeight = String(Number(popHeight) + 18); }
     }

     if(win) {
       win.close();
       setTimeout('openPopup(url, winName, popWidth, popHeight, popMenu, popScroll, popStatus, isCenter)',1000);
       return;
     }

     if ((navigator.appVersion.indexOf("MSIE") != -1)){
        var win=window.open(url, winName,'width=' + popWidth + ',height=' + popHeight + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ',menubar='+ popMenu + ',scrollbars=' + popScroll + ',resizable='+isResizable +',status=' + statusBar + '');
     }
     else {
        var win=window.open(url, winName,'width=' + popWidth + ',height=' + popHeight + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ',toolbar='+ popMenu + ',scrollbars=' + popScroll + ',resizable='+isResizable +',status=' + statusBar + '');
     }

     if (win.opener == null) win.opener = self;

     if ((navigator.appVersion.indexOf("MSIE 4.01") != -1)){
        return;
     }
     else {
        win.focus();
     }
   }   