var DOM = (typeof(document.getElementById) != 'undefined');
function OpenWin (url, name, _w, _h) 
{
	var t, l, w, h, sw, sh;
	sw = window.document.body.clientWidth;
	if (window.parent && window.parent.document) sw = window.parent.document.body.clientWidth;
	sh = window.document.body.clientHeight;
	if (window.parent && window.parent.document) sh = window.parent.document.body.clientHeight;
	if (_w > 0) {
		w = _w;
	} else {
		w = sw / 2;
	}
	if (_h > 0) {
		h = _h;
	} else {
		h = sh / 2;
	}
	l = (sw - w) / 2;
	t = (sh - h) / 2;
	if (l < 0) l = 0;
	if (t < 0) t = 0;
	var newwin = window.open(url, name, 'top='+t+', left='+l+', toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=1, width='+w+', height='+h)
		|| alert('Отключите блокировку всплывающих (Pop-up) окон!');
	newwin.focus();
	//alert('top='+t+', left='+l+', toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=1, width='+w+', height='+h);
	return false;
}
function getObj(id)
{
	return (document.all ? document.all[id] : document.getElementById(id));
}

