// JavaScript Document
var theLastArtid;

function showArticle(artid){// Ajax
	var theDivToFill=document.getElementById("box_content");
	var theLi=document.getElementById("li"+artid);
	
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			if(xmlhttp.responseText!=""){
				
				if(theLastArtid){
					var theLastLi=document.getElementById("li"+theLastArtid);
					theLastLi.className='';
				}
				if(theDivToFill){
					theDivToFill.innerHTML=xmlhttp.responseText;
				}
				if(theLi){
					theLi.className='li_at';
				}
				setupZoom();
				theLastArtid=artid;
			}else{
				alert("Sorry an error occured. please try again");
			}
		}
	}
	var thePid= new Date().getTime();
	xmlhttp.open("GET","getarticle.php?artid="+artid+"&pid="+thePid,true);
	xmlhttp.send();
}
