function addSubtractWatch(main_art_id) {
	var xmlHttpReq, url;
	
	xmlHttpReq = GetXmlHttpReqObject();
	
	url = "/watch/comments.php?main_art_id=" + main_art_id;

	xmlHttpReq.onreadystatechange = function() {
		addWatchReqSC(xmlHttpReq);
	};
	
	xmlHttpReq.open("GET",url,true);
	xmlHttpReq.send(null);	
	
}

function addWatchReqSC(xmlHttpReq) {
	var xmlDoc, errorText, status, errorDoc, statusDoc, commentWatchImgObj;
	
	if (xmlHttpReq.readyState==4) {
		xmlDoc = xmlHttpReq.responseXML.getElementsByTagName("RESPONSE")[0];
		
		statusDoc = xmlDoc.getElementsByTagName("STATUS");
		
		status = statusDoc[0].childNodes[0].nodeValue;
		
		// Bija kaut kāda kļūda
		if (status == 0) {
			errorDoc = xmlDoc.getElementsByTagName("ERROR_TEXT");
			errorText = errorDoc[0].childNodes[0].nodeValue;
			alert(errorText);
		}
		// Bija kaut kāda kļūda
		else {
			commentWatchImgObj = document.getElementById("comment_watch_img");
			
			// Tika pievienots
			if (status == 1) {
				commentWatchImgObj.src = "/images/unsubscribe_comments.gif";
				commentWatchImgObj.title = "Atrakstīties no komentāru izmaiņām";
			}
			// Tika atvienots
			else {
				commentWatchImgObj.src = "/images/subscribe_comments.gif";
				commentWatchImgObj.title = "Parakstīties uz komentāru izmaiņām";
			}

					
		}
		
	}
}