//AJAX JavaScript Document
function keystoke_pause_town(type,string){
	var timer;
	if(document.getElementById(type).value!=null){
		document.getElementById(type).onkeyup = function() {
			clearTimeout(timer);
			timer = setTimeout("ajax_loader('../function/elements/request.php','"+type+"','"+document.getElementById(string).value+"')",1000);
		}
	}
}
function news(url){
	var timer;
	ajax_loader(url,'news','news');
}

function ajax_loader(url,type,obj)
{
	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	} else {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	try {
		if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) {
			xmlhttp.open("GET",url+'?'+type+'='+obj,false);
			xmlhttp.send(null);
			document.getElementById(type+'_div').innerHTML=xmlhttp.responseText;
			
		}
	} catch(err) {
		
	}
}
