/*
// original: buggy using mootabs with mootools ajax!
function updateArticleListContent(page) {
	var url = "?service=boxview&box=center&tab=left&articleListPage="+page;

	var myAjax = new Ajax(url, {method: 'get', update : 'articleListPaginated', onComplete : initToolTips});
	myAjax.request();
}
*/

var xmlHttp;
 
// function to create an XMLHttpClient in a cross-browser manner 
function initXMLHttpClient() { 
	try { 
		// Mozilla / Safari / IE7 
		xmlHttp = new XMLHttpRequest(); 
	} catch (e) { 
		// IE 
		var XMLHTTP_IDS = new Array("MSXML2.XMLHTTP.5.0", 
				"MSXML2.XMLHTTP.4.0", 
				"MSXML2.XMLHTTP.3.0", 
				"MSXML2.XMLHTTP", 
				"Microsoft.XMLHTTP" ); 
		var success = false; 
		for (var i=0;i < XMLHTTP_IDS.length && !success; i++) { 
			try { 
			xmlHttp = new ActiveXObject(XMLHTTP_IDS[i]); 
			success = true; 
			} catch (e) {} 
		} 
		if (!success) { 
			throw new Error("Unable to create XMLHttpRequest."); 
		} 
	} 
	return xmlHttp; 
} 

/**
 * article list
 */

var currentArticleListPage=1;

function updateSearchPage(page, resultpage, params, baseUrl) {
	if(page != undefined) {
		currentArticleListPage=page;
	}
	
	var url = resultpage+"?articleListPage="+currentArticleListPage+params+"&resultPage="+resultpage+"&baseUrl="+baseUrl;
	// createXMLHttpRequest();
	
	initXMLHttpClient();
	xmlHttp.onreadystatechange = changeSearchPaginated;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}


 
function updateArticleListContent(page) {
	if(page != undefined) {
		currentArticleListPage=page;
	}
	
	var url = "?articleListPage="+currentArticleListPage;
	// createXMLHttpRequest();
	
	initXMLHttpClient();
	xmlHttp.onreadystatechange = changeArticleListPaginated;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}

function changeArticleListPaginated() {
	if ( xmlHttp.readyState == 4 ) {
		document.getElementById("centered").innerHTML = xmlHttp.responseText;
	}
}

function changeSearchPaginated() {
	if ( xmlHttp.readyState == 4 ) {
		document.getElementById("searchresult").innerHTML = xmlHttp.responseText;
	}
}

