function nw_desk(catalog, id){
 window.open('/scripts/desk.php?catalog=' + catalog + '&id=' + id ,'_blank','scrollbars=1,resizable=1,width=800,height=500');
 return false;
}

function nw_add(catalog, id){
 window.open('/scripts/content_order.php?catalog=' + catalog + '&id=' + id ,'_blank','scrollbars=1,resizable=1,width=400,height=150');
 return false;
}

function c(catalog, str){
 var url = '/scripts/content_view.php?catalog=' + catalog + '&q=' + str;
 xml_http(url, 'content');
 return false;
}

function g(g){
 if(document.getElementById('g' + g).style.display=='none'){
    document.getElementById('g' + g).style.display='block';
 }else{
    document.getElementById('g' + g).style.display='none';
 }
    return false;
}


function xml_http(url,id){

 var agt    = navigator.userAgent.toLowerCase();
 var is_op  = (agt.indexOf('opera')  != -1);
 var is_ie  = (agt.indexOf('msie')   != -1) && document.all && !is_op;
 var is_ie5 = (agt.indexOf('msie 5') != -1) && document.all && !is_op;

 var xmlhttp = null;

 if (is_ie){
  var control = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
      try{
           xmlhttp = new ActiveXObject(control);
      }catch (ex){
           alert('You need to enable active scripting and activeX controls');
           return;
      }
 }else{
  xmlhttp = new XMLHttpRequest();
 }

  // wait msg
  document.getElementById(id).innerHTML = '<p>loading...</p>';

  xmlhttp.open('GET', url,  true);

  xmlhttp.onreadystatechange = function (){
      if (xmlhttp.readyState == 4){
       document.getElementById(id).innerHTML = xmlhttp.responseText;
      }
  }
  xmlhttp.send(null);
}

