jQuery.noConflict();
jQuery(document).ready(function() {
var is_show = 0;

jQuery('#top_content_text').html(jQuery('#top_content_background div.top_bg').children('.top_text').html());
Cufon.refresh('.top_title');
Cufon.refresh('.top_desc');

jQuery('#menu div').hover( function() {
			var atr = jQuery(this).attr('class');
				
			switch(atr) {
				case 'menu_item0': natr = 'top_main1';break;
				case 'menu_item1': natr = 'top_main2';break;
				case 'menu_item2': natr = 'top_main3';break;
				case 'menu_item3': natr = 'top_main4';break;
				case 'menu_item4': natr = 'top_main5';break;
			}
			is_show = 1;
			jQuery('#top_content div.'+natr).stop(true,true).show("drop", { direction: "down" }, 1300);
					
	}, function(){
			var atr = jQuery(this).attr('class');
			
			switch(atr) {
				case 'menu_item0': natr = 'top_main1';break;
				case 'menu_item1': natr = 'top_main2';break;
				case 'menu_item2': natr = 'top_main3';break;
				case 'menu_item3': natr = 'top_main4';break;
				case 'menu_item4': natr = 'top_main5';break;
			}
			jQuery('#top_content div.'+natr).stop(true,true).hide("drop", { direction: "up" }, 450	);
			is_show = 0;
			
	});
	var run = setInterval(function() {slides(is_show)},7000);
	
});

function slides(is_show) 
{
	
	if(jQuery('#top_content_background div.top_bg').length == 1) {
	
		var next = jQuery('#top_content_background div.top_bg').next();
		var atr = next.children('img').attr('src');
		
			jQuery('#top_content_background div.top_bg').removeClass('top_bg');
			
			if(is_show == 0) {
				jQuery('#top_content_bg').animate({opacity: 0},1000,function() {
					jQuery('#top_content_bg').css('background-image','url('+atr+')');
					jQuery('#top_content_text').html(next.children('.top_text').html());
					Cufon.refresh('.top_title');
					Cufon.refresh('.top_desc');
				});
				jQuery('#top_content_bg').animate({opacity: 1},4000);
				
			}
			else {
				jQuery('#top_content_bg').css('background-image','url('+atr+')');
			}
			next.addClass('top_bg');
		
		jQuery('#top_content_background > div:last').after(jQuery('#top_content_background > div:first'));
	}		
}
