var browser; var cerere; var cont; var nume; var id_articol; var autor;
var complete_path="/";

function get_article_content(name, id, author) {
	 nume = name;
	 id_articol = id;
	 autor = author;
	 browser=navigator.appName;
	 cerere = false;
	 cont=document.getElementById("articleContent");
	 build_request(name, id, autor);
	 }	  
function build_request(name, id, author) {      
         if (browser=="Netscape") 
		cerere= new XMLHttpRequest();
		  
	 else   cerere = new ActiveXObject("Msxml2.XMLHTTP");
	var adresa=complete_path+"get_content_html.php?categ="+name+"&id="+id+"&author="+author;
        cerere.onreadystatechange = get_content_html; 
        cerere.open('GET', adresa, true);
        cerere.send(null);
    }

function get_content_html() {
	var response_text="";
	if (cerere.readyState == 4) {
		text="<ul id=\"articlemenu\">";
		if (nume == "text")
			text += "<li class=\"text active\">Text</li>";
		else text += "<li class=\"text\"><a href=\"#\" onclick=\"get_article_content('text', "+String(id_articol)+", '"+autor+"');\">Text</a></li>";
		text += " | ";
		if (nume == "foto")
			text += "<li class=\"foto active\">Foto</li>";
		else text += "<li class=\"foto\"><a href=\"#\" onclick=\"get_article_content('foto', "+String(id_articol)+", '"+autor+"');\">Foto</a></li>";
		text += " | ";
		if (nume == "video")
			text += "<li class=\"video active\">video</li>";
		else text += "<li class=\"video\"><a href=\"#\" onclick=\"get_article_content('video', "+String(id_articol)+", '"+autor+"');\">video</a></li>";
		text += " | ";
		if (nume == "comments")
			text += "<li class=\"comments active\">Comentarii</li>";
		else text += "<li class=\"comments\"><a href=\"#\" onclick=\"get_article_content('comments', "+String(id_articol)+", '"+autor+"');\">Comentarii</a></li>";
		text += " | ";
		if (nume == "author")
			text += "<li class=\"author active\">Autor articol</li>";
		else text += "<li class=\"author\"><a href=\"#\" onclick=\"get_article_content('author', "+String(id_articol)+", '"+autor+"');\">Autor articol</a></li>";
		document.getElementById("articleMenu").innerHTML=text; 
	
		response_text=cerere.responseText;
		cont.innerHTML=response_text;
	}
}
