   function Validovat(theForm)
   {
       var email = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$");
       if (document.getElementById('email').value=="" || !email.test(document.getElementById('email').value))
       {
         alert("Zadejte, prosím, svůj email.");
         document.getElementById('email').focus();
         return false;
       }

       if ((document.getElementById('phone').value=="")||(document.getElementById('phone').value.length < 9))
       {
         alert("Zadejte, prosím, svůj telefon.");
         document.getElementById('phone').focus();
         return false;
       }

     return true;
   }

var Page = function() {
	this.mapScale = 14;
}

Page.prototype.showAddress = function(address) {
	if(!address) {
		var address = $('#contactAddress').val();
		if(!address) {
			alert('Neuvedena adresa');
			return false;
		}
	}
	if(!this.map) {
		this.geocoder = new google.maps.Geocoder();
		$('#contactMap').css('display', 'block');
	    var myOptions = {
	      zoom: this.mapScale,
	      disableDefaultUI: true,
	      navigationControl:true,
	      mapTypeId: google.maps.MapTypeId.ROADMAP
	    };
	    this.map = new google.maps.Map(document.getElementById('contactMap'), myOptions);
	}
	this.geocoder.geocode({"address": address}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK) {
            Page.map.setCenter(results[0].geometry.location);
            if(!Page.marker) {
	            Page.marker = new google.maps.Marker({
	                map: Page.map, 
	                position: results[0].geometry.location,
	                draggable: false
	            });
            } else {
            	Page.marker.setPosition(results[0].geometry.location);
            }
          } else {
            alert("Geocode was not successful for the following reason: " + status);
          }
	});

}

var Page = new Page();

