jQuery(function() {
        jQuery('.date-pick').datePicker({clickInput:true})
//        jQuery('.date-pick').dpSetStartDate('2000.01.01');

	jQuery.dpText = {
        TEXT_PREV_YEAR      :   'Előző év',
        TEXT_PREV_MONTH     :   'Előző hó',
        TEXT_NEXT_YEAR      :   'Következő év',
        TEXT_NEXT_MONTH     :   'Következő hó',
        TEXT_CLOSE          :   'Bezár',
        TEXT_CHOOSE_DATE    :   'Kérem válasszon napot!'
	};
});

jQuery(document).ready(function() {	

	//Get the height of the first item
	jQuery('#mask').css({'height':jQuery('#panel-1').height()});	
	
	//Calculate the total width - sum of all sub-panels width
	//Width is generated according to the width of #mask * total of sub-panels
	jQuery('#panel').width(parseInt(jQuery('#mask').width() * jQuery('#panel div.pane').length));
	
	//Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
	jQuery('#panel div.pane').width(jQuery('#mask').width());
	
	//Get all the links with rel as panel
	jQuery('a[rel=panel]').click(function () {
	
		//Get the height of the sub-panel
		var panelheight = jQuery(jQuery(this).attr('href')).height();
		
		//Set class for the selected item
		jQuery('a[rel=panel]').removeClass('selected');
		jQuery(this).addClass('selected');
		
		//Resize the height
		jQuery('#mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
		jQuery('#mask').scrollTo(jQuery(this).attr('href'), 800);		
		
		//Discard the link default behavior
		return false;
	});
		});


