var $ss = jQuery.noConflict();

$ss(document).ready(function() {
	$ss(".tg01, .tg02, .tg03, .tg04, .tg05, .tg06, .tg07, .tg08, .photoContest-Legal, .ttt, .commentScroll").anchorAnimate()
});


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