var xmlHttpAction;var parametru;function check(varc,idcat) {parametru=varc;if(document.getElementById("prod"+varc)){document.getElementById("prod"+varc).childNodes.item(0).style.display="none";document.getElementById("prod"+varc).childNodes.item(1).style.display="block";} getIndexXMLCHECK(idcat);} function uncheck(varc,idcat) {parametru=varc;if(document.getElementById("prod"+varc)){document.getElementById("prod"+varc).childNodes.item(1).style.display="none";document.getElementById("prod"+varc).childNodes.item(0).style.display="block";} getIndexXMLUNCHECK(idcat);} function GetObject(){var xmlHttpAction=null;try{xmlHttpAction=new XMLHttpRequest();}catch(e){try{xmlHttpAction=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlHttpAction=new ActiveXObject("Microsoft.XMLHTTP");}} return xmlHttpAction;} function getIndexXMLCHECK(idcat){xmlHttpAction=GetObject();if(xmlHttpAction==null){alert("Browserul dvs nu suporta AJAX!");return;} var url="/comparare_ajax.php?act=check&idcat="+idcat+"&id="+parametru;xmlHttpAction.onreadystatechange=changeState;xmlHttpAction.open("GET",url,true);xmlHttpAction.send(null);} function getIndexXMLUNCHECK(idcat){xmlHttpAction=GetObject();if(xmlHttpAction==null){alert("Browserul dvs nu suporta AJAX!");return;} var url="/comparare_ajax.php?act=uncheck&idcat="+idcat+"&id="+parametru;xmlHttpAction.onreadystatechange=changeState;xmlHttpAction.open("GET",url,true);xmlHttpAction.send(null);} function changeState(){if(xmlHttpAction.readyState==4) {var xmlDoc=xmlHttpAction.responseText;document.getElementById("comparare").innerHTML=xmlDoc;}}