$(document).ready(function(){
       $("#jante-sh").hover(function()
	   {
		 $(this).fadeOut(400);
		 $(this).fadeIn(400);
	   });

	   $("#config-sh").hover(function()
	   {
		 $(this).fadeOut(400);$(this).fadeIn(400);
	   });
	   $("#anvelope-sh").hover(function()
	   {
		 $(this).fadeOut(400);$(this).fadeIn(400);
	   });
	   
	   $("#home-f").hover(function()
	   {
		 $(this).fadeOut(400);$(this).fadeIn(400);
	   });
    });

    
 function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "swing",       
                autoPlay: true,                
                delay: 5000,                   
                startStopped: false,            
                animationTime: 2000,             
                hashTags: false,                
                buildNavigation: true,         
        		pauseOnHover:false,            
        		startText: "Start",            
		        stopText: "Stop",               
		        navigationFormatter: formatText       
            });            
        });   
		
$(function() {//galerie
$(function() {
        var settings = { 
		containerResizeSpeed: 500,
		 fixedNavigation: false
            };
            $('#gallery a').lightBox(settings);
        });
});

$(function() {//auto complete

        $("#search").autocomplete('autoshow.php',
		 {
			minChars: 3, 
			autoFill: true, 
			highlight: false,
			scroll: true,
			scrollHeight: 300
		  });
});
		
//filtru anvelope
	function updSezon(val)
				{
					$(function() 
					  {
								var dataString = 'sezon='+ val;
									$.ajax({
									type: "POST",
									url: "filtru-anv.php",
									data: dataString,
									success: function(){
									$('#tal').load('tmp.php');
									}			
									});
					 });
				}
				
				function updDim(val)
				{
					$(function() 
					  {
								var dataString = 'dim='+ val;
									$.ajax({
									type: "POST",
									url: "dim.php",
									data: dataString,
									success: function(){
									$('#dim').load('tmp-dim.php');
									}			
									});
					 });
				}
				
				function caut_anv()
				{
				   var sezon=document.anv.sezon.value;
				   var talon=document.anv.talon.value;
				   var dim=document.anv.dimensiune.value;
				   var ok=true;
					   if(sezon==0)
					   {
						  alert("Va rugam selectati SEZONUL dorit!");
						  ok=false;
					   }
					   if(talon==0)
					   {
						  alert("Va rugam selectati TALONUL dorit!");
						  ok=false;
					   }
					   /*if(dim==0)
					   {
						  alert("Va rugam selectati DIMENSIUNEA dorita!");
						  ok=false;
					   }*/
				   if(ok==true)
				   {
				   		window.location="http://ejanteanvelope.ro/caut-anvelope.php?sezon="+sezon+"&talon="+talon+"&dimensiune="+dim;
				   }
				}
		
