function setCookie(c_name,value,expiredays)
{
  var exdate=new Date();
  exdate.setDate(exdate.getDate()+expiredays);
  document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString());
}

function text(v) {
  if(v == "cpp") return "C++";
  if(v == "c") return "C";
  if(v == "mb") return "multibyte";
  if(v == "u") return "unicode";  
  return "?";
}

function not(v) {
  if(v == "cpp") return "c";
  if(v == "c") return "cpp";
  if(v == "mb") return "u";
  if(v == "u") return "mb";
  return "?";
}


function showInvoice(l) {
  s = "<div class=\"lsw\">language:<select style=\"font-size:1.1em;\" onchange=\"javascript:showInvoice(this.options[this.selectedIndex].value)\"><option value=\"c\">C</option><option value=\"cpp\"";
  if(l == "cpp") s += " selected";
  s += ">C++&nbsp;</option><option value=\"cs\"";
  if(l == "cs") s += " selected";
  s += ">C#&nbsp;</option></select></div>";
  document.getElementById("example").innerHTML = s + document.getElementById("invoice-" + l).innerHTML;
  lang = l;
  setCookie("lang", lang, 365);
}
