function get_ajaxobj() { var xmlhttp= false; try { xmlhttp= new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { } } if(!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function likedislike(title, type, uid, islike, isclick, key) { var msg= window.document.getElementById("msg_" + uid); var like= window.document.getElementById("like_" + uid); if(isclick == 1) { msg.innerHTML= "posting..."; } var unlike= window.document.getElementById("unlike_" + uid); var aj= get_ajaxobj(); var url= "/kommon/bin/sr.php?kall=likedislike&title=" + title + "&type=" + type + "&islike=" + islike + "&isclick=" + isclick + "&key=" + key; aj.open("GET", url, true); aj.onreadystatechange=function() { if(aj.readyState == 4 && aj.status == 200) { var myString= aj.responseText; var responce= myString.split("!"); if(responce[0] == 'R') { msg.innerHTML = "already posted"; } else if(responce[0] == 'error') { msg.innerHTML = ""; } else { msg.innerHTML = ""; like.innerHTML = "(" + responce[1] + ")"; unlike.innerHTML = "(" + responce[2] + ")"; }; }; }; aj.send(url); }; function reg(uid, islike) { var div= document.getElementById("likedislike_canvas_" + uid); if(div != null) { var title= div.getAttribute("nvtitle"); var type= div.getAttribute("nvtype"); var key= div.getAttribute("key"); likedislike(title, type, uid, islike, 1, key); } } function onload_likedislike(uid) { var div= document.getElementById("likedislike_canvas_" + uid); if(div != null) { var title= div.getAttribute("nvtitle"); var type= div.getAttribute("nvtype"); var key= div.getAttribute("key"); div.innerHTML= ""; var html= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= ""; html+= "
Did you find this article
Useful Not Useful 
"; div.innerHTML= html; likedislike(title, type, uid, 1, 0, key); //html+= "Useful"; //html+= "Not Useful"; }; }