function replaceAll(inSTR, inTOK, inREP) {
 var s;
 s = inSTR + "";
 while (s.indexOf(inTOK) >= 0) {
  s = s.replace(inTOK, "§");
 };
 while (s.indexOf("§") >= 0) {
  s = s.replace("§", inREP);
 };
 return s;
};

function showPopup(page, width, height) { var top=(screen.height-height)/2;var left=(screen.width-width)/2;window.open(page,'','top='+top+',left='+left+',width='+width+',height='+height+',resizable=yes,location=no,directories=no');}

function SetCookie(name, value, days) {
     var expire = new Date ();
     expire.setTime (expire.getTime() + (24 * 60 * 60 * 1000) * days);
     document.cookie = name + "=" + escape(value) + "; expires=" +expire.toGMTString();
}
function GetCookie(name) {
     var startIndex = document.cookie.indexOf(name);
     if (startIndex != -1) {
          var endIndex = document.cookie.indexOf(";", startIndex);
          if (endIndex == -1) endIndex = document.cookie.length;
          return unescape(document.cookie.substring(startIndex+name.length+1, endIndex));
     }
     else {
          return null;
     }
}
function DeleteCookie(name) {
     var expire = new Date ();
     expire.setTime (expire.getTime() - (24 * 60 * 60 * 1000));
     document.cookie = name + "=; expires=" + expire.toGMTString();
}
