Date.format = 'yyyy-mm-dd';

$(document).ready(function() { 
		
    $(document).pngFix();
    
	$('.slideshow ul').innerfade({
		speed: 'slow',
		timeout: 5000,
		type: 'sequence',
		containerheight: '225px'
	});
	
	
	$('.cycle').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

		
	$('a.fancybox_text').fancybox({
		ajax : {
			type : 'POST'
			},
		padding : 5,
		width : 400
	});

	$('a.fancybox_img').fancybox({
		'transitionIn': 'fade',
		'transitionOut': 'fade',
		'speedIn': 600, 
		'speedOut': 200
	});
	
	$('form input, form select, form textarea').bind('focus', function(){
		$('div').removeClass('highlight');
		$(this).parent('div').addClass('highlight');
	});

	$('form input.placeholder').bind('focus', function(){
		$(this).removeClass('placeholder').attr('value','');
	});

// FIX: This needs to be activated but the client config needs to extend the function for specific forms
// 	$('form.validate').validate({
// 		success: function(label) {
// 			label.text('Okay').addClass('valid');
// 		}
// 	});

	$('img.help[alt]').qtip({
	style: {
			width: 400,
			padding: 5,
			background: '#FFFFCD',
			color: '#333333',
			border:
				{
					width: 1,
					color: '#CC9838'
				},
			tip: true
		}
	});
	
	$('.confirmation').addClass('fadein');
	
	$('.fadein').fadeIn(2000);
	
// Remove the placeholders
// 			$('input[@type=text]').each(function() {
// 				
// 				if ($(this).attr('name') != 'quantity') {
// 					if ($(this).attr('value') == $(this).attr('defaultValue')) {
// 						$(this).attr('value','');
// 					}
// 				}
// 			});
			
			
			
	$('.validate').validate({
		success: function(label) {
			label.text('Okay').addClass('valid');
		}
	});
		
		
	// Activate datepicker on #date_of_birth
	$('input.date_iso').datepicker();
// 	$("input#date_of_birth").datePicker({minDate: -20, maxDate: '+1M +10D'});

		

}); 


