//***********************
//Boosh Chain Controller*
//***********************

function setCookie()
{
  document.cookie = 'chain=1';
}

function rmCookie() {
  document.cookie = 'chain=0';
}

//*****************
//Yesterday Popups*
//*****************

function mIn(bleh) {
  document.getElementById(bleh).style.visibility="visible";
}

function mOut(bleh) {
  document.getElementById(bleh).style.visibility="hidden";
}
function cIn(bleh) {
  document.getElementById(bleh).style.background="#0F0F0F";
  document.getElementById(bleh).style.color="cyan";
}

function cOut(bleh) {
  document.getElementById(bleh).style.background="#4F2F4F";
  document.getElementById(bleh).style.color="white";
}

function go(here) {
  window.location=here;
  return false;
}

//********************
//Boosh Refresh Block*
//********************

function onRefresh(evt,obj) {
  var keyCode = null;

  if(evt.which) {
    keyCode = evt.which;
  }
  else if(evt.keyCode) {
    keyCode = evt.keyCode;
  }
  if(keyCode == 116) {
    obj.click();
    return false;
    void(0);
  }
  return true;
}

//**************************
//onEnter Function for chat*
//*************************

function onEnter(evt,frm,obj) {
  var keyCode = null;

  if(evt.which) {
    keyCode = evt.which;
  }
  else if(evt.keyCode) {
    keyCode = evt.keyCode;
  }
  if(13 == keyCode) {
    obj.click();
    return false;
  }
return true;
}


//*****************
//Chat URL Encoder*
//*****************

function urlencode(str) {
  str = str.replace('%20', '+');
  str = str.replace('&', '%amp');
  str = str.replace('+', '%pls');
  str = str.replace('#', '%num');
  str = str.replace("'", '%apo');
  str = str.replace('*', '%2A');
  str = str.replace('/', '%2F');
  str = str.replace('@', '%40');
  return str;
}

