function search(){
	var url='files.php';
	var fraze = encodeURIComponent(document.getElementById('search').value);
	var type = encodeURIComponent(document.getElementById('type').value);
	var place = encodeURIComponent(document.getElementById('place').value);
	var par ="uri=search&fraze="+fraze+"&type="+type+'&place='+place;
	
	if(xmlHttp){
		xmlHttp.open("POST",url,true);
		xmlHttp.onreadystatechange = searchAction;
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(par);
	}else{
		alert('Brak obiektu XML!');
	}
}

function searchAction(){
	var content = document.getElementById('results');
	if(xmlHttp){
		if((xmlHttp.readyState==4)&&(xmlHttp.status==200)){
			try{
				content.innerHTML = xmlHttp.responseText;
			}catch(e){
				alert('Blad obiektu: '+e.toString());
			}
		}
	}else{
		alert('Brak obiektu XML!');
	}
}
