function hover(line,state)
{
	td = document.getElementById('menu'+line);
	link = document.getElementById('a'+line);
	if (state==1)
	{
		td.style.backgroundImage = 'url(\'' + '/img/arrow_active.gif' + '\')';
		td.style.backgroundColor = '#ffffff';
		link.style.color = '#D08F39';
	} else
		{
		td.style.backgroundImage = 'url(\'' + '/img/arrow.gif' + '\')';
		td.style.backgroundColor = 'transparent';
		link.style.color = '#ffffff';		
		}
}

function ChangePrice(state)
{
	ps = document.getElementById('PriceSelector');
	p1 = document.getElementById('Price1');
	p2 = document.getElementById('Price2');
	if (state==1)
	{
		p1.style.display = 'block';
		p2.style.display = 'none';
		ps.innerHTML = '<strong>Öåíû íà òîâàðû</strong> / <a href="javascript: void(0);" onClick="ChangePrice(2);">öåíû íà óñëóãè</a>';
	} else
		{
		p1.style.display = 'none';
		p2.style.display = 'block';
		ps.innerHTML = '<strong>Öåíû íà óñëóãè</strong> / <a href="javascript: void(0);" onClick="ChangePrice(1);">öåíû íà òîâàðû</a>';
		}
}

function ShowPhoto(path,width,height)
{
	int = document.getElementById('interlaced');
	int.style.height = document.documentElement.scrollHeight + 'px';
	int.style.visibility = 'visible';
	view = document.getElementById('ViewPhoto');
	foto = document.getElementById('Fotka');
	foto.innerHTML = '<img src="'+path+'" onClick="HidePhoto()">';
	view.style.width = width + 68 + 'px';
	view.style.height = height + 62 + 'px';
	view.style.marginLeft = -Math.round((width+42)/2) + 'px';
	view.style.marginTop = -Math.round((height+58)/2) + document.documentElement.scrollTop + 'px';
	view.style.display = 'block';
}

function HidePhoto()
{
	view = document.getElementById('ViewPhoto');
	view.style.display = 'none';
	int = document.getElementById('interlaced');
	int.style.visibility = 'hidden';

}

function checkEmpty (val){
	if (val=="" || val.search(/[^\s]+/)==-1) {
		return false;
	}
	return true;
}

function RestoreColor()
	{
	document.MessageForm.name.style.background="#EDEDED";	
	document.MessageForm.contacts.style.background="#EDEDED";	
	document.MessageForm.content.style.background="#EDEDED";	
	}

function SubmitMessage()
{
	sm=true;
	if (!checkEmpty(document.MessageForm.name.value)) 
		{
	document.MessageForm.name.style.background="#F5D080";
	sm=false;	
		}
	if (!checkEmpty(document.MessageForm.contacts.value)) 
		{
	document.MessageForm.contacts.style.background="#F5D080";
	sm=false;	
		}
	if (!checkEmpty(document.MessageForm.content.value)) 
		{
	document.MessageForm.content.style.background="#F5D080";
	sm=false;	
		}
	if (sm==true) {document.MessageForm.submit();}		
}
