/* определение браузеров */

var l2 = null; 
var t;
//var hideTime = 200;
var opera=gecko=ie=false;
var browser=navigator.userAgent.toLowerCase();
var version = parseFloat(navigator.appVersion);
if(browser.match('opera'))opera=true;
if(browser.match('gecko'))gecko=true;
if(browser.match('msie'))
{
  if(!opera)ie=true;
  if(browser.match('msie 6'))version=6;
  else if(browser.match('msie 7'))version=7;
}

function png(element)
/*
   корректное отображение png-картинок в ie
   вызывается в стилях
   для img задаём class='png'
   для элементов с png-фоном задаём class='scale' (фон тянется (повторяется)) или class='crop' (фон не повторяется)
*/
{if(ie){
try{
var src,method='scale';
var classname=element.className;
if(classname.match('png'))
{
  src=element.getAttribute('src');
  element.setAttribute('src','img/1.gif');
}
else if(classname.match('scale')||classname.match('crop'))
{
  src=element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/img)[1];
  element.style.backgroundImage='none';
  if(classname.match('crop'))method='crop';
}
element.style.filter="progid:dximagetransform.microsoft.alphaimageloader(src='"+src+"',sizingmethod="+method+")";
}
catch(e){}
}}

function show(obj) {
if (document.getElementById(obj).style.display == 'none')
document.getElementById(obj).style.display = 'block';
else document.getElementById(obj).style.display = 'none';
}
	  			
function popupWindow(url, w, h) {
	href = url;
	sh = screen.height - 80;
	if (document.all) sh -= 40;
	sw = screen.width;
	if (h > sh) h = sh;
	if (w > sw) w = sw;
	posX = sw/2 - w/2;
	posY = sh/2 - h/2;
	if (posY < 0) posY = 0;
	if (posX < 0) posX = 0;
	posCode = (document.all) ? ",left=" + posX + ",top=" + posY : ",screenX=" + posX + ",screenY=" + posY;
	moreWin = window.open (href, "popup", "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, width=" + w + ", height=" + h + posCode);
	moreWin.focus();
}

function showHelp(text){
	alert(text);
}

function HideL2 () {
	if (l2) {
		var e2 = document.getElementById(l2);
		e2.style.visibility = "hidden";
	}
}

function ShowHelp(id) {
	if (t) clearTimeout(t);
	if (l2 != id) {
		HideL2();
	}
	var e = document.getElementById(id);
	if (!e) return;
	l2 = id;
	e.style.visibility = "visible";
}

function HideHelp(hideTime) {
	if (t) clearTimeout(t);
	t = setTimeout(HideL2, hideTime);
}
