// Javascript document
jQuery.noConflict();
(function($) { 
  $(function() {
   $(document).ready(function(){
   		maxSisteme=51;
   		rezultatSisteme = $('.rezultatSisteme');
		$('#slider').html("").slider({
			change: function (event,ui) { 
				var tempVal= Math.floor(maxSisteme * $(this).slider( "option", "value" ) / 100 );
				
				if (tempVal <= 1) { 
				    tempTxt = cexLangJs[0];
				    
			    }
				else if (tempVal >= 34) { 
				    tempTxt = cexLangJs[1];
				    $('.slideContent').animate({
					"left": - 2 * 780 + "px"
				});
				    
			    }
				else if ((tempVal > 16) && (tempVal < 34)) { 
				    tempTxt = (16 + Math.floor(((tempVal-16)/17)*33)) + cexLangJs[2];

				    $('.slideContent').animate({
					    "left": - 1 * 780 + "px"
				    });
			    }
				else { tempTxt = tempVal + cexLangJs[2];
				    $('.slideContent').animate({
					    "left": - 0 * 780 + "px"
				    });
    			}
				$('#numarSisteme').html(tempTxt);
				if(rezultatSisteme.css('display')=="none")  {
					rezultatSisteme.fadeIn();
				}
				
				
			},
			slide: function(event, ui) {  
				var tempVal= Math.floor(maxSisteme * $(this).slider( "option", "value" ) / 100 );
				if (tempVal <= 1) { tempTxt = cexLangJs[0];}
				else if (tempVal >= 34) { tempTxt = cexLangJs[1];}
				else if ((tempVal > 16) && (tempVal < 34)) { tempTxt = (16 + Math.floor(((tempVal-16)/17)*33)) + cexLangJs[2];}
				else { tempTxt = tempVal + cexLangJs[2];}
				$('#numarSisteme').html(tempTxt);
				
				if(rezultatSisteme.css('display')=="none")  {
					rezultatSisteme.fadeIn();
				}
				clearInterval(slider_ID);
			}, 
			animate: true
		});
		
		function animateSlider () {
		    sVal = $('#slider').slider("value");
		    sVal = (sVal > 74) ? 26 : sVal + 26;
		    $('#slider').slider("value", sVal);
		   
		}

        slider_ID = setInterval (function() { animateSlider () }, 2000);
		
		
		$('.more-less').click(function (){
			myTarget = $(this).siblings('.boxRoundedContent:eq(0)');
			if($(this).attr('direction')=="down") {
				myTarget.animate({
					'height':'422px'
				})
				$(this).html(cexLangJs[3]).attr('direction', 'up');
			} else {
				myTarget.animate({
					'height':'209px'
				})
				$(this).html(cexLangJs[4]).attr('direction', 'down');
			}
			return false;
		});
		
		$('.sideServiciu').hover(function() {
		    
		    $(this).find('.servDetalii').slideDown('fast');
		   
		}, function () {
		    $(this).stop(true, true);
		    $(this).find('.servDetalii').stop(true, true).slideUp('fast');
		});
		
		
		
		
	});
  });
})(jQuery);



