/*
function bc(name,namesrc)
{
	document.images[name].src = namesrc;
}
*/

function bc(name,namesrc)
{
	var a = document.getElementById(name);
	a.src=namesrc;
}


function show_hide(id)
{
	var win = document.getElementById(id);
	if(win.style.display=='block')
	{
		win.style.display='none';
	}
	else
	{
		win.style.display='block';
	}
}


//open window
var Opened = false;
function ow(PageSrc,Width,Height)
{
	Features="top=118,left=255,width="+Width+",height="+Height+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=auto,resizable=yes";
	if ((!Opened) || (NewWin.closed))
	{
		Opened = true;
		NewWin = window.open(PageSrc,null,Features);
		NewWin.focus();
		var w = (window.document.body.offsetWidth)?window.document.body.offsetWidth - 4:window.document.innerWidth;
		var h = (window.document.body.offsetHeight)?window.document.body.offsetHeight - 4:window.document.innerHeight;
		if ((w != Width) || (h != Height)) {NewWin.resizeTo(Width + 10, Height + 29);}
	}
	else
	{
		if ((Opened) || (!NewWin.closed))
		{
			NewWin.location=PageSrc;
			NewWin.focus();
		}
	}
}

function hideMsg(div)
{
document.getElementById(div).style.display='none';
}

function showMsg(div)
{
document.getElementById(div).style.display='block';
var timeout_id;
timeout_id = setTimeout("hideMsg('"+div+"');",2000);
}

function showVid(vid){
	block=document.getElementById('video_popup');
	block.innerHTML='<div align=right><a href="#" onclick="hideVid(); return false;">закрыть</a></div><embed src="'+vid+'" width=384 height=288 hspace=0 vspace=0 autostart=true></embed>';
	block.style.cssText='display: block; top: '+(document.body.scrollTop+getClientHeight()/2-153)+'px; left: '+(getClientWidth()/2-192)+'px;';
}

function hideVid(){
	block=document.getElementById('video_popup');
	block.style.cssText='display: none;';
	block.innerHTML='';
}



function getClientWidth()
{
 return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
 return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}