// JavaScript Document
function Inner_Tab()
{
	$('.inner_tab span').click(function(e){
		var selected = $(this).index();
		$(this).parent().children().removeClass('active');
		$(this).addClass('active');
		$(this).parent().parent().children('div.inner_content').children('div.active').removeClass('active');
		$(this).parent().parent().children('div.inner_content').children('div.content').eq(selected).addClass('active');
	});
}

function Sub_menu()
{
	$('.menu_continer .menu').children('ul').children('li').mouseover(function(e){
		$(this).children('a').addClass('active');
		$(this).children('ul').addClass('active');
	});
	$('.menu_continer .menu').children('ul').children('li').mouseout(function(e){
		if($(this).children('a').hasClass('current'))
		{
			$(this).children('ul').removeClass('active');
		}
		else
		{
			$(this).children('a').removeClass('active');
			$(this).children('ul').removeClass('active');
		}
		
	});
}

//---------Slideshow--------------

function SlideShow_Timer()
{
	var crnt_id = $('.slideshow').children('img').eq(0).attr('id');
	crnt_id++;
	if(crnt_id>=img_num){crnt_id=0;}
	ChangeImage(crnt_id);
	int_timer = setTimeout('SlideShow_Timer()',delay);
}

function ChangeImage(indx)
{
	$('.slideshow').children('img').eq(0).fadeOut(500, function(){
		$(this).attr({'src':gallery[indx],'id':indx});
		$(this).parent().children('img').eq(1).attr({'src':gallery[indx+1]});
		$(this).fadeIn(500);
	});
}
