var xmlHttp

function showServer(mode,frm)
{ 
var comment=frm.coment.value;
var email=frm.email.value;
var comment=frm.coment.value;
var adid=frm.adviceid.value;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
  if(mode=='image')
  {
var url="getimage.php?q="+mode+"&sid="+id;
xmlHttp.onreadystatechange=stateChanged;
  }
  if(mode=='view')
  {
   var url="getviewimage.php?sid="+id;  
   xmlHttp.onreadystatechange=stateChanged2;
  }
   if(mode=='cat')
  {
   var url="getcolor.php?sid="+id;  
   xmlHttp.onreadystatechange=stateChanged3;
  }
   if(mode=='comment')
  {
   var url="coment.php?mail="+email+"&cmt="+comment+"&id="+adid;  
   xmlHttp.onreadystatechange=stateChanged4;
  }


xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("divshipinfo").innerHTML=xmlHttp.responseText;
}
}
function stateChanged2() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("divviewimage").innerHTML=xmlHttp.responseText;
}
}


function stateChanged3() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("divviewcolor").innerHTML=xmlHttp.responseText;
}
}

function stateChanged4() 
{ 
if (xmlHttp.readyState==4 )
{ 

document.getElementById("cmnt").style.display='none';

}

}

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;
}