<!--
function _rpc(__parms,__load){
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=function(){getState(__load)};
  xmlhttp.open("GET",Math.random ( ) + __parms,true);
  xmlhttp.send(null);
  }
else
  {
   alert('xml build faild!');
  }
}  

function getElement(id){
var el = null;
  if (document.getElementById){
    el = document.getElementById(id);
  }
  else if (document.all) {
    el = document.all[id];
  }
  else if (document.layers){
    el = document.layers[id];
  }
return el;
}

function hide(aID){
  var HideObject = getElement(aID);
  if (HideObject.style){
    HideObject.style.display = "none";
  }else {
    HideObject.display = "none";
  }
}

function show(aID){
  var HideObject = getElement(aID);
  if (HideObject.style) {
    HideObject.style.display = "block";
  }
  else {
    HideObject.display = "block";
  }
}

window.size = function()
{
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width:w,height:h};
}

window.center = function()
{
	var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};
	var _x = 0;
	var _y = 0;
	var offsetX = 0;
	var offsetY = 0;

	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	_x = ((this.size().width-hWnd.width)/2)+offsetX;
	_y = ((this.size().height-hWnd.height)/2)+offsetY;
	//alert(offsetY);
	return{x:_x,y:_y,offX:offsetX,offY:offsetY};
}


		function showCenter(point,id,text)
		{
			var mdiv = document.createElement("div");		
			mdiv.style.background = "#000";
			mdiv.style.position = "absolute";
			var wS = window.size();
			var wC = window.center();
			
			var x  = (wS.width + wC.offX > document.body.scrollWidth)?wS.width + wC.offX : document.body.scrollWidth;
			var y  = (wS.height + wC.offY > document.body.scrollHeight)?wS.height + wC.offY : document.body.scrollHeight;
			mdiv.style.width =  x + 'px';
			mdiv.style.height = y+400 + 'px';
			mdiv.style.top = 0 + "px";
			mdiv.style.left = 0 + "px"
			mdiv.style.opacity = 0.8;
	      mdiv.style.filter = 'alpha(opacity=' + 80 + ')';

			mdiv.id = "divDetails1";									
			
			var div = document.createElement("div");
			div.style.background = "#101010";
			div.style.border = "#fff solid 1px";
			
			div.style.position = "absolute";
			div.style.top = point.y + "px";
			div.style.left = point.x + "px";
   		div.style.width = "600px";
			div.style.padding = "10px";
			div.id = "divDetails2";	
			var button = document.createElement("button");
			button.innerHTML = "Zamknij";			
			button.style.height = '30px';
			button.style.width = '70px';
			button.setAttribute('onclick','removediv("divDetails")');
			
			div.innerHTML = '<img src="/big/' + id + '.jpg" /> <br />' + text + '<br /><br />';
			div.appendChild(button);
			document.body.appendChild(mdiv);
			document.body.appendChild(div);
			
		}

function removediv(aID){
	var div = getElement(aID + '1');
	document.body.removeChild(div);
	div = getElement(aID + '2');
	document.body.removeChild(div);
}

function iDetails(id,text){
showCenter(window.center({width:600,height:500}),id,text);
}

function xml2string(_xml){
		if (window.ActiveXObject) {
                  var xmlString = _xml.xml;
		} else if (document.implementation && document.implementation.createDocument) {
                    var xmlString = (new XMLSerializer()).serializeToString(_xml);
                }
                return xmlString;

}

 function isInt(__string) {
   return isNaN(__int=parseInt(__string))?false:__string == __int && __string.toString()==__int.toString();
 }
 
 function getState(arg){
    if (xmlhttp.readyState == 4){
        if (xmlhttp.status == 200){
            eval(arg(xmlhttp.responseXML));
        }
    }
}
//-->
