var xmlHttp
var nameID
var valueA

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function load_data(str, q)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
nameID = str;
valueA = q;

var url=str+".php";
url=url+"?q="+valueA;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

if (nameID == 'mainlist')
{
      document.getElementById('content').innerHTML='&nbsp;';
      /*
      document.getElementById('mainlist').style.height = '10px';
      document.getElementById('content').style.height = '100%';
      document.getElementById('mainlist').style.height = document.getElementById('content').offsetHeight - 100;
      */
}
}

function stateChanged()
{ 
if (xmlHttp.readyState==4)
{
/*if (nameID == 'content')
{
    document.getElementById('content').style.height = document.getElementById('mainlist').offsetHeight + 100;
}*/

document.getElementById(nameID).innerHTML=xmlHttp.responseText;
document.getElementById('loading').style.visibility = 'hidden';
document.getElementById('backlayer').style.visibility = 'hidden';

if (nameID == 'front')
{
  show_mainbody(valueA);
}

}
else
{
  if(navigator.appName == "Netscape"){
  windowwidth = window.innerWidth;
  windowheight = window.innerHeight;
  }else if(navigator.appName == "Microsoft Internet Explorer"){
  windowwidth = document.body.clientWidth;
  windowheight = document.body.clientHeight;
  }else{
  windowwidth = 0;
  windowheight = 0;
  }

  if (windowwidth != 0)
  {
      document.getElementById('backlayer').style.height = windowheight;
      document.getElementById('loading').style.height = windowheight;
  }

document.getElementById('backlayer').style.visibility = 'visible';
document.getElementById('loading').style.visibility = 'visible';

/*if (nameID == 'mainlist')
{
    document.getElementById('content').style.height = document.getElementById('mainlist').offsetHeight + 100;

    img1 = new Image();
    img1.src = "items/01.jpg";
} */

}
}

