function ShowPopup (wx,wy,title,pic_url,text)
{
	win=window.open('','popup','width='+wx+',height='+wy+',left=100,top=0,location=no,menubar=no,resizable=no,scrollbars=no');
	doc=win.document;
	doc.writeln('<html><head><title>'+title+'</title><link rel="shortcut icon" href="favicon.ico"><meta http-equiv="content-type" content="text/html; charset=windows-1251"><style>.small {color: #fff; font-size: 9px; font-family: Tahoma, Verdana;} .pix-comment {color: #ccc; font-size: 12px; font-family: Tahoma, Verdana;} .border {border: 1 solid #333; padding: 0; margin: 0;}</style></head><body bgcolor="#000" bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0>');
	doc.writeln('<table cellspacing=0 cellpadding=10 border=0><tr bgcolor="333333"><td width=200><img src="i/Image/small/shevchenko-logo-sm.gif" width="200" height="30" alt="" border="0"></td><td width="*" class=small align="right"><a href="javascript:window.close();"><img src="i/Image/small/close.gif" width="12" height="12" alt="" border="0"></a></td></tr><tr><td colspan=3 class="pix-comment" align="center"><img src="'+pic_url+'" class="border"><br>'+((text)?text:'')+'</td></tr></table></body></html>');
	doc.close();
}
function open_popup (url,conf){
	win=window.open(url,'popup',conf+'location=no,menubar=no,resizable=yes,scrollbars=yes');
}
function calendar(e,obj,t){
	var id = obj.id;
	var dateVal = obj.value;
	var left, top;
	var width = 200, height = 180;
	if('['+typeof(e)+']' == '[object]'){
		top = (e.screenY+20+height>screen.height-40? e.screenY-45-height:e.screenY+20);
		left = (e.screenX-width/2);
	}else{
		top = Math.floor((screen.height - height)/2-14);
		left = Math.floor((screen.width - width)/2-5);
	}
	window.open('/tools/calendar.php?lang=ru&parent='+id+'&type='+t+'&init='+escape(dateVal),'','scrollbars=no,resizable=yes,width='+width+',height='+height+',left='+left+',top='+top);
}
function InitRefresh(id){
	var li = document.getElementById(id).getElementsByTagName('li');
	for(var i=0; i<li.length;i++){
		if(li[i].className.search(/on/)>=0){
			li[i].style.display="block";
			var a = li[i].getElementsByTagName('a');
			var link = a[0].id.replace("id_","");
			break;
		}
	}
}