function popwin(url,w,h)
	{
	var w=w+20;
	var h=h+40;
	var left=(document.body.clientWidth/2)-(w/2);
	var feat="width="+w+",height="+h+",top=80,left="+left+",status=no,location=no,menubar=no,scrollbars=no,resizable=no";
	var popwin=window.open("","popwin",feat);
	var htmltext="<html><head><meta http-equiv='content-type' content='text/html;charset=windows-1251'><title></title></head><body bgcolor=#ffffff topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><div align=center style='margin:5px'><a href='javascript:self.close()'><img style='border:1px solid #109d48' alt=' ' src="+url+"></a><br /><br /><a href='javascript:self.print()' style='color:#109d48;font-family:verdana;font-size:90%;'></a></div></body></html>";
	popwin.document.open();
	popwin.document.write(htmltext);
	popwin.document.close();
	}
function wnd(w, h, url, n) {
// w - width
// h - height
// url - url
// n - name
	var feat = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,directories=no";
	var newWnd = window.open(url, n, feat).focus();
}

function showToolTip(url, w, h, e) {
var posx = 0; var posy = 0;
 if (!w) var w = 200;
 if (!h) var h = 200;
 if (!e) var e = window.event;
 if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; }
 else if (e.clientX || e.clientY) {
 posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
 posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
 }
 tt=dhtmlwindow.open('tooltipBox', 'iframe', url, '᪠', 'width='+w+'px,height='+h+'px,resize=1,scrolling=1,minimize=0', 'recal');
 posx = posx-tt.offsetWidth/2;
 posy = posy-tt.offsetHeight/2;
 if (posx<0) posx = 0;
 if (posy<0) posy = 0;
 tt.style.left=posx+'px';
 tt.style.top=posy+'px';
}

function rwin() { 
	var m = screen.availWidth/2;
	var h = screen.availHeight/2;

	if (document.getElementById("bigvotefoto")) {
		var images = document.getElementById("bigvotefoto").getElementsByTagName('IMG');
		img = images[0];
		self.resizeTo(img.offsetWidth+40, document.getElementById("bigvotefoto").offsetHeight+90); 
	} else {
		self.resizeTo(document.body.offsetWidth+10, document.body.offsetHeight+10); 
	}
	var sleva = " + m + " - (document.body.offsetWidth/2); 
	var verh = " + h + " - (document.body.offsetHeight/2); 
	self.moveTo(sleva,verh); 
	self.focus();
}

function album_zoom(url) {
	var m = screen.availWidth/2;
	var h = screen.availHeight/2;
//	url = "/show"+url;
	zw = window.open(url,"zoomwin","width=200,height=200,top=20,left=20,resizable=yes,scrollbars=yes,location=no,status=no,toolbar=no,directories=no");
//	zw.body.onload = rwin;
//	zwdata = "<html><head><title></title><script type='text/javascript'> function rwin() { self.resizeTo(document.images['imgfile'].width+11, document.images['imgfile'].height+31); var sleva = " + m + " - ((document.getElementById('imgfile').width)/2); var verh = " + h + " - ((document.getElementById('imgfile').height)/2); self.moveTo(sleva,verh); } </script></head><body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0' marginheight='0' marginwidth='0' onload='rwin()'><a href='javascript:self.close()'><img id='imgfile' src=" + srcfile +" alt=' ' title=' ' border='0'></a></body></html>";
//	zw.document.open();
//	zw.document.write(zwdata);
	zw.focus();
}

function switchEl(el) {
	var el = document.getElementById(el);
	(el.style.display == 'block') ? el.style.display = 'none' : el.style.display = 'block';
}
