// MENU SCROLLER 
$(document).ready(function() {
	$("a.anchorLink").anchorAnimate();
	$("div.anchorLink").anchorAnimate();
	$("div.clsLogoLink").anchorAnimate();
	$("div.anchorLink").hover(function(){
		$(this).addClass('anchorLink_hover');						   
	}, function(){
		$(this).removeClass('anchorLink_hover');	
	});
//	$("div#news").hide();
//	$("div#newsLink").click(function(){
//		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: 10}, 100, function() {
//		});
//		$('div#news').slideDown(300);
//	});
//	$("div#newsClose").click(function(){
//		$('div#news').slideUp(300);
//	});
});

jQuery.fn.anchorAnimate = function(settings) {
 	settings = jQuery.extend({
		speed : 500
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = ($(elementClick).offset().top)-110;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				//window.location.hash = elementClick
			});
		  	return false;
		});
	});
}

// NEWS TEXT SCROLLER 
$(document).ready(function() {
	//top = $('#newsText').top();
	i = 0 ;
	$('#newsUp').click(function(){
		if($('#newsText').css('top','') < 0 )
		{
			$('#newsText').animate({
				top:i+200
				},500
			);
			i = i + 200 ;
		}
	});
	$('#newsDown').click(function(){	
		$('#newsText').animate({
			top:i-200
			},500
		);
		i = i - 200 ;
	});
});

