function addToWatchlist(site_id) { 
	var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
  		alert ("Your browser does not support AJAX!");
  		return;
  	} 
  	document.getElementById("imgw_"+site_id).src='images/rotator.gif';

  	
  	var url="reports.php";
	url=url+"?action=addwatch&ajax=yes&id="+site_id;
	
	xmlHttp.onreadystatechange=function () { 
		if (xmlHttp.readyState==4) { 
			if(xmlHttp.responseText=='OK'){
				document.getElementById("imgw_"+site_id).src='images/minus.gif';
				document.getElementById("link_"+site_id).href='javascript:removeFromWatchlist('+site_id+')';
				document.getElementById("link_"+site_id).title='Remove from watchlist';
				document.getElementById("imgw_"+site_id).title='Remove from watchlist';
			} else {
				document.getElementById("imgw_"+site_id).src='images/plus.gif';
			};
		}
	};
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function removeFromWatchlist(site_id) { 
	var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
  		alert ("Your browser does not support AJAX!");
  		return;
  	} 
  	document.getElementById("imgw_"+site_id).src='images/rotator.gif';

  	
  	var url="reports.php";
	url=url+"?action=removewatch&ajax=yes&id="+site_id;
	
	xmlHttp.onreadystatechange=function () { 
		if (xmlHttp.readyState==4) { 
			if(xmlHttp.responseText=='OK'){
				document.getElementById("imgw_"+site_id).src='images/plus.gif';
				document.getElementById("link_"+site_id).href='javascript:addToWatchlist('+site_id+')';
				document.getElementById("link_"+site_id).title='Add to watchlist';
				document.getElementById("imgw_"+site_id).title='Add to watchlist';
			} else {
				document.getElementById("imgw_"+site_id).src='images/minus.gif';
			};
		}
	};
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}