
count = 0;

// n_p next or previous button
// page as an outside parameter is currently always 1 it assumes that the languages table ID always starts from 1.
function getLangMenu(n_p, page, locale, url){
var xmlhttp=false; //Clear our fetching variable

	if (count > 80)
		count = 0;
	if (n_p == '1')	{
		page = parseInt(page) + count;
	}
	else if (count >= 20) {
		page = parseInt(page) + count - 20;
	}

	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
	} catch (e) {
			try {
					xmlhttp = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	var loc = '&locale=' + locale;
	var url_path = '&url=' + url;
	var file = 'utils/langmenu.php?page='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page + loc + url_path, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('content').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest

	if (n_p == '1')	{
		count += 10;
	}
	else if (count >= 10) {
		count -= 10;
	}

return;
}
