/**
 * @author BitArtis.pl
 */

function closeAd() {
	document.getElementById('popuptlo').style.display = 'none';
} 
 
$(function() {
	$('.light').lightBox({fixedNavigation:true});
	$('.light2').lightBox({fixedNavigation:true});
});

function isEmail(email) {
var regEmail = /^([a-zA-Z0-9._-]{1,})@([a-zA-Z0-9._-]{1,})\.([a-zA-Z]{2,4})$/;
if (!regEmail.test(email)) return false;
else return true;
}

function szukaj() {
	document.getElementById("szukajform").submit();
}

function checkForm(){
	var imie = document.getElementById( 'imie' ).value;
	if (!imie) {
		alert('Prosimy o uzupełnienie pola imię i nazwisko.');
			  return false;
				}
				
	var email = document.getElementById( 'email' ).value;
	
	if (!email) {
		alert('Prosimy o podanie adres e-mail.');
			  return false;
				}
	
	if (email && isEmail(email) == false ){
		alert('E-mail wydaje się być nieprawidłowy.');
			  return false;
	}
	
	var tel = document.getElementById( 'tel' ).value;
	if (!tel) {
		alert('Prosimy o uzupełnienie pola telefon kontaktowy.');
			  return false;
				}
	
	var tresc = document.getElementById( 'trescc' ).value;
	if (!tresc) {
		alert('Prosimy o uzupełnienie pola treść zapytania.');
			  return false;
				}
	
	
	
	//return true;				
}

 
function load() { 
var zoom=16;  
var point = new GLatLng(50.029385,21.976819);  
var marker = new GMarker(point);

	if (GBrowserIsCompatible()) { 
	var mapa = new GMap2(document.getElementById("map")); 
	GEvent.addListener(marker, "click", function() {
		alert("KREO STYL");
		});

	mapa.addControl(new GSmallZoomControl());
	mapa.setCenter(new GLatLng(50.029385,21.976819), zoom); 
	mapa.addOverlay(marker);
	}
}

function pokazmodele() {
	$("#closelink1").toggle(1);
	$("#modele").toggle(150);
	$("#opisproduktu").toggle(150);
	$("#fotoproduktu").toggle(150);
	$("#closelink2").toggle(1);
}

function pokazszkice() {
	$("#closelink3").toggle(1);
	$("#allszkice").toggle(150);
	$("#opisproduktu").toggle(150);
	$("#fotoproduktu").toggle(150);
	$("#closelink4").toggle(1);
}
