function applyDefaultValue(elem, val){
    elem.style.color = '#d1999c';
    elem.value = val;
    elem.onfocus = function(){
        if (this.value == val) {
            this.style.color = '#be7175';
            this.value = '';
        }
    }
    elem.onblur = function(){
        if (this.value == '') {
            this.style.color = '#d1999c';
            this.value = val;
        }
    }
}

$(window).load(function() {
	$('#headline').nivoSlider({
		animSpeed:400,
		pauseTime:7000,
		effect: 'fade',
		slices: 1,
		pauseOnHover:false,
		directionNav:false
	});
	$('#event-rotator').nivoSlider({
		effect: 'fold',
		slices: 1,
		pauseOnHover:true,
		directionNav:false
	});
	
	$(function(){
		if($('body').hasClass('pl')){
			applyDefaultValue(document.getElementById('sNewsletterMail'), 'Twój e-mail');
			applyDefaultValue(document.getElementById('dArrivalDate'), 'Data przyjazdu');
		    applyDefaultValue(document.getElementById('dDepartureDate'), 'Data wyjazdu');
		    applyDefaultValue(document.getElementById('iAdults'), 'Dorosłych');
		    applyDefaultValue(document.getElementById('iChildren'), 'Dzieci');
		    applyDefaultValue(document.getElementById('cDate'), 'Data konferencji');
		    applyDefaultValue(document.getElementById('cPeople'), 'Ilość osób');
		    
		    if($('body').hasClass('contact')){
			    applyDefaultValue(document.getElementById('sNameCForm'), 'Imię i nazwisko');
			    applyDefaultValue(document.getElementById('sMailCForm'), 'Adres e-mail');
			    applyDefaultValue(document.getElementById('sPhoneCForm'), 'Numer telefonu');
			    applyDefaultValue(document.getElementById('sSubjectCForm'), 'Temat zapytania');
			    applyDefaultValue(document.getElementById('sContentCForm'), 'Treść zapytania');
		    }
		    if($('body').hasClass('private_reservation')){
			    applyDefaultValue(document.getElementById('iNOfRooms'), 'Ilość pokoi');
			    applyDefaultValue(document.getElementById('iNOfPeople'), 'Ilość osób w pokoju');
			    applyDefaultValue(document.getElementById('dPrivateArrivalDate'), 'Data przyjazdu'); 
			    applyDefaultValue(document.getElementById('dPrivateDepartureDate'), 'Data wyjazdu');
			    applyDefaultValue(document.getElementById('sPrivateName'), 'Imię i nazwisko'); 
			    applyDefaultValue(document.getElementById('sPrivateCompany'), 'Nazwa firmy');
			    applyDefaultValue(document.getElementById('sPrivatePhone'), 'Numer telefonu'); 
			    applyDefaultValue(document.getElementById('sPrivateMail'), 'Adres e-mail');
			    applyDefaultValue(document.getElementById('sPrivateAdditional'), 'Dodatkowe uwagi i wymagania'); 
		    }
		    
		    if($('body').hasClass('creservation')){
			    applyDefaultValue(document.getElementById('sBRName'), 'Imię i nazwisko');
			    applyDefaultValue(document.getElementById('sBRCompany'), 'Nazwa firmy');
			    applyDefaultValue(document.getElementById('sBRPhone'), 'Numer telefonu'); 
			    applyDefaultValue(document.getElementById('sBRMail'), 'Adres e-mail');
			    applyDefaultValue(document.getElementById('sBRNOfPeople'), 'Ilość osób'); 
			    applyDefaultValue(document.getElementById('sBRTiming'), 'Czas trwania');
			    applyDefaultValue(document.getElementById('dBRDate'), 'Data wynajmu'); 
		    }
		    
		    if($('body').hasClass('career')){
				applyDefaultValue(document.getElementById('sCareerName'), 'Imię i nazwisko');
				applyDefaultValue(document.getElementById('sCareerPosition'), 'Preferowane stanowisko');
				applyDefaultValue(document.getElementById('sCareerAddress'), 'Adres'); 
				applyDefaultValue(document.getElementById('sCareerPhone'), 'Numer telefonu');
				applyDefaultValue(document.getElementById('sCareerMail'), 'Adres e-mail'); 
				applyDefaultValue(document.getElementById('fCareerCV'), 'Plik z CV');
				applyDefaultValue(document.getElementById('fCareerList'), 'Plik z listem motywacyjnym'); 
				applyDefaultValue(document.getElementById('fCareerPhoto'), 'Plik ze zdjęciem');
				applyDefaultValue(document.getElementById('sCareerContent'), 'Treść wiadomości');
		    }
			
		    if($('body').hasClass('send_your_opinion_business')){
			    applyDefaultValue(document.getElementById('cDate'), 'Data konferencji/bankietu');
			    applyDefaultValue(document.getElementById('iPeople'), 'Ilość osób');
			    applyDefaultValue(document.getElementById('sQuestionareComments'), 'Dodatkowe uwagi które pomogą nam udoskonalić nasz serwis');
			    applyDefaultValue(document.getElementById('qFormRoom'), 'Państwa numer pokoju');
			    applyDefaultValue(document.getElementById('qFormName'), 'Imię i nazwisko');
			    applyDefaultValue(document.getElementById('qFormMail'), 'Adres e-mail');
			    applyDefaultValue(document.getElementById('qFormArrival'), 'Data przyjazdu');
		    }
		    
		    if($('body').hasClass('send_your_opinion_private')){
			    //applyDefaultValue(document.getElementById('cDate'), 'Data konferencji/bankietu');
			   // applyDefaultValue(document.getElementById('iPeople'), 'Ilość osób');
			    applyDefaultValue(document.getElementById('sQuestionareComments'), 'Dodatkowe uwagi które pomogą nam udoskonalić nasz serwis');
			    applyDefaultValue(document.getElementById('qFormRoom'), 'Państwa numer pokoju');
			    applyDefaultValue(document.getElementById('qFormName'), 'Imię i nazwisko');
			    applyDefaultValue(document.getElementById('qFormMail'), 'Adres e-mail');
			    applyDefaultValue(document.getElementById('qFormArrival'), 'Data przyjazdu');
		    }
		    
		    


		}
		else if($('body').hasClass('en')){
			applyDefaultValue(document.getElementById('sNewsletterMail'), 'Your e-mail');
			applyDefaultValue(document.getElementById('dArrivalDate'), 'Arrival date');
		    applyDefaultValue(document.getElementById('dDepartureDate'), 'Departure date');
		    applyDefaultValue(document.getElementById('iAdults'), 'Adults');
		    applyDefaultValue(document.getElementById('iChildren'), 'Children');
		    applyDefaultValue(document.getElementById('cDate'), 'Date');
		    applyDefaultValue(document.getElementById('cPeople'), 'Number of people');
		    
		    if($('body').hasClass('contact')){
			    applyDefaultValue(document.getElementById('sNameCForm'), 'Name and surname');
			    applyDefaultValue(document.getElementById('sMailCForm'), 'E-mail');
			    applyDefaultValue(document.getElementById('sPhoneCForm'), 'Phone number');
			    applyDefaultValue(document.getElementById('sSubjectCForm'), 'Subject');
			    applyDefaultValue(document.getElementById('sContentCForm'), 'Question');
		    }
		    
		    if($('body').hasClass('private_reservation')){
				applyDefaultValue(document.getElementById('iNOfRooms'), 'Number of rooms');
				applyDefaultValue(document.getElementById('iNOfPeople'), 'Number of people');
				applyDefaultValue(document.getElementById('dPrivateArrivalDate'), 'Arrival date'); 
				applyDefaultValue(document.getElementById('dPrivateDepartureDate'), 'Departure date');
				applyDefaultValue(document.getElementById('sPrivateName'), 'Name and last name'); 
				applyDefaultValue(document.getElementById('sPrivateCompany'), 'Company name');
				applyDefaultValue(document.getElementById('sPrivatePhone'), 'Phone number'); 
				applyDefaultValue(document.getElementById('sPrivateMail'), 'E-mail');
				applyDefaultValue(document.getElementById('sPrivateAdditional'), 'Additional comments'); 
		    }
		    
		    if($('body').hasClass('creservation')){
			    applyDefaultValue(document.getElementById('sBRName'), 'Name and surname');
			    applyDefaultValue(document.getElementById('sBRCompany'), 'Company name');
			    applyDefaultValue(document.getElementById('sBRPhone'), 'Phone number'); 
			    applyDefaultValue(document.getElementById('sBRMail'), 'E-mail');
			    applyDefaultValue(document.getElementById('sBRNOfPeople'), 'Number of people'); 
			    applyDefaultValue(document.getElementById('sBRTiming'), 'Duration');
			    applyDefaultValue(document.getElementById('dBRDate'), 'Date'); 
		    }
		    
		    if($('body').hasClass('career')){
				applyDefaultValue(document.getElementById('sCareerName'), 'Name and surname');
				applyDefaultValue(document.getElementById('sCareerPosition'), 'Preferred position');
				applyDefaultValue(document.getElementById('sCareerAddress'), 'Address'); 
				applyDefaultValue(document.getElementById('sCareerPhone'), 'Phone number');
				applyDefaultValue(document.getElementById('sCareerMail'), 'E-mail'); 
				applyDefaultValue(document.getElementById('fCareerCV'), 'Resume file');
				applyDefaultValue(document.getElementById('fCareerList'), 'Cover Letter file'); 
				applyDefaultValue(document.getElementById('fCareerPhoto'), 'Photo');
				applyDefaultValue(document.getElementById('sCareerContent'), 'Message');
		    }
		    
			if($('body').hasClass('send_your_opinion_business')){
			    applyDefaultValue(document.getElementById('cDate'), 'Conference/banquette date');
			    applyDefaultValue(document.getElementById('iPeople'), 'Number of people');
			    applyDefaultValue(document.getElementById('sQuestionareComments'), 'Additional remarks which will help us to improve our services');
			    applyDefaultValue(document.getElementById('qFormRoom'), 'Your room number');
			    applyDefaultValue(document.getElementById('qFormName'), 'Name and surname');
			    applyDefaultValue(document.getElementById('qFormMail'), 'E-mail');
			    applyDefaultValue(document.getElementById('qFormArrival'), 'Arrival date'); 
			}
			
			
		}
		else if($('body').hasClass('de')){
			applyDefaultValue(document.getElementById('sNewsletterMail'), 'Ihre E-Mail');
			applyDefaultValue(document.getElementById('dArrivalDate'), 'Anreis');
		    applyDefaultValue(document.getElementById('dDepartureDate'), 'Abreise');
		    applyDefaultValue(document.getElementById('iAdults'), 'Erwachsene');
		    applyDefaultValue(document.getElementById('iChildren'), 'Kinder');
		    applyDefaultValue(document.getElementById('cDate'), 'Datum');
		    applyDefaultValue(document.getElementById('cPeople'), 'Anzahl der Personen');
			if($('body').hasClass('contact')){
			    applyDefaultValue(document.getElementById('sNameCForm'), 'Name');
			    applyDefaultValue(document.getElementById('sMailCForm'), 'E-mail');
			    applyDefaultValue(document.getElementById('sPhoneCForm'), 'Telefonnummer');
			    applyDefaultValue(document.getElementById('sSubjectCForm'), 'Thema');
			    applyDefaultValue(document.getElementById('sContentCForm'), 'Frage');
			}
			if($('body').hasClass('private_reservation')){
				applyDefaultValue(document.getElementById('iNOfRooms'), 'Anzahl der Zimmer');
				applyDefaultValue(document.getElementById('iNOfPeople'), 'Anzahl der Personen im Raum');
				applyDefaultValue(document.getElementById('dPrivateArrivalDate'), 'Anreis'); 
				applyDefaultValue(document.getElementById('dPrivateDepartureDate'), 'Abreise');
				applyDefaultValue(document.getElementById('sPrivateName'), 'Name'); 
				applyDefaultValue(document.getElementById('sPrivateCompany'), 'Firmenname');
				applyDefaultValue(document.getElementById('sPrivatePhone'), 'Telefonnummer'); 
				applyDefaultValue(document.getElementById('sPrivateMail'), 'E-mail');
				applyDefaultValue(document.getElementById('sPrivateAdditional'), 'Zusätzliche Hinweise und Auflagen');
			}
			
			if($('body').hasClass('creservation')){
				    applyDefaultValue(document.getElementById('sBRName'), 'Name');
				    applyDefaultValue(document.getElementById('sBRCompany'), 'Firmenname');
				    applyDefaultValue(document.getElementById('sBRPhone'), 'Telefonnummer'); 
				    applyDefaultValue(document.getElementById('sBRMail'), 'E-mail');
				    applyDefaultValue(document.getElementById('sBRNOfPeople'), 'Anzahl der Personen'); 
				    applyDefaultValue(document.getElementById('sBRTiming'), 'Dauer');
				    applyDefaultValue(document.getElementById('dBRDate'), 'Datum'); 
			    }
			 
			if($('body').hasClass('career')){
				applyDefaultValue(document.getElementById('sCareerName'), 'Name');
				applyDefaultValue(document.getElementById('sCareerPosition'), 'Bevorzugte Position');
				applyDefaultValue(document.getElementById('sCareerAddress'), 'Adresse'); 
				applyDefaultValue(document.getElementById('sCareerPhone'), 'Telefonnummer');
				applyDefaultValue(document.getElementById('sCareerMail'), 'E-mail'); 
				applyDefaultValue(document.getElementById('fCareerCV'), 'Resume file');
				applyDefaultValue(document.getElementById('fCareerList'), 'Cover Letter file'); 
				applyDefaultValue(document.getElementById('fCareerPhoto'), 'Bild');
				applyDefaultValue(document.getElementById('sCareerContent'), 'Nachricht');
		    }
			
			if($('body').hasClass('send_your_opinion_business')){
			    applyDefaultValue(document.getElementById('cDate'), 'Konferenz Termin');
			    applyDefaultValue(document.getElementById('iPeople'), 'Anzahl der Personen');
			    applyDefaultValue(document.getElementById('sQuestionareComments'), 'Zusätzliche Bemerkungen, dank denen wir unsere Leistungen verbessern können');
			    applyDefaultValue(document.getElementById('qFormRoom'), 'Zimmernummer');
			    applyDefaultValue(document.getElementById('qFormName'), 'Name / Stellung');
			    applyDefaultValue(document.getElementById('qFormMail'), 'E-mail');
			    applyDefaultValue(document.getElementById('qFormArrival'), 'Anreis');  
			}
			
		    
		}
		else if($('body').hasClass('ru')){
			applyDefaultValue(document.getElementById('dArrivalDate'), 'Прибытие');
		    applyDefaultValue(document.getElementById('dDepartureDate'), 'Отъезд');
		    applyDefaultValue(document.getElementById('iAdults'), 'Взрослые');
		    applyDefaultValue(document.getElementById('iChildren'), 'Дети');
		    applyDefaultValue(document.getElementById('cDate'), 'день');
		    applyDefaultValue(document.getElementById('cPeople'), 'Количество человек');
		    if($('body').hasClass('contact')){
			    applyDefaultValue(document.getElementById('sNameCForm'), 'Имя и фамилия');
			    applyDefaultValue(document.getElementById('sMailCForm'), 'E-mail');
			    applyDefaultValue(document.getElementById('sPhoneCForm'), 'Номер телефона');
			    applyDefaultValue(document.getElementById('sSubjectCForm'), 'тема');
			    applyDefaultValue(document.getElementById('sContentCForm'), 'вопрос');
		    }
		    if($('body').hasClass('private_reservation')){
				applyDefaultValue(document.getElementById('iNOfRooms'), 'Количество номеров');
				applyDefaultValue(document.getElementById('iNOfPeople'), 'количество людей в комнате');
				applyDefaultValue(document.getElementById('dPrivateArrivalDate'), 'Дата заезда'); 
				applyDefaultValue(document.getElementById('dPrivateDepartureDate'), 'Дата отъезда');
				applyDefaultValue(document.getElementById('sPrivateName'), 'Имя и фамилия'); 
				applyDefaultValue(document.getElementById('sPrivateCompany'), 'Фирма');
				applyDefaultValue(document.getElementById('sPrivatePhone'), 'Номер телефона'); 
				applyDefaultValue(document.getElementById('sPrivateMail'), 'E-mail');
				applyDefaultValue(document.getElementById('sPrivateAdditional'), 'Дополнительная информация');
		    }
		    
			if($('body').hasClass('creservation')){
			    applyDefaultValue(document.getElementById('sBRName'), 'Имя и фамилия');
			    applyDefaultValue(document.getElementById('sBRCompany'), 'Фирма');
			    applyDefaultValue(document.getElementById('sBRPhone'), 'Номер телефона'); 
			    applyDefaultValue(document.getElementById('sBRMail'), 'E-mail');
			    applyDefaultValue(document.getElementById('sBRNOfPeople'), 'Количество человек'); 
			    applyDefaultValue(document.getElementById('sBRTiming'), 'продолжительность');
			    applyDefaultValue(document.getElementById('dBRDate'), 'День'); 
		    }
			
		    if($('body').hasClass('career')){
				applyDefaultValue(document.getElementById('sCareerName'), 'Имя и фамилия');
				applyDefaultValue(document.getElementById('sCareerPosition'), 'Preffered position');
				applyDefaultValue(document.getElementById('sCareerAddress'), 'адрес'); 
				applyDefaultValue(document.getElementById('sCareerPhone'), 'Номер телефона');
				applyDefaultValue(document.getElementById('sCareerMail'), 'E-mail'); 
				applyDefaultValue(document.getElementById('fCareerCV'), 'Присоединить файл с Вашим резюме');
				applyDefaultValue(document.getElementById('fCareerList'), 'Присоединить файл с мотивационным письмом'); 
				applyDefaultValue(document.getElementById('fCareerPhoto'), 'Присоединить файл с Вашим снимком');
				applyDefaultValue(document.getElementById('sCareerContent'), 'Содержание сообщения');
		    }
		  		
			if($('body').hasClass('send_your_opinion_business')){
			    applyDefaultValue(document.getElementById('cDate'), 'Дата конференции/банкета');
			    applyDefaultValue(document.getElementById('iPeople'), 'Количество человек');
			    applyDefaultValue(document.getElementById('sQuestionareComments'), 'Дополнительные комментарии');
			    applyDefaultValue(document.getElementById('qFormRoom'), 'номер комнаты');
			    applyDefaultValue(document.getElementById('qFormName'), 'Имя и фамилия');
			    applyDefaultValue(document.getElementById('qFormMail'), 'E-mail');
			    applyDefaultValue(document.getElementById('qFormArrival'), 'Прибытие');
			}
		    applyDefaultValue(document.getElementById('sNewsletterMail'), 'E-mail');
		}
	});
   
    
    
	
	//$('#headline').data('nivo:vars').stop = true;
});

$(document).ready(function() {
	
	

	
	Cufon.replace('h1');
	Cufon.replace('#sidebar h2');
	Cufon.replace('#primary-navigation li span');
	Cufon.replace('.package h2');
	Cufon.replace('.form-wrapper h2');
	
	Cufon.replace('body.ru h1', { fontFamily: 'Myriad Pro' });
	Cufon.replace('body.ru #sidebar h2', { fontFamily: 'Myriad Pro' });
	Cufon.replace('body.ru #primary-navigation li span', { fontFamily: 'Myriad Pro' });
	Cufon.replace('body.ru .package h2', { fontFamily: 'Myriad Pro' });
	Cufon.replace('body.ru .form-wrapper h2', { fontFamily: 'Myriad Pro' });
	
//	Cufon.replace('h2', { fontFamily: 'Myriad Pro' });


	$("ul#sub-language").parent().append("<span></span>");
	$("ul#language-choice li span").click(function() {
		if (!($('ul#sub-language').is(':visible'))) {
			$(this).parent().find("ul#sub-language").slideDown('fast');
		} else {
			$(this).parent().find("ul#sub-language").slideUp('fast');
		}

	});

	$("ul#language-choice li ").click(function() {

		if (!($('ul#sub-language').is(':visible'))) {

			$(this).parent().find("ul#sub-language").slideDown('fast');
		} else {

			$(this).parent().find("ul#sub-language").slideUp('fast');
		}

	});

	$("ul#language-choice").mouseleave(function() {
		$("ul#sub-language").slideUp('fast');
	});
	
	$("#conference").click(function(){
		$("#room-book").hide();
		$("#conference-book").show();
		if($("body").hasClass("pl")){
			$("#room").css("background-position", "0 -13px");
			$("#conference").css("background-position", "-58px 0");
		}
		else if($("body").hasClass("en")){
			$("#room").css("background-position", "0 -38px");
			$("#conference").css("background-position", "-57px -27px");
		}
		else if($("body").hasClass("de")){
			$("#room").css("background-position", "0 -60px");
			$("#conference").css("background-position", "-67px -49px");
		}
		else if($("body").hasClass("ru")){
			$("#room").css("background-position", "0 -83px");
			$("#conference").css("background-position", "-57px -72px");
		}
	});
	
	$("#room").click(function(){
		$("#conference-book").hide();
		$("#room-book").show();
		if($("body").hasClass("pl")){
			$("#room").css("background-position", "0 0");
			$("#conference").css("background-position", "-58px -13px");
		}
		else if($("body").hasClass("en")){
			$("#room").css("background-position", "0 -27px");
			$("#conference").css("background-position", "-57px -38px");
		}
		else if($("body").hasClass("de")){
			$("#room").css("background-position", "0 -49px");
			$("#conference").css("background-position", "-67px -60px");
		}
		else if($("body").hasClass("ru")){
			$("#room").css("background-position", "0 -72px");
			$("#conference").css("background-position", "-57px -83px");
		}
	});

	$(".package h2").click(function(){
		$(this).next(".wrapper").slideToggle();
	});
	
	//$(".package h2").mouseover(function(){
	//	$(this).parent().css("border-color", "#d3cec2");
	//});
	//$(".package h2").mouseleave(function(){
	//	$(this).parent().css("border-color", "#dedbd3");
	//});
	$(".package").mouseover(function(){
		$(this).parent().css("border-color", "#d3cec2");
	});
	$(".package").mouseleave(function(){
		$(this).parent().css("border-color", "#dedbd3");
	});
	
	
});

$(function () {
	$('.sub-level').each(function () {
	$(this).parent().eq(0).hover(function () {
	$('.sub-level:eq(0)', this).show();
	}, function () {
	$('.sub-level:eq(0)', this).hide();
	});
	});
});

$(function() {
	$("#dArrivalDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});

$(function() {
	$("#cDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});

$(function() {
	$("#dPrivateArrivalDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});

$(function() {
	$("#dPrivateDepartureDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});

$(function() {
	$("#dDepartureDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});
$(function() {
	$("#dBRDate").datepicker({
		showOn: 'button',
		buttonImage: 'http://mdspot.pl/sympozjum/img/calendar.png',
		buttonImageOnly: true,
		dateFormat: 'dd/mm/yy'
	});
});





// IE7 z-index fix


// eof fix




