function getUrl(obj,pid){
	var DivBanerObject = document.getElementById("BanerObject");
	if(!DivBanerObject){
		var xmlhttp = getHTTPObject();
		xmlhttp.open("GET","/advert/index.p3?ajax=true&pub=" + pid, true);
		var BanerObject = document.createElement('div');
		BanerObject.setAttribute("id","BanerObject");
		BanerObject.setAttribute("style","position:absolute;z-index:250;width:650px;left:50%;margin-left:-325px;font:normal 12px 'Tahoma';text-align:justify;padding:10px;border:slategray 1px solid;background:#fff url('http://www.volgograd.ru/accel/static/pic/ajax.gif') no-repeat center");
		obj.parentNode.appendChild(BanerObject);
		
		var theSunIsRising = document.createElement('div');
		theSunIsRising.setAttribute("id","sun");
		theSunIsRising.setAttribute("style","top:0;left:0;position:absolute;z-index:249;width:100%;background:black;filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity:0.5;opacity:0.5");
		document.body.appendChild(theSunIsRising)[0];
		var trueheight = getyScroll();
		document.getElementById("sun").style.height = trueheight+'px';
		
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState == 4) {
				if (xmlhttp.status == 200) {
					var DivBanerObject = document.getElementById("BanerObject");
					DivBanerObject.style.background = '#fff';
					DivBanerObject.innerHTML = xmlhttp.responseText;
					DivBanerObject.style.top = document.documentElement.scrollTop + parseInt(Math.floor((document.documentElement.clientHeight-DivBanerObject.offsetHeight)/2)) + "px";
					var oDelete = document.createElement('span');
					oDelete.setAttribute("id","deleteThis");
					oDelete.innerHTML = "x";
					oDelete.setAttribute("style","font:bold 16px 'Tahoma';color:red;position:absolute;z-index:251;cursor:pointer;_cursor:hand;margin:5px 0 0 645px");
					var parentDiv = DivBanerObject.parentNode;
					parentDiv.insertBefore(oDelete,document.getElementById("banner-flash"));
					oDelete.style.top = document.documentElement.scrollTop + parseInt(Math.floor((document.documentElement.clientHeight-DivBanerObject.offsetHeight)/2)) + "px";
					var sayHi = new hideblock(DivBanerObject,oDelete,document.getElementById("sun"));
					if(isMZ==true){
						oDelete.addEventListener('click', sayHi.invoke, false);
					} else {
						oDelete.attachEvent('onclick', sayHi.invoke);
					}					
				} else {
					alert("An error was occured while transacting data");
				}
			}
		}
		xmlhttp.send(null);
	} else {
		document.getElementById("BanerObject").style.display = 'block';
		document.getElementById("BanerObject").style.top = document.documentElement.scrollTop + parseInt(Math.floor((document.documentElement.clientHeight-DivBanerObject.offsetHeight)/2)) + "px";
		document.getElementById("deleteThis").style.display = 'block';
		document.getElementById("deleteThis").style.top = document.documentElement.scrollTop + parseInt(Math.floor((document.documentElement.clientHeight-DivBanerObject.offsetHeight)/2)) + "px";
		document.getElementById("sun").style.display = 'block';
	}
}

/* special thanx to habrahabr js-coder */
function getyScroll(){yScroll = 0;if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX){yScroll = window.innerHeight + window.scrollMaxY;xScroll = window.innerWidth + window.scrollMaxX;var deff = document.documentElement;var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;xScroll -= (window.innerWidth - wff);yScroll -= (window.innerHeight - hff);} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){yScroll = document.body.scrollHeight;xScroll = document.body.scrollWidth;}else{yScroll = document.body.offsetHeight;xScroll = document.body.offsetWidth;}return yScroll;}

/* hiding element */
function hideblock(oElement,oClicker,oSun){
	this.invoke=function () {
		oElement.style.display = 'none';
		oClicker.style.display = 'none';
		oSun.style.display = 'none';
	}
}