﻿

	var move = 0;
	$(document).ready(function(){
		$('.dictionary .content h3:eq(0)').click(function(e) { Dictionary(e,0,"main_form_dictionary_word")});	
		$('.dictionary .content h3:eq(1)').click(function(e) { Dictionary(e,1,"main_form_dictionary_word")});					   
		
		var total_width =0;
		total_width = 8*parseFloat($("#pictures img:eq(0)").width());
		$("#pictures").width(total_width+250);
			
		$("#slider_right_but").hover(function(){
			move = setInterval("MoveSliderRight()",10); 
		},function(){
			 clearInterval(move);
		});
	
		$("#slider_left_but").hover(function(){
			move =  setInterval("MoveSliderLeft()",10); 	  								  
		},function(){
			 clearInterval(move)
		});
		
		$("#pictures img").hover(function(){
			//$(this).hide();										 
			var tmp = $(this).attr("src");
			
			tmp = tmp.replace("SmallGalimGifPicture","GalimGifPicture")
			//$("#pictures img:first").css("margin-right","-20px")
			$(this).attr("src",tmp);
			
			$(this).stop();
			
			$(this).animate({ 
				width: "142px",
				height: "57px"	
			  }, 300 );
			
			},function(){
				
			var tmp = $(this).attr("src");
			tmp = tmp.replace("GalimGifPicture","SmallGalimGifPicture")
			$(this).attr("src",tmp);
			
			$(this).stop();
			
			$(this).animate({ 
				width: "63px",
				height: "57px"		
			  }, 100 );
			
			});
	 });

		function MoveSliderRight(){
			total_width =0;
			$("#pictures img").each(function(index){
    			total_width += $(this).width();
  			});
			$("#pictures").width(total_width+170);
			
			var tmp = $("#pictures img").length-8;
			tmp= -(tmp*($("#pictures img:eq(0)").width()));

			if(parseFloat($("#pictures").css("margin-right")) < tmp+10)
				clearInterval(move);
			else
				$("#pictures").css("margin-right",parseFloat($("#pictures").css("margin-right"))-2);			
			}
			
		function MoveSliderLeft(){	
			if(parseFloat($("#pictures").css("margin-right")) == 21)
				clearInterval(move);
			else
				$("#pictures").css("margin-right",parseFloat($("#pictures").css("margin-right"))+2);
			}
			/////////////////End of Slider/////////////////
