var xmlHttp
function changeVis(str) {
prodid = str;
if (str.length==0)
 { 
 document.getElementById("visibility"+prodid).innerHTML = "<img src='images/indicator.gif' alt='Odota hetki..' title='Odota hetki..' border='0' />";
 }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="scripts/changeVisibility.php"
url=url+"?id="+prodid
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 document.getElementById("visibility"+prodid).innerHTML=xmlHttp.responseText;
	 } 
	 if(document.getElementById("prodListBox"+prodid).className = "ProdBoxList") {
		document.getElementById("prodListBox"+prodid).setAttribute("class","ProdBoxListHidden");
	 } else if(document.getElementById("prodListBox"+prodid).className = "ProdBoxListHidden") {
		document.getElementById("prodListBox"+prodid).setAttribute("class","ProdBoxList");
	 }
}
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;
}