// This intro function Copyright (c) by Kinesis
// e-mail : kinesis815@naver.com
// site   : kineaprk.com
// blog   : kinesis.tistory.com
$(document).ready(function()
{
	slide("#sliding-navigation", 25, 17, 150, .8);
});

function intro(navigation_id, default_title, default_intro, coming_title, coming_intro, title_0, intro_0, title_1, intro_1, title_2, intro_2, title_3, intro_3, title_4, intro_4, title_5, intro_5, title_6, intro_6, title_7, intro_7)
{
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements + " a";
	
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			if(i == 0 && title_0 != "" && intro_0 != "") {$('#introtitle').html(title_0); $('#introduce').html(intro_0);}
			else if(i == 1 && title_1 != "" && intro_1 != "") {$('#introtitle').html(title_1); $('#introduce').html(intro_1);}
			else if(i == 2 && title_2 != "" && intro_2 != "") {$('#introtitle').html(title_2); $('#introduce').html(intro_2);}
			else if(i == 3 && title_3 != "" && intro_3 != "") {$('#introtitle').html(title_3); $('#introduce').html(intro_3);}
			else if(i == 4 && title_4 != "" && intro_4 != "") {$('#introtitle').html(title_4); $('#introduce').html(intro_4);}
			else if(i == 5 && title_5 != "" && intro_5 != "") {$('#introtitle').html(title_5); $('#introduce').html(intro_5);}
			else if(i == 6 && title_6 != "" && intro_6 != "") {$('#introtitle').html(title_6); $('#introduce').html(intro_6);}
			else if(i == 7 && title_7 != "" && intro_7 != "") {$('#introtitle').html(title_7); $('#introduce').html(intro_7);}
			else {$('#introtitle').html(coming_title); $('#introduce').html(coming_intro);}
		},		
		function(){$('#introtitle').html(default_title); $('#introduce').html(default_intro);})
	});
}

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements + " a";
	
	var timer = 0;
	
	$(list_elements).each(function(i)
	{
		$(this).css("margin-left","-180px");
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "15px" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
	});

	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out }, 150);
		},		
		function()
		{
			$(this).animate({ paddingLeft: pad_in }, 150);
		})
	});
}