$(function(){
	$('body :first-child').addClass('firstChild');
	$('body :last-child').addClass('lastChild');
	$('body :empty').addClass('empty');
	$('body :only-child').removeClass('firstChild');
	$('body :only-child').removeClass('lastChild');
	$('body :only-child').addClass('onlyChild');
	var cr_url=document.URL;
	if(cr_url.match(/\/category\/brand/)){
		$('body').attr('id','brand');
	}else if(cr_url.match(/\/category\/bridal/)){
		$('body').attr('id','bridal');	
	}else if(cr_url.match(/\/category\/watch/)){
		$('body').attr('id','watch');	
	}else if(cr_url.match(/\/category\/fashion/)){
		$('body').attr('id','fashion');	
	}
	$('#shop div.breadcrumb li:nth-child(2),#card div.breadcrumb li:nth-child(2)').css('display','none');
	$('a img').hover(function(){
		$(this).attr('src', $(this).attr('src').replace('_ro', '_ro_f2'));
			}, function(){
				 if (!$(this).hasClass('currentPage')) {
				 $(this).attr('src', $(this).attr('src').replace('_ro_f2', '_ro'));
		}
	});
	$('#header a,#gNav a,#pageTop a,#fNavLi1 a,#fNavLi2 a,#fNavLi3 a,.home #content .parent2 a').css('cursor','pointer').blend();
	$('#gNav li').click(function(){
		location.href = $(this).children('a').attr('href');
	});
	$('#brand #gNavLi1,#bridal #gNavLi2,#watch #gNavLi3,#fashion #gNavLi4,#fur #gNavLi4,#shop #gNavLi5,#card #gNavLi6,#staff #gNavLi7,.category-brand #gNavLi1,.category-bridal #gNavLi2,.category-watch #gNavLi3,.category-fashion #gNavLi4').addClass('current');
	$('#gNav ul').lavaLamp({
		fx: "backout",
		speed: 700,
		click: function(event, menuItem) {
			 return false;
		}
	});
	$('body:not(.home) .ngg-galleryoverview a').lightBox();
	$('.ngg-gallery-thumbnail-box:not(.null)').hover(function() {
		$(this).siblings().children().children().children('img').stop().fadeTo(500,0.3);
	}, function() {
		$(this).siblings().children().children().children('img').stop().fadeTo(500,1);
	});
	$('body.home div.parent3 div.child1 .ngg-galleryoverview').prepend('<div class="thumFirstChild1"></div>');
	$('body.home div.parent3 div.child2 .ngg-galleryoverview').prepend('<div class="thumFirstChild2"></div>');
	$('#sNavUl7 li,.fade').hover(function() {
		$(this).stop().fadeTo(500,0.6);
	}, function() {
		$(this).stop().fadeTo(500,1);
	});
	var siteurl = 'http://www.j-sakaguchi.co.jp/';
		$('ul.sNavUl2 li a,ul.sNavUl3 li a,ul.sNavUl4 li a,ul.sNavUl5 li a,ul.sNavUl6 li a').each(function(){
			$(this).attr('href',siteurl + $(this).attr('title') + '.html');
		});
		$('body.category #content ul.sNavUl2 li a,body.category #content ul.sNavUl3 li a,body.category #content ul.sNavUl4 li a,body.category #content ul.sNavUl5 li a,body.category #content ul.sNavUl6 li a').each(function(){
			$(this).prepend('<img src="'+ siteurl + 'wp-content/themes/default/images/catTop/' + $(this).attr('title') +'.jpg">');
		});
		$('body.category #content ul.sNavUl2 li,body.category #content ul.sNavUl3 li,body.category #content ul.sNavUl4 li,body.category #content ul.sNavUl5 li,body.category #content ul.sNavUl6 li').hover(function(){
			$(this).siblings().children().children('img').stop().fadeTo(500,0.3);
		}, function() {
			$(this).siblings().children().children('img').stop().fadeTo(500,1);
		});
		$('body.home div.parent3 div.ngg-gallery-thumbnail a img').each(function(){
			$(this).after('<span>'+$(this).attr('alt')+'</span>');
		});
		$('body.home div.parent3 div.ngg-gallery-thumbnail a').each(function(){
			$(this).attr('href',siteurl + $(this).children('img').attr('alt') + '.html')
		});
		$('select, input:checkbox, input:radio, input:file, input:submit, input:text, textarea, option').uniform();
});
