


function report(typey,id)
{
	document.getElementById("report_"+typey+"_"+id).style.display="inline";
}

function reportFinal(typey,id)
{
	xhGET("/l/report/"+typey+"/"+id,handlereport,typey,id,"");
}

function collapse(id) {
	var start = document.getElementById("comment_"+id);
	var extraspacer = document.getElementById("comment_exspacer_"+id);
	var extra = document.getElementById("excomment_"+id);
	if (start) {
		if (commentChildren[id]) {
			if (commentChildren[id].length > 0) {
				//alert(id+" has "+commentChildren[id].length+" children");
				for (l in commentChildren[id]) {
					//alert("recursing with l="+l);
					hideThread(commentChildren[id][l]);
				}
			}
		}
		if (extraspacer)
			hide("comment_exspacer_"+id);
		if (extra)
			hide("excomment_"+id);
		//update collapse to expand.
		curanch = document.getElementById("colapse_comment_"+id);
		curanch.innerHTML="[+]";
		curanch.href="javascript:expand('"+id+"');";
	}
}

function hideThread(id) {
	//alert("hidan thread "+id);
	var start = document.getElementById("comment_"+id);
	var startspacer = document.getElementById("comment_spacer_"+id);
	var extraspacer = document.getElementById("comment_exspacer_"+id);
	var extra = document.getElementById("excomment_"+id);
	var brs = document.getElementById("comment_br_"+id);
	if (start) {
		if (commentChildren[id]) {
			if (commentChildren[id].length > 0) {
				//alert(id+" has "+commentChildren[id].length+" children");
				for (l in commentChildren[id]) {
					//alert("recursing with l="+l);
					hideThread(commentChildren[id][l]);
				}
			}
		}
		if (start)
			hide("comment_"+id);
		if (startspacer)
			hide("comment_spacer_"+id);
		if (extraspacer)
			hide("comment_exspacer_"+id);
		if (extra)
			hide("excomment_"+id);
		if (brs)
			hide("comment_br_"+id);
	}
	return;
}


function expand(id) {
	var start = document.getElementById("comment_"+id);
	var extraspacer = document.getElementById("comment_exspacer_"+id);
	var extra = document.getElementById("excomment_"+id);
	if (start) {
		if (commentChildren[id]) {
			if (commentChildren[id].length > 0) {
				for (l in commentChildren[id]) {
					showThread(commentChildren[id][l]);
				}
			}
		}
		if (extraspacer)
			show("comment_exspacer_"+id);
		if (extra)
			show("excomment_"+id);
		//update collapse to expand.
		curanch = document.getElementById("colapse_comment_"+id);
		curanch.innerHTML="[-]";
		curanch.href="javascript:collapse('"+id+"');";
	}
}

function showThread(id) {
	var start = document.getElementById("comment_"+id);
	var startspacer = document.getElementById("comment_spacer_"+id);
	var extraspacer = document.getElementById("comment_exspacer_"+id);
	var extra = document.getElementById("excomment_"+id);
	var brs = document.getElementById("comment_br_"+id);
	if (start) {
		if (commentChildren[id]) {
			if (commentChildren[id].length > 0) {
				//alert(id+" has "+commentChildren[id].length+" children");
				for (l in commentChildren[id]) {
					//alert("recursing with l="+l);
					showThread(commentChildren[id][l]);
				}
			}
		}
		if (start)
			show("comment_"+id);
		if (startspacer)
			show("comment_spacer_"+id);
		if (extraspacer)
			show("comment_exspacer_"+id);
		if (extra)
			show("excomment_"+id);
		if (brs)
			show("comment_br_"+id);
	}
}
