var article_counter = 0;

function prevPanel(article_type, rewritten_url_ref)
{
	article_counter = Math.max( 0, (article_counter - 5) );
	if ( article_counter == 0 )
	{
		document.getElementById("uparrow").style.display='none';
	}
	ShowArticles(article_type, rewritten_url_ref, article_counter);
}
		
function nextPanel(article_type, rewritten_url_ref)
{
	article_counter = Math.min ( (article_counter + 5), 1000);
	document.getElementById('uparrow').style.display='';
	ShowArticles(article_type, rewritten_url_ref, article_counter);
}



function ShowArticles( type, ref, counter)
{
	var xmlHttp;
	function GetXmlHttpObject()
	{ 
    	var objXMLHttp=null;
    	if (window.XMLHttpRequest)
    	{
       	 objXMLHttp=new XMLHttpRequest();
    	}
    	else if (window.ActiveXObject)
    	{
        	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}
    	return objXMLHttp;
	}

     xmlHttp=GetXmlHttpObject();
    
    if (xmlHttp==null)
    {
        alert ("Browser does not support HTTP Request");
        return;
    }
    
    var url="http://www.hardens.com/articles/article_pager.php";
    url=url+"?counter="+counter;
	url=url+"&type="+type;
	url=url+"&ref="+ref;
   
    xmlHttp.onreadystatechange=function(){
     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
     
     		
     		
        	document.getElementById("article_pager").innerHTML=xmlHttp.responseText;
        	
        	
        	
     	}
     };
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);  
}

