var http_request = false;
	
function fRequest(url, id, option, target) {
	
	var thiSend = 'id=' + id + '&option=' + option + '&target=' + target;

	if(target == 'log'){
		thiSend += '&nick=' + document.getElementById('nick').value;
		thiSend += '&pass=' + document.getElementById('pass').value;
	}
	if(target == 'search'){
		thiSend += '&txt=' + document.getElementById('txt_srch').value;
	}
//	thiSend = thiSend.substr(0, (thiSend.length - 1));
	
	http_request = false;
	
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		return false;
	}
	http_request.onreadystatechange = function() {mContent(http_request, id, option, target);};
	http_request.open('POST', url, true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_request.send(thiSend);
}


function mContent(http_request, id, option, target) {
	try {
		if (http_request.readyState == 4) 
		{
			if (http_request.status == 200) 
			{
			/*
				if(target == 'del') {
					if(option == 'cenzura'){
						window.location = 'site.php?act=filtr&sub=cenzura';
					}else if(option == 'blokip'){
						window.location = 'site.php?act=filtr&sub=blokip';
					}else if(option == 'blokmail'){
						window.location = 'site.php?act=filtr&sub=blokmail';
					}else if(option == 'topic'){
						window.location = 'site.php?act=topic&sub=topic';
					}
				}
				*/
				if(target == 'log')
				{
					if(http_request.responseText == 'false'){
						alert("Podano nieprawidłowy nick i/lub hasło");
					}else{
						//alert('d');
						window.location = 'e-forum/' + id + '/0/0/';
					}
				}
				
				if(target == 'logout'){
					if(id == ''){
						window.location = 'e-forum/1/0/0/';
					}else{
						window.location = 'e-forum/' + id + '/0/0/';
					}
				}
								
			} else {
				alert('Wystąpił problem z tym żądaniem.');
			}
		}
	}
	catch( e ) {}
}