

        function $(el) {return document.getElementById(el);}
	var http; function createhttp(){if(window.ActiveXObject){http = new ActiveXObject("Microsoft.XMLHTTP");} else if (window.XMLHttpRequest){http = new XMLHttpRequest();}}
	function getthx(t){
if( confirm("คุณแน่ใจว่าต้องการยืนยันการสั่งซื้อสินค้ารายการนี้?") ) {
createhttp();http.open("GET","thankcool.php?tid="+t, true);http.onreadystatechange = function(){if(http.readyState == 4){if(http.status == 200){addthx();}}};http.send(null);
}
		function addthx(){gt = http.responseText;
			if($("whothx"+t).innerHTML != "."){
				$("whothx"+t).innerHTML = ", "+gt;
				}else{
					$("whothx"+t).style.display = "";
					$("whothx"+t).innerHTML = gt;
					$("thxby"+t).style.display = "";
					}
				$("tbutton"+t).style.display = "none";
				$("tdbutton"+t).innerHTML = "ท่านได้ทำการยืนยันการสั่งซื้อเรียบร้อย";
				}
			}
