
function closeTL(){
document.getElementById("kartka").style.display="none";
document.getElementById("kartka_bg").style.display="none";
document.getElementById("search_form").style.display="";
}

function sprawdz(lang)
	{
	if (document.requestHoliday.request_captcha.value == '' ){

		if (lang=='pl')	alert('Aby zamówić wakacje musisz wpisać tekst z obrazka.');
		if (lang=='sk') alert('');
	
		return false; 
	}
		
	if ((document.requestHoliday.akceptacja.checked) && (document.requestHoliday.warunki.checked))
		{ document.requestHoliday.submit(); }
	else
		if (lang=='pl')	alert('Aby zamówić wakacje na sezon 2008,\nmusisz wyrazić zgodę na przetwarzanie danych osobowych\ni potwierdzić znajomość regulaminu rezerwacji.');
		if (lang=='sk') alert('Aby si bolo možné rezervovať dovolenku v roku 2008, potrebujeme od Vás povolenie na spracovanie Vašich osobných údajov a potvrdenie, že ste oboznámený s našimi rezervačnými podmienkami.');
		if (lang=='cz')	alert('Jestliže by jste si rádi objednali dovolenou v sezone 2008, musíte souhlasit se zpracováním vašich osobních údajů a musíte potvrdit, že poznáte podmínky rezervace.');
	}

function sprawdz_daty_urodzenia(lang)
	{
	var poprawne = true;
	for (i = 1; i <= 7; i++)
	{
		field = document.getElementById("data_urodzenia_"+i);
		if (field.value == "DD/MM/RR")
			{ field.value = ""; }
		else if (field.value != "")
			{
			var reg = /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/;
			if (!reg.test(field.value))
				{ poprawne = false; }
			}
	}
	if (poprawne)
		{ przelacz(1, 2);}
	else
		{
			if (lang=='pl') alert("Daty urodzenia muszą być w formacie DD/MM/RR!");
			if (lang=='sk') alert("Dátum narodenia musí byť vo formáte DD/MM/RR!");
			if (lang=='cz') alert("Datum narození musí být ve tvaru  DD/MM/RR!");
		}
	}

function sprawdz_daty_campingow(lang)
	{
	var poprawne = true;
	for (i = 1; i <= 5; i++)
		{
		field = document.getElementById("dzien_przyjazdu_na_camping_"+i);
		if (field.value == "DD/MM/RR")
			{ field.value = ""; }
		else if (field.value != "")
			{
			var reg = /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/;
			if (!reg.test(field.value))
				{ poprawne = false; }
			}
		field = document.getElementById("dzien_wyjazdu_z_campingu_"+i);
		if (field.value == "DD/MM/RR")
			{ field.value = ""; }
		else if (field.value != "")
			{
			var reg = /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/;
			if (!reg.test(field.value))
				{ poprawne = false; }
			}
		}
	if (poprawne)
		{ przelacz(2, 3); }
	else
		{
		if (lang=='pl') alert("Daty przyjazdu i wyjazdu muszą być w formacie DD/MM/RR!");
		if (lang=='sk') alert("Dátum príchodu a odchodu musí byť vo formáte DD/MM/RR!");
		if (lang=='cz') alert("Datum příjezdu a datum odjezdu musí být ve tvaru  DD/MM/RR!");
		}
	}

function przelacz(krok1, krok2)
	{
				
	prev = document.getElementById('krok'+krok1);
	prev.className = 'hidden';
	next = document.getElementById('krok'+krok2);
	next.className = 'visible';
	}

function dd1()
	{
	if (document.requestBrochure.skad_wie.value=="inne")
		{
		document.requestBrochure.skad_wie_opis.disabled = false;
		document.requestBrochure.skad_wie_opis.style.bacgroundColor="";
		}
	else
		{
		document.requestBrochure.skad_wie_opis.value    = "";
		document.requestBrochure.skad_wie_opis.disabled = true;
		document.requestBrochure.skad_wie_opis.style.bacgroundColor="silver";
		}
	}

function dd()
	{
	if (document.getElementById("skad_wie").value == "inne")
		{ document.getElementById("inne").style.visibility = "visible"; }
	else
		{ document.getElementById("inne").style.visibility = "hidden"; }
	}

function checkBrochure(lang)
	{
	var formularz = document.getElementById("requestBrochure");
	var fields = formularz.getElementsByTagName("INPUT");
	var ok = true;
	var info = "";
	for (i = 0; i < fields.length; i++)
		{
		var pole = fields[i];
		if ((pole.type == "text") && (pole.name != "skad_wie_opis"))
			{
			if ((pole.value == pole.title) || (pole.value == ""))
				{
				ok = false;
				if (lang=='pl') info = "Musisz wypełnić wszystkie pola.";
				if (lang=='sk') info = "Musíte vyplniť všetky políčka.";
				if (lang=='cz') info = "Musíte vyplnit všechny  políčka.";
				
				}
			}
		else
			if (pole.type == "checkbox")
				{
				if (ok)
				if (!pole.checked)
					{
					ok = false;
					if (lang=='pl') info = "Aby zamówić bezpłatny katalog ofert wakacyjnych Eurocamp 2008\nmusisz wyrazić zgodę na przetwarzanie danych osobowych.";
					if (lang=='sk') info = "K objednaniu gratis Eurocamp katalógu, musite povoliť spracovanie Vašich osobnych údajov";
					if (lang=='cz') info = "Jestliže by jste si rádi objednali katalog na rok 2008, musíte souhlasit se zpracováním svých osobních údajů.";
					}
				}
		}
	if (info) window.alert(info);
	return ok;
	}

//zmiana zdjęć
var currentPhoto = 1;
function photo(action)
	{
	toClose = currentPhoto;
	if(action == 'next')
		{
		if(currentPhoto < 5) { currentPhoto++;}
		else { currentPhoto = 1;}
		}
	else if(action == 'prev')
		{
		if(currentPhoto > 1) { currentPhoto--;}
		else { currentPhoto = 5;}
		}
	//alert('zamknąć ' + toClose + ', otworzyć ' + currentPhoto);
	document.getElementById('camp_photo_' + currentPhoto).className = 'block';
	document.getElementById('camp_photo_' + toClose).className = 'none';
	}

//zmiana zakładek
function showTab(nr)
	{
	if(nr != '1') {document.getElementById('rightMap').style.display = 'none';}
	else {document.getElementById('rightMap').style.display = 'block';}
	for(i=1;i<6;i++) //zmienilem z 7 na z bo wylaczylem ostatnia zakaldke JUC
		{
		document.getElementById('tab_' + i).style.display = 'none';
		document.getElementById('topTab' + i).style.backgroundImage = 'url(/images/tab'+i+'_off.gif)';
		}
	document.getElementById('tab_' + nr).style.display = 'block';
	document.getElementById('topTab' + nr).style.backgroundImage = 'url(/images/tab'+nr+'_on.gif)';
	}

//zmiana zakładek sunsites
function showSunTab(nr)	{
	var ar = new Array( 'infoMenu', 'udogodnieniaMenu', 'basenyMenu', 'sportMenu', 'atrakcjeMenu', 'opinieMenu' );
	if(nr != '1') {document.getElementById('rightMap').style.display = 'none';}
	else {document.getElementById('rightMap').style.display = 'block';}
	for( i = 1; i <= 6; i++ )
		{
		document.getElementById('tab_' + i).style.display = 'none';
		document.getElementById('topTab' + i).src = '/images/sunsites_'+ar[i-1]+'_blue.gif';
		}
	document.getElementById('tab_' + nr).style.display = 'block';
	document.getElementById('topTab' + nr).src = '/images/sunsites_'+ar[nr-1]+'_pink.gif';
	}

//visual tour w kwaterach
function showVT()
	{
	document.getElementById('accMain').style.display = 'none';
	document.getElementById('accVisual').style.display = 'block';
	}

function createFlash(id,width,height,url)
	{
	document.write('<object id="'+id+'" style="width:'+width+'px; height:'+height+'px;" data="'+url+'" type="application/x-shockwave-flash">');
	document.write('	<param name="movie" value="'+url+'">');
	document.write('	<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">');
	document.write('	<param name="wmode" value="transparent">');
	document.write('	<param name="quality" value="high">');
	document.write('	<param name="bgcolor" value="#ffffff">');
	document.write('	<param name="scale" value="noscale">');
	document.write('	<param name="menu" value="false">');
	document.write('</object>');
	}

function createFlashMain(id,width,height,url)
	{
	document.write('<object id="'+id+'" style="width:'+width+'px; height:'+height+'px; margin:10px;" data="'+url+'?clickTag=eurocamp,specjalne.xml" type="application/x-shockwave-flash">');
	document.write('	<param name="movie" value="'+url+'?clickTag=eurocamp,specjalne.xml">');
	document.write('	<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">');
	/*document.write('	<param name="wmode" value="transparent">');*/
	document.write('	<param name="quality" value="high">');
	document.write('	<param name="bgcolor" value="#ffffff">');
	document.write('	<param name="scale" value="noscale">');
	document.write('	<param name="menu" value="false">');
	document.write('</object>');
	}

function flashObject(show,all)
	{
	all = all+1;
	for(i=1; i<all; i++)
		{
		document.getElementById('flashObject_' +i).style.display = 'none';
		document.getElementById('href_' +i).style.fontWeight = 'normal';
		document.getElementById('href_' +i).style.textDecoration = 'underline';
		}
	document.getElementById('flashObject_' +show).style.display = 'block';
	document.getElementById('href_' +show).style.fontWeight = 'bold';
	document.getElementById('href_' +show).style.textDecoration = 'none';
	}


function show_newsletter_alert(){
		if (newsletter_alert !=''){
			alert(newsletter_alert);
		}
	}

function addme()
{
	
	if (validateEmail() ==true ){												
	document.forms[ 'special_ofert_form' ].submit();						
	}												
}
					
function validateEmail(){
	
	validMail=/^[a-zA-Z0-9._-]+\@([a-zA-Z0-9_-]+\.){1,}[\w]{1,5}$/;					
	var blad ='';
	email = document.getElementById('email');
	
	if (email.value == '')
	{						
		blad+='\n '+'Brak adresu email';		
	}
	
	if (email.value != '' && email.value.search(validMail) == -1){
		blad+='\n '+ 'Niepoprawny format adresu email';
	}
	 if (blad !=''){
	 		alert(blad);
	 		return false;
	 }						 
	 return true;
}



