// �������� ������������� ����� � ��������
function chcomment ()
{
if (document.comment.elements[0].value=='')
{ alert ('�������������, ����������.\n���� "���" ������ ���� ���������.'); return false; }
if (document.comment.elements[2].value=='') { alert ('� ��� �� �����������?\n���� "����� �����������" ������ ���� ���������.'); return false; }
}

// ����������� ������ ��� ������ ���� ��������������
function dclas()
{
rc = document.getElementById('showclass');
if (document.restaurant.type.value=='��������' || document.restaurant.type.value=='���') rc.style.display='block';
else rc.style.display = "none";
}

// �������� ������� ��� ������
function chtime()
{
if (document.restaurant.krug.checked) document.restaurant.hof.disabled="true"; document.restaurant.hto.disabled="true";
if (document.restaurant.krug.checked==false) document.restaurant.hof.disabled=false;
if (document.restaurant.krug.checked==false) document.restaurant.hto.disabled=false;
}

// ����������� � �����
function copy_clipboard(textField) {
textField.createTextRange().execCommand("Copy");
}

// ��������� ���������
function show_preview(message) {
preview_window = window.open('','preview','width=500,height=300,resizable=yes,status=yes,toolbar=no,location=no,menubar=no,scrollbars=yes');
var x = (screen.availWidth - 500) / 2;
var y = (screen.availHeight - 300) / 2;
preview_window.moveTo(Math.floor(x), Math.floor(y));
preview_window.document.writeln('<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01\/\/EN" "http:\/\/www.w3.org\/TR\/html4\/strict.dtd">');
preview_window.document.writeln('<html>\n<head>');
preview_window.document.writeln('<meta http-equiv="content-type" content="text\/html; charset=windows-1251">');
preview_window.document.writeln('<link type="text\/css" rel="stylesheet" href="\/css\/style.css">');
preview_window.document.writeln('<title>������������ ������<\/title>');
preview_window.document.writeln('<\/head>\n<body>\n<center><table style="margin: 20px;"><tr><td style="text-align: left;">');
preview_window.document.writeln(message);
preview_window.document.writeln('<\/td><\/tr><\/table><br\/><a href="javascript:void()" onClick="window.close()">������� ����<\/a>\n<\/center>\n<\/body>');
preview_window.document.close();
return false;
}

// ����������� �����
function loadMap() {
if (GBrowserIsCompatible()) {
document.getElementById('restmapshow').style.display = 'none';
document.getElementById('rest_map').style.display = 'block';
$('#note_map').animate({height: 'show'}, 5000);
var map = new GMap2(document.getElementById("rest_map"));
var center = new GLatLng(Lat, Lng);
map.setCenter(center, 17);
map.addControl(new GSmallZoomControl());
map.setMapType(G_HYBRID_MAP);
var marker = new GMarker(center);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(restourant);  });
map.addOverlay(marker);
marker.openInfoWindowHtml(restourant);
}
}

// �������� ������� �����
function loadScript() {
var script = document.createElement("script");
document.body.appendChild(script);
script.src = "http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAA81gmnWj13XGmkgJcP5aejRTclZ5la7fxqzvQfcA4i-mWTxL3LRQg-g0VbmDJ74tolJGFgajxrjevyQ&async=2&callback=loadMap&hl=ru";
}

// �������� �����
function isMap () {
document.getElementById('restmapshow').style.display = 'inline';
$('#rest_map').animate({height: 'hide'}, 1000);
$('#note_map').animate({height: 'hide'}, 300);
GUnload();
}

function updateCaptcha()
{
	document.getElementById('captchaImg').src = document.getElementById('captchaImg').src + 1
	return false;
}

function showElement(id)
{
	var obj = document.getElementById(id);
	if (obj == null) return false;
	obj.style.display="";
	return true;
}

function hideElement(id)
{
	var obj = document.getElementById(id);
	if (obj == null) return false;
	obj.style.display="none";
	return true;
}