/**
 * Make a popup window
 */
function popUp(URL,w,h,scrollbars) {
  day = new Date();
  id = day.getTime();
  URL = URL + '&w=' + w + "&h=" + h;
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + scrollbars + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + "');");
}

/**
 * reads the cookie from client side
 */
function getCookie(c_name) {
  if (document.cookie.length>0)
    {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1)
      { 
      c_start=c_start + c_name.length+1; 
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) c_end=document.cookie.length;
      return unescape(document.cookie.substring(c_start,c_end));
      } 
    }
  return "";
}

/**
 * Sets a cookie that expires in one year
 */
function setCookie(c_name, value) {

  //set up the year away expiration date for cookie setting
  var expiryDate = new Date();
  expiryDate.setTime(expiryDate.getTime()+60*60*24*365*1000);
  
  var cookie = c_name + "=" + value + "; expires= " + expiryDate.toGMTString() + ";path=/;domain=" + whoIs.sessionDomain;
  document.cookie = cookie;  
}