function nothing() {}

function t(name, type) {
    document.getElementById(name).style.display = type;
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function RM_popupImage(image) {
    var image;

    if (!image) {
        alert('popupimage() error: no image supplied');
        return false;
    }

    confirmWin = RM_popup(image,'popupImage',550,450,true);

    if (confirmWin != null) {
        confirmWin.focus();
        popupContent = "<html><body onload=\"window.resizeTo(document.images[0].width+60,document.images[0].height+60);window.resizeTo(document.images[0].width+6,document.images[0].height+47);\" style=\"border:0;margin:0;padding:0;\"><img id=\"image\" onClick=\"window.close()\" src=\""+image+"\"></body></html>";
        confirmWin.document.open();
        confirmWin.document.write(popupContent);
        confirmWin.document.close();
    }
}

function RM_popup(url,name,w,h,image) {
    var url;
    if (!url) {
        alert('popupimage() error: no url supplied');
        return false;
    }
    if(!name) var name = 'popup';
    if(!w) var w = 480;
    if(!h) var h = 545;
    var screen_w = screen.availWidth || screen.width;
    var screen_h = screen.availHeight || screen.height;
    var opts = 'width='+w+',height='+h;
    if(image) {
        opts += ',scrollbars=no,resizable=no,menubar=no';
    }
    else {
        opts += ',scrollbars=yes,resizable=yes,menubar=yes';
    }
    if (screen_h > 0 && screen_w > 0) {
        var ha_value = (screen_w / 2) - (w / 2);
        var va_value = (screen_h / 2) - (h / 2);
        opts += ',left='+ha_value+',top='+va_value;
    }
    var confirmWin = window.open(url, name, opts);
    if (confirmWin != null) {
        confirmWin.focus();
    }
    if(image) {
        return confirmWin;
    }
}

function t_show(id) { t(id+"_f", '');t(id+"_h", 'none'); }
function t_hide(id) { t(id+"_h", '');t(id+"_f", 'none'); }
