/**
 *	@ Script : top.js
 *
 *	@ Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 *	
 */

$(function() {
	/**
	 * @ Slider
	 *
	 */
	$('#navGlobal ul li a,#logo a').click(function() {
		$('.topics').css('display','none');
	
		var _src = $(this).attr('href');
		var _posX = 220 - $(_src).position().left + "px";
		$('#articleContents').animate({
			'left':_posX
		}, 1000, 'easeOutCubic');
		
		return false;
	});
	
	$('.btnTopics a').click(function() {
		var _tar = "#"+$(this).parent().parent().attr('id') + " .topics";
		var _posY = -100 - $(_tar).height() + "px";
		$(_tar).css({
			'top':_posY,
			'display':'block'
		});
		$(_tar).animate({
			'top':'-100px'
		}, 1000, 'easeOutCubic');
		
		return false;
	});
	
	$('.btnClose a').click(function() {
		var _tar = $(this).parent().parent();
		var _posY = -100 - $(_tar).height() + "px";
		$(_tar).animate({
			'top':_posY
		}, 1000, 'easeOutCubic', function() {
			$(this).css({
			'top':_posY,
			'display':'none'
			});
		});
		
		return false;
	});
	
	/**
	 * @ Random Gallery
	 *
	 */
	/* function randomGallery() {
	 	var _num = Math.floor(Math.random() * 6) + 1;
	 	var _src = '<img src="/imgs/top/main_img00_0' + _num + '.jpg" alt="TAKE FIVE TOKYO/LOS ANGELES" width="700" height="400" />'
	 	$('#tfMain').html(_src);
	 }
	 randomGallery();*/
});
