function popup_image(url, w, h) {

	wWidth = w;
	wHeight = h + 20;
	if (wWidth > screen.width) wWidth = screen.width - 100;
	if (wHeight > screen.height) wHeight = screen.height - 200;

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

}


function popup_text(txt, w, h) {

	wWidth = w + 50;
	wHeight = h + 200;
	if (wWidth > screen.width) wWidth = screen.width - 100;
	if (wHeight > screen.height) wHeight = screen.height - 200;

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=1,scrollbars=1,toolbar=no,menubar=no');
	wnd.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>Просмотр текста</title><link rel="stylesheet" href="/style.css" type="text/css" /></script></head><body>');
	wnd.document.write('<div style="margin:10px; padding:10px; border:1px solid #DEDEDE;">');
	wnd.document.write('<p>'+txt+'</p>');
	wnd.document.write('<div align="center"><a href="javascript:window.close();">Закрыть окно</a></div>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();

}


function gtu(u)
{
	wnd = window.open('http://'+u, '_blank');
	wnd.focus();
}


function showMore(id)
{
	var btn_o = document.getElementById('moreOpen'+id).style;
	var btn_h = document.getElementById('moreHide'+id).style;
	var txt = document.getElementById('moreText'+id).style;
	if ( txt.display == 'block' )
	{
		txt.display = 'none';
		btn_h.display = 'none';
		btn_o.display = 'block';
	}
	else
	{
		txt.display = 'block';
		btn_h.display = 'block';
		btn_o.display = 'none';
	}
	//alert(id);
}



/*************** для выплывающих меню ****************/

function findPos(Id)
{
	var x = 0;
	var y = 0;

	var el,temp;
	el = document.getElementById(Id);

	if ( el.offsetParent )
	{
		temp = el;
		while ( temp.offsetParent ) //Looping parent elements to get the offset of them as well
		{
			temp=temp.offsetParent;
			x+=temp.offsetLeft
			y+=temp.offsetTop;
		}
	}
	x+=el.offsetLeft
	y+=el.offsetTop

	return [x,y];
}

var tabs = Array();
tabs[0] = 'about';
tabs[1] = 'products';
tabs[2] = 'presscentre';
tabs[3] = 'contacts';

var menus = Array();

function sh(u)
{
	if ( !document.getElementById('box'+u) ) return;
	box = document.getElementById('box'+u).style;
	td = document.getElementById('td'+u).style;

	if( menus[u] == true )
	{
		box.visibility = "visible";
		pos = findPos('td'+u);
		box.left = pos[0]+'px';
		box.top = pos[1] + parseInt(25);
		box.top = box.top+'px';
	}
}

function sh1(u)
{
	menus[u] = true;
}

function hd(u)
{
	if ( !document.getElementById('box'+u) ) return;
	box = document.getElementById('box'+u).style;
	box.visibility = "hidden";
}

function hd1(u)
{
	menus[u] = false;
}

/*****************************************************/
