function paganation(cat_id,type,page,item_type)
{
	var http = false;

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else
	{
		http = new XMLHttpRequest();
	}
	//pagination.php this page is the same like show_files.php but without header and footer
	http.open("GET", "ajax/getpage.php?cat_id="+cat_id+"&type="+type+"&page="+page+"&item_type="+item_type, true);

	http.onreadystatechange=function()
	{
		if(http.readyState == 4)
		{
			document.getElementById('files_body').innerHTML = '';
			document.getElementById('pagination_div').innerHTML = '';
			document.getElementById('files_body').innerHTML= '';	
			document.getElementById('pagination_span').innerHTML= http.responseText;			
		}
	}

	http.send(null);
}
function alphabetpaganation(page,mod)
{
	
	var http = false;

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else
	{
		http = new XMLHttpRequest();
	}
	//pagination.php this page is the same like show_files.php but without header and footer
	http.open("GET", "ajax/library_pagination.php?page="+page+"&mod="+mod, true);

	http.onreadystatechange=function()
	{
		if(http.readyState == 4)
		{
			document.getElementById('listpage').innerHTML= http.responseText;			
		}
	}

	http.send(null);
}
function dropdown_paganation(page,mod)
{
	var current_page=document.getElementById('page').value;
	var http = false;

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else
	{
		http = new XMLHttpRequest();
	}
	//pagination.php this page is the same like show_files.php but without header and footer
	http.open("GET", "ajax/library_pagination.php?page="+page+"&current_page="+current_page+"&mod="+mod, true);

	http.onreadystatechange=function()
	{
		if(http.readyState == 4)
		{
			document.getElementById('listpage').innerHTML= http.responseText;			
		}
	}

	http.send(null);
}

function paganate_search(mail_search_string,page)
{
	var http = false;

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else
	{
		http = new XMLHttpRequest();
	}
	//pagination.php this page is the same like show_files.php but without header and footer
	http.open("GET", "paganate_search.php?page="+page+"&mail_search_string="+mail_search_string, true);

	http.onreadystatechange=function()
	{
		if(http.readyState == 4)
		{
			document.getElementById('files_body').innerHTML = '';
			document.getElementById('paganation_div').innerHTML = '';
			
			document.getElementById('files_body').innerHTML= http.responseText;			
		}
	}

	http.send(null);
	
}

