$(function(){

	// listTable background-color
	$("#cdList > .innerBlock > table > tbody > tr:even").addClass("bgGrey");
	$("#dvdList > .innerBlock > table > tbody > tr:even").addClass("bgGrey");
	$("#artistDatas > .direct > .contents table > tbody > tr:even").addClass("bgGrey");
	
	// artist Release background-color
	$("#release > .releaseItems:odd").addClass("bgGrey");
	
	// tabSelector
	$("#tabSelectorTab01 a").click(function() {
		resetTabSelector();
		$('#news').load("./?action=news");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat 0 -26px");
		$("div.direct").hide();
		$("#news").show();
		$("#profile").hide();
		$("#release").hide();
		$("#media").hide();
		$("#live").hide();
		$("#link").hide();
	});
	$("#tabSelectorTab02 a").click(function() {
		resetTabSelector();
		$('#profile').load("./?action=profile");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -90px -26px");
		$("div.direct").hide();
		$("#news").hide();
		$("#profile").show();
		$("#release").hide();
		$("#media").hide();
		$("#live").hide();
		$("#link").hide();
	});
	$("#tabSelectorTab03 a").click(function() {
		resetTabSelector();
		$('#release').load("./?action=release");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -182px -26px");
		$("div.direct").hide();
		$("#news").hide();
		$("#profile").hide();
		$("#release").show();
		$("#media").hide();
		$("#live").hide();
		$("#link").hide();
	});
	$("#tabSelectorTab04 a").click(function() {
		resetTabSelector();
		$('#media').load("./?action=media");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -273px -26px");
		$("div.direct").hide();
		$("#news").hide();
		$("#profile").hide();
		$("#release").hide();
		$("#media").show();
		$("#live").hide();
		$("#link").hide();
	});
	$("#tabSelectorTab05 a").click(function() {
		resetTabSelector();
		$('#live').load("./?action=live");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -364px -26px");
		$("div.direct").hide();
		$("#news").hide();
		$("#profile").hide();
		$("#release").hide();
		$("#media").hide();
		$("#live").show();
		$("#link").hide();
	});
	$("#tabSelectorTab06 a").click(function() {
		resetTabSelector();
		$('#link').load("./?action=link");
		$(this).css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -456px -26px");
		$("div.direct").hide();
		$("#news").hide();
		$("#profile").hide();
		$("#release").hide();
		$("#media").hide();
		$("#live").hide();
		$("#link").show();
	});
	/*
	// showContents btn
	$("p.showContents").click(function() {
		$(this).parent().parent().next().show();
		$(this).next().show();
		$(this).hide();
	});
	
	// closeContents btn
	$("p.closeContents").click(function() {
		$(this).parent().parent().next().hide();
		$(this).prev().show();
		$(this).hide();
	});
	
	// closeThis btn
	$("p.closeThis").click(function() {
		$(this).parent().hide();
		$(this).parent().prev().children("div").children("p.showContents").show();
		$(this).parent().prev().children("div").children("p.closeContents").hide();
	});
	*/
	init();
})

// reset tabSelector
function resetTabSelector() {
	$("#tabSelectorTab01").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat 0 0");
	$("#tabSelectorTab02").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -90px 0");
	$("#tabSelectorTab03").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -182px 0");
	$("#tabSelectorTab04").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -273px 0");
	$("#tabSelectorTab05").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -364px 0");
	$("#tabSelectorTab06").children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat -456px 0");
}

// init
function init() {
	$("#profile").hide();
	$("#release").hide();
	$("#media").hide();
	$("#live").hide();
	$("#link").hide();
	$("#news").hide();
}

// set
function setActiveTab(tab,obj) {
	
	var tabArray = new Array(); 
	tabArray["#tabSelectorTab01"] = "0";
	tabArray["#tabSelectorTab02"] = "-90px";
	tabArray["#tabSelectorTab03"] = "-182px";
	tabArray["#tabSelectorTab04"] = "-273px";
	tabArray["#tabSelectorTab05"] = "-364px";
	tabArray["#tabSelectorTab06"] = "-456px";
	
	$(obj).show();
	$(tab).children("a").css("background","url(/images/artist/tabSelector_tabImages.gif) no-repeat " + tabArray[tab] + " -26px");
}

// init(direct from release page)
function initDirect() {
	$("div.direct").show();
	resetTabSelector();
	$("#news").hide();
	$("#profile").hide();
	$("#release").hide();
	$("#media").hide();
	$("#live").hide();
	$("#link").hide();
}



