	subject_id = '';
	function handleHttpResponse() {
		if (http.readyState == 4) {
			if (subject_id != '') {
				document.getElementById(subject_id).innerHTML = http.responseText;
			}
		}
	}
	function getHTTPObject() {
		var xmlhttp;
		/*@cc_on
		@if (@_jscript_version >= 5)
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (E) {
					xmlhttp = false;
				}
			}
		@else
		xmlhttp = false;
		@end @*/
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (e) {
				xmlhttp = false;
			}
		}
		return xmlhttp;
	}
	var http = getHTTPObject(); // We create the HTTP Object



	function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

function comment_form(div_afisare,view,artid)
		{
			subject_id = div_afisare;
  			http.open("GET", "include/comment_form.php?view="+view+"&artid="+artid, true);
			http.onreadystatechange = handleHttpResponse;
			http.send(null);
			//document.getElementById(nota).value ="";
		}

function comment_form_r(div_afisare,commid,artid)
		{
			subject_id = div_afisare;
  			http.open("GET", "include/comment_form.php?view=1&commid="+commid+"&artid="+artid, true);
			http.onreadystatechange = handleHttpResponse;
			http.send(null);
			//document.getElementById(nota).value ="";
		}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
	window.location.reload();
}
