function fetch(url, id)
{
	var http; 
	try
	{
		http = new XMLHttpRequest();
	}                 
	catch(e) 
	{    
		http = new ActiveXObject(Microsoft.XMLHTTP);
	} 
	http.onreadystatechange = function()
	{ 
		if(http.readyState == 4)
		{
			if(http.status == 200) 
			{
				document.getElementById(id).innerHTML = http.responseText;
			}
			else
			{
				document.getElementById(id).innerHTML = 'Error';
			}
		}
	}; 
   http.open('GET', url, true); 
	http.send(null); 
}

function showads(w, h)
{
	document.writeln('<iframe src="/ads.php?type=' + w + '" width="' + w + '" height="' + h + '" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>');
}

function show_comment(id)
{
	document.getElementById('comment_' + id).style.display = 'block';
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "e")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


