/*function setEnable(class_name, id, to_do, to_do_text) {
  var returt_str=getServerData('admin.php?type=setEnable&class='+class_name+'&status_id='+id+'&to_do='+to_do);
  alert('fddf');
  if(returt_str) {
    document.getElementById('img'+id).src = '/images/admin/'+to_do+'.gif';
    document.getElementById('text'+id).innerHTML = to_do_text;
  }
}*/

function getElements(link) {
  var returt_str=getServerData(document.getElementById('elements'), link);
}

function getServerData(div, link) {
  document.body.style.cursor='wait';
  try{
    try{
      xmlhttp=new XMLHttpRequest();
    }
    catch(e) {
      var XMLHTTP_IDS=new Array(
      'MSXML2.XMLHTTP.5.0',
      'MSXML2.XMLHTTP.4.0',
      'MSXML2.XMLHTTP.3.0',
      'MSXML2.XMLHTTP',
      'Microsoft.XMLHTTP' );
      var success=false;
      for (var i=0;i < XMLHTTP_IDS.length && !success;i++) {
        try {
        xmlhttp=new ActiveXObject(XMLHTTP_IDS[i]);
        success=true;
        } catch (e) {}
      }
      if (!success) {
        try{
        xmlhttp=new HTML_AJAX_IframeXHR();
        } catch(e) {
          alert('Sorry. We are unable to load xml file. Please try again later.');
        }
      }
    }
    if(xmlhttp==null)
      return false;

    xmlhttp.open("GET", link,true);
    xmlhttp.onreadystatechange=function(){
      if(xmlhttp.readyState==4){
        var str = xmlhttp.responseText;
        if(div) {
          div.innerHTML = str;
          if(typeof init_ibox=="function") init_ibox();
        }
        document.body.style.cursor='auto';
        xmlhttp=null
      }
      else{
        if(div)
          div.innerHTML = "Loading in progress...";
      }
    };
    xmlhttp.send('');
  }
  catch (e) {
    alert("Server is not available at this time to process your request.");
  }
  return true;
}

var current_elem = '';
var current_status = '';

function setActiveTR(elem, classname){
    if(current_elem != '') current_elem.className = current_status;
    current_elem = elem;
    current_status = classname;
    elem.className = 'active';
}

function setMouseOverTR(elem){
    elem.className = 'over';
}

function setMouseOutTR(elem, classname){
    if(current_elem == elem)
        elem.className = 'active';
    else
        elem.className = classname;
    
}