// JavaScript Document

var opencontent = true;

$(document).ready(function(){	

		   		   
		    $.ga.load('UA-2837349-26'); 
			
			function analytics(){
				try {
					$.ga._setDomainName("none");
					$.ga._setAllowLinker(true);
					$.ga._trackPageview();
				} catch(err) {}	
			} 
						
			$(".menu_box a, #footer a").hover(
			 function(){
			 	$(this).animate({ color: "#5f0c03" }, 300);
		  	 },
			 function(){
				 $(this).animate({ color: "#8b8b8b" }, 300);
			 });
			
			$(".menu_box a, #logo_box a").click(function(){
				if(opencontent){
					$(".menu_box a").removeClass('current');
					$(this).addClass('current');
				}
			});
			
			$('#slideshow').cycle({
				timeout: 4000,
				next:   '#next2', 
    			prev:   '#prev2' ,
				pager:  '#nav'
			});
			
			/*$('.menu_box ul a').click(function(){
				$('#content').toggle('blind', 1000);
				return false;
			});
			*/
			
			
			
			$('.paging a, .menu_box a, #footer ul a, .main_gallery a, .small_buttons a, #logo_box a').live('click',function() {											
				var obj = $(this).attr('href');
				if(opencontent){
					opencontent = false;
					$('#ajax_loader').show();
					$('#content').toggle('blind', 2000, function(){
						$.ajax({
							url: obj,
							type: "GET",
							cache: false,
							success: function(data){
								$('#ajax_loader').hide();
								$('#content').html(data).toggle('blind', 2000, function(){ opencontent = true; });
								analytics();
								CB_Init();
								$(".datepicker").datepicker({minDate: 0});
							}
						});
					});
				}
				
				return false;
			});
			
			
			$(".datepicker").datepicker({minDate: 0});
			
			$("#menu_box ul a").click(function(){
					$("#menu_box div ul a").removeClass('current');
					$(this).addClass('current');
			});
			
			$('#ReservationPlaceId').live('change', function(){
				$('#ReservationMealId option:first').attr('selected', 'selected');
				$('#ReservationMealId option').each(function(){
					if($('#ReservationPlaceId').attr('value') == 1 ||  $('#ReservationPlaceId').attr('value') == ''){
						$(this).attr('disabled', '');	
					} else {						
						if( $(this).attr('value') > 1 ){
							$(this).attr('disabled', 'disabled');
						}	
					}
				});
			});
			

});
