$(function() {

// init
if ($('#toggleGutscheinBox').is(':not(:checked)')) {
	$('#gutschein-box').hide();
}
if ($('#togglePromotionBox').is(':not(:checked)')) {
	$('#gutschein-einloesen').hide();
}
if ($('#toggleLieferanschrift').is(':not(:checked)')) {
	$('#deliveryAdress').hide();
}

$('#toggleGutscheinBox').click(function() {
		$('#gutschein-box').toggle();
});
$('#togglePromotionBox').click(function() {
		$('#gutschein-einloesen').toggle();
});
$('#toggleLieferanschrift').click(function() {
		$('#deliveryAdress').toggle();
});

/* Pflichtfelder */
$('#gender,#firstname,#lastname,#street,#zip,#city,#country,#phone,#email').css('background-color', '#C0E0E0');

$('#lfd-gender,#lfd-firstname,#lfd-lastname,#lfd-street,#lfd-zip,#lfd-city,#lfd-country').css('background-color', '#C0E0E0');

$('#gender,#firstname,#lastname,#street,#zip,#city,#country,#phone,#email').focus(function() {
	$(this).css('background-color', '#fff');
});

$('#lfd-gender,#lfd-firstname,#lfd-lastname,#lfd-street,#lfd-zip,#lfd-city,#lfd-country').focus(function() {
	$(this).css('background-color', '#fff');
});

// 
// $("#calendar").datepicker($.extend({},
// 	$.datepicker.regional["de"], { 
//     onSelect: function(date) { 
//         alert("The chosen date is " + date); 
//     } 
// })); 
// $("#altCalendar").hide();

// $("#calendar").datepicker($.extend({}, 
// $.datepicker.regional["de"], { 
//     dateFormat: "DD, MM d, yy", 
//     showOn: "both", 
//     buttonImage: "templates/images/calendar.gif", 
//     buttonImageOnly: true 
// }));

	
	// Take Text as Parameter. fetch html and toggle view
	// $('table.tbl-cal td > a').hover(
	// 		function(e) {
	// 			var con = $(this).text();
	// 			
	// 			// hide all past ocurrencies
	// 			$('#content').hide();
	// 			
	// 			var top = e.pageY;
	// 			var left = e.pageX;
	// 
	// 			var folder = $('.calchooser table select option:selected').val().toLowerCase();
	// 				
	// 			$.get('calendar-days/' + folder + '/' + con + '.html',
	// 				function(data) {
	// 					
	// 					$('body').append('<div id="content"></div>');
	// 					$('#content').css({	position: 'absolute',
	// 						top: top,
	// 						left: left,
	// 						width: '200px',
	// 						backgroundColor: 'red',
	// 						display: 'block'
	// 					});
	// 					$('#content').html(data).show();
	// 				}
	// 			);
	// 		},
	// 		function() {
	// 			
	// 			$('#content').hide();
	// 
	// 			$('#content').hover(
	// 				function() {
	// 					$(this).css({display: 'block'});
	// 			},
	// 				function() {
	// 					$(this).hide();
	// 			});
	// 			
	// 		}
	// 	);		
			
});	
		
