/**
 * Light Code
 * Arkadiusz Lisieck (ark@lightcode.eu, ark@data.pl)
 */

function isIE() {
	manufacturer=navigator.appName;
	if (manufacturer.indexOf('Microsoft')>=0)
        return true;
	else
        return false;
}

function ajaxoryg(URLRequest, callbackFunction, async) {
	if( !window.XMLHttpRequest ) XMLHttpRequestAlt = function(){
		try{ return new ActiveXObject("MSXML3.XMLHTTP") }catch(e){}
		try{ return new ActiveXObject("MSXML2.XMLHTTP.3.0") }catch(e){}
		try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e){}
		try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e){}
		throw new Error("Could not find an XMLHttpRequest alternative.")
	};	
	
    var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");

    request.open("POST", URLRequest, async); 
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=ISO-8859-2"); 

	if (! isIE()) {
		request.overrideMimeType('text/html; charset=ISO-8859-2');
 	}

    request.onreadystatechange = function() {
		try {
				if (request.readyState == 4 && request.status == 200) {
                	if (request.responseText) {
                    	callbackFunction(request.responseText);
                    } 
                } 
		} catch(e) {
			alert('AJAX err: '+ 'URL: '+ URLRequest + ' callback: ' + callbackFunction + ' message: ' + e.message + '  name: ' + e.name);
		}
    };
    
    request.send('');
}

function nothing(txt) {
	return false;
}

function showTxt(txt) {
	alert(txt);
}



