//jQuery set

$(function() {
	// for エラー: jQuery.dequeue is not a function
	/*
	( function( $ ) {
		$.dequeue = function( a , b ){
				return $(a).dequeue(b);
		};
	
	})( jQuery ); 
	*/
 
	//facebox
	$('a[rel*=facebox]').facebox({
		loading_image : 'loading.gif',
		close_image   : 'closelabel.gif'
	});
	
	//page scroll
	$("#sideBar a[href^='#']").easingScroll({
    easing: "easeInOutCirc",
    duration: 800
  });
  $("#sideBar a[href^='#']").click( function() {
    window.location.href = $(this).attr('href');
  });
	/*
	var url = "http://" + location.hostname + location.pathname;
	$('a[href^=#]',$("#sideBar") ).click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			 && location.hostname == this.hostname) {
			//var id = this.href.substring(this.href.indexOf('#'));
			//$(id).ScrollTo('slow');
			//alert($(this).attr('href'));
			target = $( $(this).attr('href') );
			//alert(target.offset().top);
			if (target.length == 0) {
			 return;
			}
			$('html, body').animate({scrollTop: target.offset().top});
			//return false;
		}
	});
	*/
	//menu slide
	$("#sideBarContents").width(0);
	$('#sideBarTab').mouseout(function() {
		if($("#sideBarContents").width()>=300){
			$("#sideBarContents").animate({ width:0 },"slow");
		}
	});
	$('#sideBarTab').mouseover(function() {
		if($("#sideBarContents").width()==0){
			$("#sideBarContents").animate({ width:383 },"slow");
			//$(this).toggleClass('active');
		}
	});
	
	//topics #home_contents dl.topics dd.TopicsTitle
	/*
	$('#home_contents dl.topics dd.TopicsTitle a').click(function(){
    $('#home_contents dl.topics dd.TopicsBody').hide();
    $($(this).attr('href')).slideDown();
    return false;
	});
	*/
	
	//#work-detail
	$('#work-detail').show();
	$('#work-detail .facebox_num div.clearfix').each(function(){
	   $(this).find('p:first').hide();
	   $(this).find('div:eq(0)').addClass('float_left');
	   $(this).find('div:eq(1)').addClass('float_right');
  });
	//$('#work-detail .facebox_num div.clearfix > p').hide();
	//$('#work-detail .facebox_num div.clearfix div:eq(0)').addClass('float_left');
	//$('#work-detail .facebox_num div.clearfix div:eq(1)').addClass('float_right');
	$('#work-detail').hide();
});
