	function ajaxDo(option_type,option_id)
	{ 
		var req = null; 
		var option_type = option_type;
		var option_id = option_id;
		var link = "/do_ajax/" + option_type +"/" + option_id;

		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject("Microsoft.XMLHTTP"); 

		req.onreadystatechange = function()
		{ 
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					if(option_type == 'favorite')
					{
						document.getElementById("favorite_id").innerHTML=req.responseText;
					}
					if(option_type == 'download')
					{
						document.getElementById("download_id").innerHTML=req.responseText;
					}
				}	
			} 
		}; 
		req.open("POST", link, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 
	}
	
	function doVote(item_id,vote_id)
	{ 
		var req = null; 
		var vote_id = vote_id;
		var item_id = item_id;
		var link = "/do_ajax/vote/" + item_id +"/" + vote_id;

		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject("Microsoft.XMLHTTP"); 

		req.onreadystatechange = function()
		{ 
			if(req.readyState == 4)
			{					
				if(req.status == 200)
				{
					document.getElementById("item_rating").innerHTML=req.responseText;
				}	
			} 
		}; 
		req.open("POST", link, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 
	}
	
	var copytoclip=1;

function HighlightAll(theField)
{
	var tempval=eval("document."+theField);
	tempval.focus();
	tempval.select();
	if (document.all&&copytoclip==1)
	{
		therange=tempval.createTextRange();
		therange.execCommand("Copy");
		window.status="Content highlighted and copied to clipboard!";
		setTimeout("window.status=''",1800);
	}
}