
Cufon('h1')('h2');

$(document).ready(function() {

	$('#slideshowHome').cycle({ fx: 'fade', speed: 1000, timeout: 4000 });
	$('#slideshow').cycle({ fx: 'fade', speed: 1000, timeout: 0, prev: '#prev', next: '#next', pager: '#nav' });
	
	$('a.where').bind('click', function() {
		var target = $(this).attr('href');
		$(target).ScrollTo('slow');
		return false;
	});	
	
	$('#email').val($('#email').attr('title'));
	$('#email').focus(function(){
		if($(this).val() == $(this).attr('title'))
			$(this).val('');	
	});
	$('#email').blur(function(){
		if($(this).val() == '')
			$(this).val($(this).attr('title'));	
	});
	
});

function subscribeNewsletter(){
	$.get("ajax_manager.php", { email: $('#email').val() }, function(data){
		  if(data == "badformat")
			 alert('Hibás e-mail formátum!');
		  else if(data == "onlist")
			  alert('Az Ön e-mail címe már szerepel a listán!');
		  else if(data == "done"){
			  alert('Felvettük hírlevél listánkra! Köszönjük.');
			  $('#email').val('');
		  }
	});
}