function getHttpReqObj() {
	if (window.XMLHttpRequest) {
		xmlhttp=new XMLHttpRequest();
	} else {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xmlhttp;
}
function rate(id,rating) {
	document.getElementById("rv"+id).innerHTML = '... ';
	xmlhttp = getHttpReqObj();
	xmlhttp.open("GET", "ajax/rate.php?rating="+rating+"&id="+id, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById("rv"+id).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}
function commenthl(b) { var a=document.getElementsByTagName("div"); for(i=0;i<a.length;i++) { if(a[i].className=="c1hl") { a[i].className ="c1"; } else if(a[i].className=="c2hl") { a[i].className ="c2"; } if(a[i].id==b) { if(a[i].className=="c1") { a[i].className="c1hl"; } else if(a[i].className=="c2") { a[i].className="c2hl"; } } } }

function popShowHide() {
	var popclass = document.getElementById("pop").className;
	if(popclass=="") popclass = "popa"; else popclass = "";
	document.getElementById("pop").className = popclass;
}

window.onload = function() {
	var addiv = document.getElementById("leadad");
	if(addiv.offsetHeight == 0) {
		xmlhttp = getHttpReqObj();
		xmlhttp.open("GET", "tshirthell/index.php", true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("leadad").innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.send(null);
	}
}

