<!--

var moving = false;
var xOffset = 10;
var	yOffset = -20;


$(function() {

	$("#scrollRight").mousehold(function(){
		
		var left = $("#newsSlider").css("left");	
		//var display = $("#move_up").css("display");
		var width = $('#newsSlider').innerWidth();
		var containerWidth = $("#newsSliderContainer").css("width");
				
		left = left.replace("px","")
		containerWidth = containerWidth.replace("px","")
			
		left = parseInt(left)
		containerWidth = parseInt(containerWidth)
		
		var maxLeft = width - containerWidth;
			
		maxLeft = maxLeft - (maxLeft*2);
			
		var nextLeft = left - 707;
	
		if (nextLeft < maxLeft) {			
			nextLeft = maxLeft;
		}
		
		/*if (display == "none") {		
			$("#move_up").css("display","inline");
		}*/
		
		if (moving == false) {	
			
			if (width > containerWidth) {				
				moving = true;
				$("#newsSlider").animate({"left": nextLeft}, 500,function(){
					 moving = false;
					 if (nextLeft == maxLeft) {
						//$("#move_down").css("display","none");
					}				 
				});
			}	
		}
	});	
	
	$("#scrollLeft").mousehold(function(){
		var left = $("#newsSlider").css("left");	
		//var display = $("#move_down").css("display");	
		left = left.replace("px","")	
		left = parseInt(left)
			
		maxLeft = 0;
		
		var nextLeft = left + 642;
		
		if (nextLeft > maxLeft) {		
			nextLeft = maxLeft;	
		}
		
		/*if (display == "none") {		
			$("#move_down").css("display","inline");
		}*/
		
		if ((left < 0) && (moving == false)) {
			moving = true;
			$("#newsSlider").animate({"left": nextLeft}, 500,function(){
				 moving = false;
				 if (nextLeft == maxLeft) {
					//$("#move_up").css("display","none");
				}	
			});
		}
		
	
	});	
	
	
	$(".newsArticle a").click(function(e){			
		$("body").append("<div id='newsBackground'>&nbsp;</div>");
		$("#newsBackground").width($(window).width()).height($(document).height()).css("opacity", "0.7");		
		$("body").append("<div id='newsOverlay'>" + $(this).attr("rel") + "</div>");
		
		if ($("#newsOverlay").height() < 100) {
			$("#newsOverlay").height(100)	
		}
		
		$("#newsOverlay").centerInClient({ container: window });
		return false;
	});	
			 				   			
});

function closeNews() {
	$("#newsOverlay").remove();
	$("#newsBackground").remove();
}

$(window).resize(function() {
  	$("#newsBackground").width($(window).width()).height($(document).height());	
	$("#newsOverlay").centerInClient({ container: window });
});


//-->