var pop_back,pop_content,pop_c;
function getPageSize(){
	if( window.innerHeight && window.scrollMaxY ) {
		pageWidth = document.body.clientWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	} else if( document.body.scrollHeight > document.body.offsetHeight ) {
		pageWidth = document.body.scrollWidth;
		pageHeight = document.body.scrollHeight;
	} else {
		pageWidth = document.body.offsetWidth + document.body.offsetLeft;
		pageHeight = document.body.offsetHeight + document.body.offsetTop;
	}
	arrayPageSizeWithScroll = new Array(pageWidth, pageHeight);
	return arrayPageSizeWithScroll;
}
function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft}arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll}

function showbox(arg,w,h,type) {
pop_back=document.getElementById('pop-back');pop_c=document.getElementById('pop-c');pop_content=document.getElementById('pop-content');
var arrayPageSize = getPageSize();
if (typeof(type)=='undefined') { type='flash'; }
pop_back.style.width=arrayPageSize[0]+'px'; pop_back.style.height=arrayPageSize[1]+'px';
pop_content.style.width=w+'px';
pop_content.style.height=h+16+'px';
pop_content.innerHTML = '<a href="#" id="pop-close" title="Закрыть окно" onclick="return close_box();"><\/a>';
if (type=='flash') {
pop_content.innerHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="'+arg+'" align=""><param name="movie" value="'+arg+'"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><param name="wmode" value="transparent"><embed src="'+arg+'" wmode="transparent" quality="high" width="'+w+'" height="'+h+'" name="'+arg+'" align="" type="application\/x-shockwave-flash" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer"><\/embed><\/object>';
} else if (type=='img') {
pop_content.innerHTML += '<img src="'+arg+'" width="'+w+'" height="'+h+'" border="0">';
} else {
pop_content.innerHTML += arg;
}
var arrayPageScroll = getPageScroll();
pop_c.style.top=arrayPageScroll[1]+'px'; pop_back.style.visibility='visible'; pop_c.style.visibility='visible';
}
function close_box() { pop_back.style.visibility='hidden'; pop_c.style.visibility='hidden'; pop_content.innerHTML=''; return false; }
