function ChangePro()
{
	pr = document.getElementById('prod'+CurPro);
	pr.style.display = 'none';
	ps = document.getElementById('ProSel');
	CurPro = ps.value;
	pr = document.getElementById('prod'+CurPro);
	pr.style.display = 'block';
	
}

function ShowPhoto(path,width,height)
{
	int = document.getElementById('interlaced');
	int.style.height = document.documentElement.scrollHeight + 'px';
	int.style.visibility = 'visible';
	view = document.getElementById('ViewPhoto');
	vd = document.getElementById('Vdiv');
	foto = document.getElementById('Fotka');
	foto.innerHTML = '<img src="'+path+'" onclick="HidePhoto();">';
	view.style.width = width + 'px';
	vd.style.width = width + 'px';
	view.style.height = height + 30 + 'px';
	view.style.marginLeft = -Math.round(width/2) + 'px';
	view.style.marginTop = -Math.round(height/2) - 35 + document.documentElement.scrollTop + 'px';
	view.style.display = 'block';
}

function SubmitMessage()
{
	sm=true;
	if (!checkEmpty(document.MessageForm.name.value)) 
		{
	alert('Введите имя!');
	sm=false;	
		}
	if (!checkEmpty(document.MessageForm.email.value)) 
		{
	alert('Введите e-mail!');
	sm=false;	
		}
	if (!checkEmpty(document.MessageForm.content.value)) 
		{
	alert('Введите ваше сообщение!');
	sm=false;	
		}
	if (sm==true) {document.MessageForm.submit();}		
}

function SubmitMessage1()
{
	sm=true;
	if (!checkEmpty(document.MessageForm.name.value)) 
		{
	alert('Введите имя!');
	sm=false;	
		}
	if (!checkEmpty(document.MessageForm.email.value)) 
		{
	alert('Введите e-mail!');
	sm=false;	
		}
	if (sm==true) {document.MessageForm.submit();}		
}

function checkEmpty (val){
	if (val=="" || val.search(/[^\s]+/)==-1) {
		return false;
	}
	return true;
}

function HidePhoto()
{
	view = document.getElementById('ViewPhoto');
	view.style.display = 'none';
	int = document.getElementById('interlaced');
	int.style.visibility = 'hidden';
}
