// toppage main image

$(function(){
		var $tabs = $('#tabs').tabs({ 
            fx: { opacity: 'toggle', duration: 'normal'  },
            show: function(event, ui) {
                $('#tabs').fadeIn('slow');
            }
        });
        $tabs.tabs('rotate', 2500, true);

        // mouseover and click event
        var tabid = "";
		$('.ui-tabs-nav > li > a').mouseover(function(){

            // get dom
			tabid = $(this).attr('href');
			tabid = tabid.replace('#', '');

			$tabs.tabs('rotate', 0); // stop rotate
			$tabs.tabs('select', tabid); // select tab
			return false;
		}).click(function(){
			tabid = $(this).attr('href');
            switch(tabid){
            case '#tabs-1': 
                location.href = "/wordpress/service.html";
                break;
            case '#tabs-2': 
                location.href = "/wordpress/staff.html";
                break;
            case '#tabs-3': 
                location.href = "/wordpress/reconsideration.html";
                break;
            }
			return false;
        });

        // mouseout
		$('.ui-tabs-nav > li > a').mouseout(function(){
            $tabs.tabs('rotate', 2500, true);
        });
	});
