function getlolmail(id) {
	var xmlHttp;
	try { xmlHttp=new XMLHttpRequest(); }
	catch (e) {
		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support the technology that allows rating on items."); return id; }
		}
	}
	xmlHttp.open("GET","viewuser.php?userid=" + id + "&other=eml",true); xmlHttp.send(null);
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var responsetext = xmlHttp.responseText;
			var emaildiv = document.getElementById('emailhide');
			responsetext = responsetext.replace('|-|', '.');
			responsetext = responsetext.replace('|---|', '@');
			emaildiv.innerHTML = responsetext;
		}
	}	
}

function logout_rollon() { document.getElementById('logoutrolldiv').style.backgroundImage = 'url(images/sideheadbot2revroll.png)'; }
function logout_rolloff() { document.getElementById('logoutrolldiv').style.backgroundImage = 'url(images/contentheadcornbot2.png)'; }
function logoutself_rollon() { document.getElementById('logoutrollli').style.backgroundImage = 'url(images/sideheadbot2rev.png)'; }
function logoutself_rolloff() { document.getElementById('logoutrollli').style.backgroundImage = 'url(images/contentheadbot2.png)'; }
function logoutside_rollon() { document.getElementById('logoutrollli').style.backgroundImage = 'url(images/sideheadbot2rev.png)'; }
function logoutside_rolloff() { document.getElementById('logoutrollli').style.backgroundImage = 'url(images/contentheadbot2.png)'; }
function toggle_content_visibility(id) {
	var contentbodydiv = document.getElementById('content' + id);
	var contentsubheaddiv = document.getElementById('contentsubhead' + id);
	if(contentbodydiv.style.display == 'block') {
		contentbodydiv.style.display = 'none';
	}
	else {
		contentbodydiv.style.display = 'block';
	}
}
function toggle_visibility(id) {
	var bodydiv = document.getElementById('comment' + id);
	var subheaddiv = document.getElementById('subhead' + id);
	if(bodydiv.style.display == 'block') {
		bodydiv.style.display = 'none';
		subheaddiv.style.borderBottomStyle = 'solid';
	}
	else {
		bodydiv.style.display = 'block';
		subheaddiv.style.borderBottomStyle = 'none';
	}
}





function contentreplyshow(id, title) {
	var contentreplydiv = document.getElementById('contentreply' + id);
	contentreplydiv.innerHTML = '<div align="right"><a href="javascript:{contentreplyhide(\'' + id + '\',\'' + title + '\');}">(Close comment)</a></div><hr /><form class="replyform" name="replyform" method="post" action="postreply.php?type=content&id=' + id + '">Title<br /><input type="text" name="titletxt" class="replytitlefield" value="' + title + '" /><br />Body<br /><textarea name="bodytxt" class="replybodyfield" cols="45" rows="5"></textarea><br /><input type="submit" name="submitcmd" class="admintextbox" style="width:100px" value="Submit Post" /><br /></form>';
}
function contentreplyhide(id, title) {
	var contentreplydiv = document.getElementById('contentreply' + id);
	contentreplydiv.innerHTML = '<div align="right"><a href="javascript:{contentreplyshow(\'' + id + '\',\'' + title + '\');}">(Comment on this file)</a></div>';
}

function commentreplyshow(id, title) {
	var commentreplydiv = document.getElementById('commentreply' + id);
	commentreplydiv.innerHTML = '<div align="right"><a href="javascript:{commentreplyhide(\'' + id + '\',\'' + title + '\');}">(Close comment)</a></div><hr /><form class="replyform" name="replyform" method="post" action="postreply.php?type=comment&id=' + id + '">Title<br /><input type="text" name="titletxt" class="replytitlefield" value="' + title + '" /><br />Body<br /><textarea name="bodytxt" class="replybodyfield" cols="45" rows="5"></textarea><br /><input type="submit" name="submitcmd" class="admintextbox" style="width:100px" value="Submit Post" /><br /></form>';
}
function commentreplyhide(id, title) {
	var commentreplydiv = document.getElementById('commentreply' + id);
	commentreplydiv.innerHTML = '<div align="right"><a href="javascript:{commentreplyshow(\'' + id + '\',\'' + title + '\');}">(Comment on this file)</a></div>';
}











function increaserating(id) {
	var xmlHttp;
	try { xmlHttp=new XMLHttpRequest(); }
	catch (e) {
		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support the technology that allows rating on items."); return id; }
		}
	}
	xmlHttp.open("GET","rate.php?type=comment&id=" + id + "&mod=u",true); xmlHttp.send(null);
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var responsetext = xmlHttp.responseText; var stateflag = responsetext.substring(0,responsetext.indexOf('|'));
			if (stateflag=='0') {
				responsetext = responsetext.replace(/0\|/g, ''); responsetext = responsetext.replace(/<br \/>/g, '\n')
				alert(responsetext);
			}
			else if (stateflag=='1') {
				currentrating = responsetext.replace(/1\|/g, '');
				var headratediv = document.getElementById('headrate' + id); var headratedivcontents = headratediv.innerHTML;
				if (currentrating >= 5) { headratediv.style.color = '#00FF00'; }
				else if (currentrating <= -2) { headratediv.style.color = '#FF0000'; } else { headratediv.style.color = '#CCCCCC'; }
				headratediv.innerHTML = currentrating + ' Rating <a href="javascript:{increaserating(\'' + id + '\');}"><img src="images/ratingup.png" border="0" /></a><a href="javascript:{decreaserating(\'' + id + '\');}"><img src="images/ratingdown.png" border="0" /></a>';
			}
		}
	}
}
function decreaserating(id) {
	var xmlHttp;
	try { xmlHttp=new XMLHttpRequest(); }
	catch (e) {
		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support the technology that allows rating on items."); return id; }
		}
	}
	xmlHttp.open("GET","rate.php?type=comment&id=" + id + "&mod=d",true); xmlHttp.send(null);
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var responsetext = xmlHttp.responseText; var stateflag = responsetext.substring(0,responsetext.indexOf('|'));
			if (stateflag=='0') {
				responsetext = responsetext.replace(/0\|/g, ''); responsetext = responsetext.replace(/<br \/>/g, '\n')
				alert(responsetext);
			}
			else if (stateflag=='1') {
				currentrating = responsetext.replace(/1\|/g, '');
				var headratediv = document.getElementById('headrate' + id); var headratedivcontents = headratediv.innerHTML;
				if (currentrating >= 5) { headratediv.style.color = '#00FF00'; }
				else if (currentrating <= -2) { headratediv.style.color = '#FF0000'; } else { headratediv.style.color = '#CCCCCC'; }
				headratediv.innerHTML = currentrating + ' Rating <a href="javascript:{increaserating(\'' + id + '\');}"><img src="images/ratingup.png" border="0" /></a><a href="javascript:{decreaserating(\'' + id + '\');}"><img src="images/ratingdown.png" border="0" /></a>';
			}
		}
	}
}

function increasecontentrating(id) {
	var xmlHttp;
	try { xmlHttp=new XMLHttpRequest(); }
	catch (e) {
		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support the technology that allows rating on items."); return id; }
		}
	}
	xmlHttp.open("GET","rate.php?type=content&id=" + id + "&mod=u",true); xmlHttp.send(null);
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var responsetext = xmlHttp.responseText; var stateflag = responsetext.substring(0,responsetext.indexOf('|'));
			if (stateflag=='0') {
				responsetext = responsetext.replace(/0\|/g, ''); responsetext = responsetext.replace(/<br \/>/g, '\n')
				alert(responsetext);
			}
			else if (stateflag=='1') {
				currentrating = responsetext.replace(/1\|/g, '');
				var headratediv = document.getElementById('contentheadrate' + id); var headratedivcontents = headratediv.innerHTML;
				if (currentrating >= 5) { headratediv.style.color = '#00FF00'; }
				else if (currentrating <= -2) { headratediv.style.color = '#FF0000'; } else { headratediv.style.color = '#CCCCCC'; }
				headratediv.innerHTML = currentrating + ' Rating <a href="javascript:{increasecontentrating(\'' + id + '\');}"><img src="images/ratingup.png" border="0" /></a><a href="javascript:{decreasecontentrating(\'' + id + '\');}"><img src="images/ratingdown.png" border="0" /></a>';
			}
		}
	}
}
function decreasecontentrating(id) {
	var xmlHttp;
	try { xmlHttp=new XMLHttpRequest(); }
	catch (e) {
		try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support the technology that allows rating on items."); return id; }
		}
	}
	xmlHttp.open("GET","rate.php?type=content&id=" + id + "&mod=d",true); xmlHttp.send(null);
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var responsetext = xmlHttp.responseText; var stateflag = responsetext.substring(0,responsetext.indexOf('|'));
			if (stateflag=='0') {
				responsetext = responsetext.replace(/0\|/g, ''); responsetext = responsetext.replace(/<br \/>/g, '\n')
				alert(responsetext);
			}
			else if (stateflag=='1') {
				currentrating = responsetext.replace(/1\|/g, '');
				var headratediv = document.getElementById('contentheadrate' + id); var headratedivcontents = headratediv.innerHTML;
				if (currentrating >= 5) { headratediv.style.color = '#00FF00'; }
				else if (currentrating <= -2) { headratediv.style.color = '#FF0000'; } else { headratediv.style.color = '#CCCCCC'; }
				headratediv.innerHTML = currentrating + ' Rating <a href="javascript:{increasecontentrating(\'' + id + '\');}"><img src="images/ratingup.png" border="0" /></a><a href="javascript:{decreasecontentrating(\'' + id + '\');}"><img src="images/ratingdown.png" border="0" /></a>';
			}
		}
	}
}
