			function initSal(){
				jQuery('.features-selector li').mousemove(function(){
					return showNext(jQuery(this),true);
				});
				jQuery('.features-selector li a').vAlign();
				intervalLatestNews = setInterval("nextNews()",7000);
				jQuery('.latest-news').mousemove(function(){
					clearInterval(intervalLatestNews);
				});
				jQuery('.latest-news').mouseout(function(){
					intervalLatestNews = setInterval("nextNews()",7000);
				});
				jQuery('.latest-news-items ul').css('width',jQuery('.latest-news-items ul li').size() * 800);
				
			}
			function showNext(elem, clicked){
				
					var classes=elem.attr('class').split(' ');
					if(!classes[1]){
						var num= classes[0].charAt(classes[0].length-1);
						jQuery('.features-current').css({
							top: (98*(num-1))+1
						})
						var slide = (num % 3)+1;
						jQuery('.features-selector li').each(function(){
							jQuery(this).removeClass('active')
						});
						elem.addClass('active');
						jQuery('.features-images').scrollTop(370*(num-1));
					}
				return false;
			}
			function nextNews(){	
				var currentScroll = jQuery('.latest-news-items ul').css('left');
				currentScroll = currentScroll.split('px');
				currentScroll = parseInt(currentScroll[0])
				var widther = 0 - jQuery('.latest-news-items ul').width();
				var newScroll=((currentScroll - 800)<=widther)?'0':'-=800';
				jQuery('.latest-news-items ul').animate({left: newScroll},1000);
			}
			(function ($) {
				$.fn.vAlign = function(container) {
					return this.each(function(i){
				   if(container == null) {
					  container = 'div';
				   }
				   var paddingPx = 0; //change this value as you need (It is the extra height for the parent element)
				   $(this).html("<" + container + ">" + $(this).html() + "</" + container + ">");
				   var el = $(this).children(container + ":first");
				   var elh = $(el).height(); //new element height
				   var ph = $(this).height(); //parent height
				   if(elh > ph) { //if new element height is larger apply this to parent
					   $(this).height(elh + paddingPx);
					   ph = elh + paddingPx;
				   }
				   var nh = (ph - elh) / 2; //new margin to apply
				   $(el).css('margin-top', nh);
					});
				 };
			})(jQuery);
			
jQuery(document).ready(function() {
	initSal();
});
