function initialize() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById('map_canvas'));
		map.setCenter(new GLatLng(48.718231, 21.250219), 15);
		map.setUIToDefault();
		map.addOverlay(new GMarker(new GLatLng(48.718231, 21.250219)));
	}
}
	
var slideShowSpeed = 10000;
var crossFadeDuration = 5;
var Pic = new Array();
Pic[0] = './images/banner_1.jpg';
Pic[1] = './images/banner_2.jpg';
Pic[2] = './images/banner_3.jpg';
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
	preLoad[i] = new Image();
	preLoad[i].src = Pic[i];
}

function runSlideShow() {
	if (document.all) {
		document.images.SlideShow.style.filter = "blendTrans(duration=2)";
		document.images.SlideShow.style.filter = "blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoad[j].src;
	if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j > (p - 1))
		j = 0;
	t = setTimeout('runSlideShow()', slideShowSpeed);
}

function CheckForm() {
	empty_contact = false;
	empty_predmet = false;
	empty_text = false;

	document.question.email.className = "InputBox";
	document.question.mobil.className = "InputBox";
	document.question.predmet.className = "InputBox";
	document.question.text.className = "InputBox";

	if (!isValidEmail(document.question.email.value)
			&& document.question.mobil.value.length < 5) {
		document.question.email.className = "InputBoxE";
		document.question.mobil.className = "InputBoxE";
		empty_contact = true;
	}
	if (document.question.predmet.value.length < 2) {
		document.question.predmet.className = "InputBoxE";
		empty_predmet = true;
	}
	if (document.question.text.value.length < 2) {
		document.question.text.className = "InputBoxE";
		empty_text = true;
	}

	if (!empty_contact && !empty_predmet && !empty_text) {
		document.question.sendQuestion.value = 'true';
		document.question.submit();
	}
}

function isValidEmail(str) {
	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
