	var itemID;
	var itemID_content;

//****************************************************************************************************************************************
	function hideContentLayer(someID) {
		var someLayer = document.getElementById(someID);
	//	someLayer.innerHTML="";
		someLayer.style.display = 'none';
	}
//****************************************************************************************************************************************
	function showContentLayer(someID) {
		var someLayer = document.getElementById(someID);
		someLayer.style.display = 'block';
	}
//****************************************************************************************************************************************
	function replaceContentInLayer(id, content) {
		var someLayer = document.getElementById(id);
		someLayer.innerHTML = content;
	}
//****************************************************************************************************************************************
	function alertContents(http_request) {
		if (http_request.readyState == 4) {
			// everything is good, the response is received        
			if (http_request.status == 200) {
				//alert('test1:'+http_request.responseText);
				return http_request.responseText;
			} else if(http_request.status == 500) {
				alert('500 Internal Server Error\nThe server encountered an unexpected condition which prevented it from fulfilling the request. ');
			} else if(http_request.status == 503) {
				alert('The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.');			
			} else if(http_request.status == 504) {
				alert('The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.	');		
			} else {
				//you can find more errors messages at:
				//http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
				alert('There was a problem with the request. Error code='+ http_request.status +'.');
			}
		} else {
			return 'undefined';
		}
	}
//****************************************************************************************************************************************	
    function makeRequest(url, parameters, passType, itemID) {
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("MSXML4.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() {onready_http(http_request,passType,itemID);};
		http_request.open('POST', url, true);
		http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http_request.setRequestHeader("Content-length", parameters.length);
		http_request.setRequestHeader("Connection", "close");
		//alert(parameters);
		//alert(parameters.length);
		http_request.send(parameters); 
    }
//****************************************************************************************************************************************
	function onready_http(http_request,passType,itemID){
		var strText = alertContents(http_request); 
        	if (strText == 'undefined') {
				//do something ... anything you like ... 
				//someMsg = document.createTextNode('.');
				//document.getElementById('story').appendChild(someMsg); 
        	} else {
        		if(passType == 'loadContent') 
				{
					replaceContentInLayer(itemID, strText);
				}
			}
	}
//****************************************************************************************************************************************	
	function get_art(art_id,kontener,itemID) {
		makeRequest('inc/get_art.php', 'art_id='+art_id+'&kontener='+kontener,'loadContent',itemID);
	}
//****************************************************************************************************************************************
