function getList(Cprod,Listtype,Mfgr,HT,HD,osCsid) {

  Loading('list_area');

  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null) {
    alert ("Your browser does not support AJAX!");
    return;
  } 
  var url="/common/ajax/getList.php";
  url=url+"?Currprod="+Cprod;
  url=url+"&Listtype="+Listtype;
  url=url+"&mfgr="+Mfgr;
  url=url+"&HT="+HT;
  url=url+"&HD="+HD;
  url=url+"&osCsid="+osCsid;

  xmlHttp.onreadystatechange=function(){stateChange('list_area',Listtype)};
  xmlHttp.open("POST",url,true);
  xmlHttp.send(null);
}

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 Loading(field) 
{ 
    document.getElementById(field).innerHTML="Loading.....";
}

function Blank(field) 
{ 
    document.getElementById(field).innerHTML="";
}

function stateChange(field,Listtype) 
{ 
  if (xmlHttp.readyState==4) { 
    document.getElementById(field).innerHTML=xmlHttp.responseText;
    if (Listtype == "app" | Listtype == "costapp") selectTab2('hometheater');
  }
}

function hide( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function addsub(email) {

  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null) {
    alert ("Your browser does not support AJAX!");
    return;
  } 
  var url="http://visitor.constantcontact.com/d.jsp?m=1101752866182&p=oi&ea=";
  url=url+email;

  xmlHttp.onreadystatechange=function(){stateChange('list_area',Listtype)};
  xmlHttp.open("POST",url,true);
  xmlHttp.send(null);

}

function getModel(Cprod,Mfgr,osCsid) {

  Blank('Modelinfo');

  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null) {
    alert ("Your browser does not support AJAX!");
    return;
  } 
  var url="/common/ajax/getModel.php";
  url=url+"?Currprod="+Cprod;
  url=url+"&mfgr="+Mfgr;
  url=url+"&osCsid="+osCsid;

  xmlHttp.onreadystatechange=function(){stateChange('Modelnumber')};
  xmlHttp.open("POST",url,true);
  xmlHttp.send(null);
}

function getModelinfo(Cprod,Mfgr,Model,osCsid) {

  Loading('Modelinfo');

  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null) {
    alert ("Your browser does not support AJAX!");
    return;
  } 
  var url="/common/ajax/getModelinfo.php";
  url=url+"?Currprod="+Cprod;
  url=url+"&mfgr="+Mfgr;
  url=url+"&model="+Model;
  url=url+"&osCsid="+osCsid;

  xmlHttp.onreadystatechange=function(){stateChange('Modelinfo')};
  xmlHttp.open("POST",url,true);
  xmlHttp.send(null);
}

function stateChange2(field) {
  if (xmlHttp.readyState==4) { 
    document.getElementById(field).innerHTML=xmlHttp.responseText;
  }
}


