$(function(){

// News Settings
	var newsSpeed = 10000;

// News Script	
	var newsNum = $("#latest-news a").length;
	var x = 1;
	function changenews(){
		$("#latest-news a").removeClass("current").fadeOut(0);
		$("#latest-news a:eq(" + x + ")").addClass("current").fadeOut().fadeIn();
		if (x < (newsNum - 1)) {
			x++;
		}
		else {
			x = 0;
		}
		setTimeout(changenews,newsSpeed);
	}
	setTimeout(changenews,newsSpeed);
	
	var newsNum2 = $("#latest-headline a").length;
	var y = 1;
	function changeheadline(){
		$("#latest-headline a").removeClass("current").fadeOut(0);
		$("#latest-headline a:eq(" + y + ")").addClass("current").fadeOut().fadeIn();
		if (y < (newsNum2 - 1)) {
			y++;
		}
		else {
			y = 0;
		}
		setTimeout(changeheadline,newsSpeed);
	}
	setTimeout(changeheadline,newsSpeed);
	
// End News Script
	
	

// Marquee load
$('marquee').marquee('pointer').mouseover(function () {
  $(this).trigger('stop');
}).mouseout(function () {
  $(this).trigger('start');
}).mousemove(function (event) {
  if ($(this).data('drag') == true) {
    this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
  }
}).mousedown(function (event) {
  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
}).mouseup(function () {
  $(this).data('drag', false);
});

// End Marquee load



// Start Industry button script
	$("#industry-list li").hoverIntent(function(){
		$(this).addClass("industrybg").animate({
			"backgroundPosition": "20px"
		})
	}, function(){
		$("#industry-list li").dequeue().removeClass("industrybg").css("backgroundPosition", "-200px");
	});
// End Industry button script
	
	
});
