// JavaScript Document


$(document).ready(function(){	

			/*$.ga.load('UA-2837349-26'); 
			
			function analytics(){
				try {
					$.ga._setDomainName("none");
					$.ga._setAllowLinker(true);
					$.ga._trackPageview();
				} catch(err) {}	
			} 
			*/
			$('a.email').nospam({

				replaceText: true,

				filterLevel: 'low'

			}); 
			
			$('.menu a').click(function(){
				$(this).addClass('active');							
			});
			
			$(function() {
				$("#tabs").tabs();
			});
			
			
			// select #flowplanes and make it scrollable. use circular and navigator plugins 
			/*$("#flowpanes").scrollable({size: 1}).circular().autoscroll({interval:7000, autopause: false}).navigator({ 
		 
				// select #flowtabs to be used as navigator 
				navi: "#flowtabs", 
		 
				// select A tags inside the navigator to work as items (not direct children) 
				naviItem: 'li', 
		 
				// assign "current" class name for the active A tag inside navigator 
				activeClass: 'current' 
		 
			}); 
			*/
			
			$('#slideshow').cycle({
				timeout: 5000,
				next:   '#next2', 
    			prev:   '#prev2' ,
				pager:  '#slidenav'

			});

			
			
			$(".datepicker").datepicker();
	
			
			function init_gallery(){
			
				$(".car_image_box a").fancybox(
					{
						'padding'			: 1,
						'zoomOpacity'			: true,
						'overlayShow'			: false,
						'zoomSpeedIn'			: 500,
						'zoomSpeedOut'			: 500
				}); 
						
			}
			
			init_gallery();
			
			$('.brand_select').change(function(){
				var obj = $(this);
				$(this).parent().parent().children('.search_2').children('#VehicleBrandModelId').css({borderColor:'#ff0000'});
				$.ajax({
					url: 'http://www.eurocar98.hu/brand_models/models/'+$(this).attr('value'),
					type: "GET",
					cache: false,
					success: function(data){
						obj.parent().parent().children('.search_2').children('#VehicleBrandModelId').replaceWith(data);
					}
				});
				
			});
			
						
			//$(".datepicker").datepicker();

		   		   
			$("#scroller").scrollable({hoverClass: 'hover'}).circular().navigator().autoscroll({ 
				steps: 1, 
				interval: 5000         
			});
			
			$(".fancy").fancybox(
					{
						'padding'			: 1,
						'zoomOpacity'			: true,
						'overlayShow'			: false,
						'zoomSpeedIn'			: 500,
						'zoomSpeedOut'			: 500
			}); 
			
			$(".more_search").toggle(
			  function () {
				
				$(this).parent().parent().children('.hidden').show();
			  },
			  function () {
				$(this).parent().parent().children('.hidden').hide();
			  }
			);
			
			var h = $('#content').height();
			//$('#content2').height(Math.round(h/28)*28-10);

			
});
