var Browser = {

	version: {
		IE:     !!(window.attachEvent && !window.opera),
		Opera:  !!window.opera,
		WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
		Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
	},

	features: {
		XPath: !!document.evaluate,
		ElementExtensions: !!window.HTMLElement,
		SpecificElementExtensions: (document.createElement('div').__proto__ !== document.createElement('form').__proto__)
	}

}



function isset(varname) {
  return(typeof(window[varname])!='undefined');
}



function popup_image(url, w, h)
{
	var wWidth = w;
	var wHeight = h + 40;
	var sb = 'no';
	if (wWidth > screen.width)
	{
		wWidth = screen.width - 100;
		sb = 'yes';
	}
	if (wHeight > screen.height)
	{
		wHeight = screen.height - 200;
		sb = 'yes';
	}

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=no,scrollbars='+sb+',toolbar=no,menubar=no');
	wnd.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>Увеличенное изображение</title></head><body style="margin:0; padding:0;">');
	wnd.document.write('<div align="center" style="width:100%">');
	wnd.document.write('<a href="javascript:window.close();" title="Кликните чтобы закрыть окно"><img src="' + url + '" width="' + w + '" height="' + h + '" border="0" alt="" /></a><br />');
	wnd.document.write('<p><a href="javascript:window.close();">Закрыть окно</a></p>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();
}

