 function init(){
     makeEditable('desc');
 }

 function makeEditable(id){
     Event.observe(id, 'click', function(){edit($(id))}, false);
     Event.observe(id, 'mouseover', function(){showAsEditable($(id))}, false);
     Event.observe(id, 'mouseout', function(){showAsEditable($(id), true)}, false);
 }

 function showAsEditable(obj, clear){
     if (!clear){
          Element.addClassName(obj, 'editable');
     }else{
          Element.removeClassName(obj, 'editable');
     }
 }
 var http, url, div, vars;

function outputResponse(){
	//var myOutput = theOutput;
   document.getElementById(div).innerHTML = http.responseText;
}

function handleHttpResponse() {
  if (http.readyState == 4) {
	outputResponse();
  }
}

function ajax(p_url,p_div,p_vars) {
  url = p_url; div = p_div; vars = p_vars; http = getHTTPObject();
  http.open("GET", url + vars, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
 }
 
function getHTTPObject() {
  var xmlhttp;
    /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

