<!--

var moving = false;

$(function() {
	
	var newsHeight = $('#scrollText_news').outerHeight();
	var newsContainerHeight = $("#scrollContainer_news").outerHeight();
	
	if (newsHeight < newsContainerHeight) {
		$("#move_up_news").css("display","none");
		$("#move_down_news").css("display","none");
	}
	
	var articleHeight = $('#scrollText').outerHeight();
	var articleContainerHeight = $("#scrollContainer").outerHeight();
	
	if (articleHeight < articleContainerHeight) {
		$("#move_up").css("display","none");
		$("#move_down").css("display","none");
	}	

	$("#move_down").mousehold(function(){
		var top = $("#scrollText").css("top");	
		//var display = $("#move_up").css("display");
		var height = $('#scrollText').innerHeight();	
		var containerHeight = $("#scrollContainer").css("height");
		
		top = top.replace("px","")
		containerHeight = containerHeight.replace("px","")
			
		top = parseInt(top)
		containerHeight = parseInt(containerHeight)
		
		var maxTop = height - containerHeight;
			
		maxTop = maxTop - (maxTop*2);
			
		var nextTop = top - 60;
	
		if (nextTop < maxTop) {			
			nextTop = maxTop;
		}
		
		/*if (display == "none") {		
			$("#move_up").css("display","inline");
		}*/
		
		if (moving == false) {	
			if (height > containerHeight) {
				moving = true;
				$("#scrollText").animate({"top": nextTop}, 500, "linear", function(){
					 moving = false;
					 if (nextTop == maxTop) {
						//$("#move_down").css("display","none");
					}				 
				});
			}	
		}
	});	
	
	$("#move_up").mousehold(function(){
		var top = $("#scrollText").css("top");	
		//var display = $("#move_down").css("display");	
		top = top.replace("px","")	
		top = parseInt(top)
			
		maxTop = 0;
		
		var nextTop = top + 60;
		
		if (nextTop > maxTop) {		
			nextTop = maxTop;	
		}
		
		/*if (display == "none") {		
			$("#move_down").css("display","inline");
		}*/
		
		if ((top < 0) && (moving == false)) {
			moving = true;
			$("#scrollText").animate({"top": nextTop}, 500, "linear", function(){
				 moving = false;
				 if (nextTop == maxTop) {
					//$("#move_up").css("display","none");
				}	
			});
		}
		
	
	});	
	
	$("#move_down_news").mousehold(function(){
		var top = $("#scrollText_news").css("top");	
		//var display = $("#move_up").css("display");
		var height = $('#scrollText_news').innerHeight();	
		var containerHeight = $("#scrollContainer_news").css("height");
		
		top = top.replace("px","")
		containerHeight = containerHeight.replace("px","")
			
		top = parseInt(top)
		containerHeight = parseInt(containerHeight)
		
		var maxTop = height - containerHeight;
			
		maxTop = maxTop - (maxTop*2);
			
		var nextTop = top - 60;
	
		if (nextTop < maxTop) {			
			nextTop = maxTop;
		}
		
		/*if (display == "none") {		
			$("#move_up").css("display","inline");
		}*/
		
		if (moving == false) {	
			if (height > containerHeight) {
				moving = true;
				$("#scrollText_news").animate({"top": nextTop}, 500, "linear", function(){
					 moving = false;
					 if (nextTop == maxTop) {
						//$("#move_down").css("display","none");
					}				 
				});
			}	
		}
	});	
	
	$("#move_up_news").mousehold(function(){
		var top = $("#scrollText_news").css("top");	
		//var display = $("#move_down").css("display");	
		top = top.replace("px","")	
		top = parseInt(top)
			
		maxTop = 0;
		
		var nextTop = top + 60;
		
		if (nextTop > maxTop) {		
			nextTop = maxTop;	
		}
		
		/*if (display == "none") {		
			$("#move_down").css("display","inline");
		}*/
		
		if ((top < 0) && (moving == false)) {
			moving = true;
			$("#scrollText_news").animate({"top": nextTop}, 500, "linear", function(){
				 moving = false;
				 if (nextTop == maxTop) {
					//$("#move_up").css("display","none");
				}	
			});
		}
		
	
	});	
			 				   			
});
//-->