$(document).ready(function() {
	swfobject.registerObject("AT_flashArea", "9.0.0", "/pc/swf/expressInstall.swf");
	swfobject.embedSWF("/pc/swf/topinfo.swf", "AT_flashArea", "367", "429", "9.0.0");
	
	$('div.AT_topColumn h3 .AT_switch,' + 
		'div#AT_myHistory h3 .AT_switch,' + 
		'div#AT_myArtist h3 .AT_switch')
	.each(function() {
		$(this).parent().next().css("display", "none");
	});
	
	$('div#AT_login button').replaceBgImg('img/top/btn_login.gif', 200, 28, {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('div#AT_resist a').replaceImg('img/top/btn_resist.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('div#AT_mobile').replaceImg('img/top/bnr_mobile.gif');
	$('div#AT_myCtrl a.AT_toMypage').replaceImg('img/top/btn_mypage.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('div#AT_myCtrl a.AT_logout').replaceImg('img/top/btn_logout.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	
	$('div#AT_announcement h3').replaceImg('img/top/h3_announcement.gif');
	$('div#AT_announcement .AT_btn').replaceImg('img/top/btn_more_announcement.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$("h3.AT_listTbl").replaceImg("img/top/ttl_verdy2011.jpg");
	$('table.AT_listTbl a.AT_reserved').replaceImg('img/top/btn_reservedticket.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('table.AT_listTbl a.AT_general').replaceImg('img/top/btn_generalticket.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	
	$('div#AT_myInfo h3 .AT_switch').replaceBgImg('img/top/btn_close_leftlist.gif', 25, 22);
	$('div#AT_myHistory h3 .AT_switch').replaceBgImg('img/top/btn_open_leftlist.gif', 25, 22);
	$('div#AT_myArtist h3 .AT_switch').replaceBgImg('img/top/btn_open_leftlist.gif', 25, 22);
	
	$('div#AT_left_column .AT_btn').replaceImg('img/top/btn_more_leftlist.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	
	$('div#AT_myInfo h3').replaceBgImg('img/top/h3_myinfo.gif', 200, 36);
	$('div#AT_myHistory h3').replaceBgImg('img/top/h3_myhistory.gif', 200, 36);
	$('div#AT_myArtist h3').replaceBgImg('img/top/h3_myartist.gif', 200, 36);
	
	$('div#AT_topics h3 a').replaceImg('img/top/btn_more_topics.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('div#AT_ticket h3 a').replaceImg('img/top/btn_more_topics.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	$('div.AT_topColumn h3 .AT_switch').replaceBgImg('img/top/btn_open.gif', 34, 34);
	
	$('div#AT_topics h3').replaceBgImg('img/top/h3_topics.gif', 367, 35);
	$('div#AT_topics p.AT_new').replaceImg('img/common/new.gif');
	
	$('div#AT_ticket h3').replaceBgImg('img/top/h3_ticket.gif', 367, 35);
	$('div#AT_ticket th.AT_date').replaceImg('img/top/mark_date.gif');
	$('div#AT_ticket th.AT_place').replaceImg('img/top/mark_place.gif');
	$('div#AT_ticket th.AT_ticket').replaceImg('img/top/mark_ticket.gif');
	$('div#AT_ticket .AT_noInfo').replaceImg('img/top/comingsoon.gif');	
	
	$('h4#AT_pcreserv').replaceImg('img/top/h4_pcreserv.gif');
	$('h4#AT_pcnormal').replaceImg('img/top/h4_pcnormal.gif');
	$('div#AT_special h3').replaceBgImg('img/top/h3_special.gif', 367, 34);
	$('div#AT_special .AT_btn').replaceImg('img/top/btn_more_livereport.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	
	$('div#AT_livereport h3').replaceBgImg('img/top/h3_livereport.gif', 367, 34);
	$('div#AT_livereport .AT_btn').replaceImg('img/top/btn_more_livereport.gif', {
		imgTitle: false,
		rollover: '.AT_over',
		postfix: '_ov'
	});
	
	$('div#AT_campaign h3').replaceBgImg('img/top/h3_campaign.gif', 367, 34);
	$('div#AT_links h3').replaceBgImg('img/top/h3_links.gif', 367, 40);
	
	$('div.AT_topColumn h3 .AT_switch,div#AT_left_column h3 .AT_switch').click(function() {
		$(this).parent().next().slideToggle();
	});
	$('div#AT_myInfo h3 .AT_switch').toggle(
		function () {
			$(this).css("background", "url(img/top/btn_open_leftlist.gif)");
		},
		function () {
			$(this).css("background", "url(img/top/btn_close_leftlist.gif)");
		}
	)
	$('div#AT_myHistory h3 .AT_switch').toggle(
		function () {
			$(this).css("background", "url(img/top/btn_close_leftlist.gif)");
		},
		function () {
			$(this).css("background", "url(img/top/btn_open_leftlist.gif)");
		}
	)
	$('div#AT_myArtist h3 .AT_switch').toggle(
		function () {
			$(this).css("background", "url(img/top/btn_close_leftlist.gif)");
		},
		function () {
			$(this).css("background", "url(img/top/btn_open_leftlist.gif)");
		}
	)
	$('div.AT_topColumn h3 .AT_switch').toggle(
		function () {
			$(this).css("background", "url(img/top/btn_close.gif)");
		},
		function () {
			$(this).css("background", "url(img/top/btn_open.gif)");
		}
	)
	
	$('div#AT_ticket div.AT_start').each(function() {
		var statusStr = $(this).children().attr("class");
		statusStr = statusStr.split("_");
		var statusSrc = '<p class="AT_month">';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(0) + '.gif" alt="' + statusStr[1].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(1) + '.gif" alt="' + statusStr[1].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(2) + '.gif" alt="' + statusStr[1].charAt(2) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(3) + '.gif" alt="' + statusStr[1].charAt(3) + '" />';
		statusSrc += '&nbsp;';
		statusSrc += '<img src="img/top/number/month_' + statusStr[2].substring(0) + '.gif" alt="' + statusStr[2].substring(0) + '??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(0) + '.gif" alt="' + statusStr[3].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(1) + '.gif" alt="' + statusStr[3].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/day.gif" alt="??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(0) + '.gif" alt="' + statusStr[4].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(1) + '.gif" alt="' + statusStr[4].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/colon.gif" alt=":" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(0) + '.gif" alt="' + statusStr[5].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(1) + '.gif" alt="' + statusStr[5].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/wavedash.gif" alt="?`" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/mark_start.gif" alt="??t?J?n" />';
		statusSrc += '</p>\n';
		$(this).html(statusSrc);
	});
	
	$('div#AT_ticket div.AT_during').each(function() {
		var statusStr = $(this).children().attr("class");
		statusStr = statusStr.split("_");
		var statusSrc = '<p class="AT_month">';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(0) + '.gif" alt="' + statusStr[1].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(1) + '.gif" alt="' + statusStr[1].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(2) + '.gif" alt="' + statusStr[1].charAt(2) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(3) + '.gif" alt="' + statusStr[1].charAt(3) + '" />';
		statusSrc += '&nbsp;';
		statusSrc += '<img src="img/top/number/month_' + statusStr[2] + '.gif" alt="' + statusStr[2] + '??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(0) + '.gif" alt="' + statusStr[3].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(1) + '.gif" alt="' + statusStr[3].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/day.gif" alt="??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/wavedash.gif" alt="?`" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(0) + '.gif" alt="' + statusStr[4].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(1) + '.gif" alt="' + statusStr[4].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/colon.gif" alt=":" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(0) + '.gif" alt="' + statusStr[5].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(1) + '.gif" alt="' + statusStr[5].charAt(1) + '" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/mark_during.gif" alt="??t??" />';
		statusSrc += '</p>\n';
		$(this).html(statusSrc);
	});
	

	$('div#AT_ticket div.AT_firstarrivalstart').each(function() {
		var statusStr = $(this).children().attr("class");
		statusStr = statusStr.split("_");
		var statusSrc = '<p class="AT_month">';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(0) + '.gif" alt="' + statusStr[1].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(1) + '.gif" alt="' + statusStr[1].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(2) + '.gif" alt="' + statusStr[1].charAt(2) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(3) + '.gif" alt="' + statusStr[1].charAt(3) + '" />';
		statusSrc += '&nbsp;';
		statusSrc += '<img src="img/top/number/month_' + statusStr[2].substring(0) + '.gif" alt="' + statusStr[2].substring(0) + '??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(0) + '.gif" alt="' + statusStr[3].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(1) + '.gif" alt="' + statusStr[3].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/day.gif" alt="??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(0) + '.gif" alt="' + statusStr[4].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(1) + '.gif" alt="' + statusStr[4].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/colon.gif" alt=":" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(0) + '.gif" alt="' + statusStr[5].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(1) + '.gif" alt="' + statusStr[5].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/wavedash.gif" alt="?`" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/mark_firstarrivalstart.gif" alt="????t?J?n" />';
		statusSrc += '</p>\n';
		$(this).html(statusSrc);
	});

	$('div#AT_ticket div.AT_firstarrivalduring').each(function() {
		var statusStr = $(this).children().attr("class");
		statusStr = statusStr.split("_");
		var statusSrc = '<p class="AT_month">';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(0) + '.gif" alt="' + statusStr[1].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(1) + '.gif" alt="' + statusStr[1].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(2) + '.gif" alt="' + statusStr[1].charAt(2) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(3) + '.gif" alt="' + statusStr[1].charAt(3) + '" />';
		statusSrc += '&nbsp;';
		statusSrc += '<img src="img/top/number/month_' + statusStr[2] + '.gif" alt="' + statusStr[2] + '??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(0) + '.gif" alt="' + statusStr[3].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(1) + '.gif" alt="' + statusStr[3].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/day.gif" alt="??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/wavedash.gif" alt="?`" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(0) + '.gif" alt="' + statusStr[4].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(1) + '.gif" alt="' + statusStr[4].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/colon.gif" alt=":" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(0) + '.gif" alt="' + statusStr[5].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(1) + '.gif" alt="' + statusStr[5].charAt(1) + '" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/mark_firstarrivalduring.gif" alt="????t??" />';
		statusSrc += '</p>\n';
		$(this).html(statusSrc);
	});

	$('div#AT_ticket div.AT_end').each(function() {
		var statusStr = $(this).children().attr("class");
		statusStr = statusStr.split("_");
		var statusSrc = '<p class="AT_month">';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(0) + '.gif" alt="' + statusStr[1].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(1) + '.gif" alt="' + statusStr[1].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(2) + '.gif" alt="' + statusStr[1].charAt(2) + '" />';
		statusSrc += '<img src="img/top/number/year_' + statusStr[1].charAt(3) + '.gif" alt="' + statusStr[1].charAt(3) + '" />';
		statusSrc += '&nbsp;';
		statusSrc += '<img src="img/top/number/month_' + statusStr[2] + '.gif" alt="' + statusStr[2] + '??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(0) + '.gif" alt="' + statusStr[3].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/day_' + statusStr[3].charAt(1) + '.gif" alt="' + statusStr[3].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/day.gif" alt="??" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(0) + '.gif" alt="' + statusStr[4].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[4].charAt(1) + '.gif" alt="' + statusStr[4].charAt(1) + '" />';
		statusSrc += '<img src="img/top/number/colon.gif" alt=":" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(0) + '.gif" alt="' + statusStr[5].charAt(0) + '" />';
		statusSrc += '<img src="img/top/number/time_' + statusStr[5].charAt(1) + '.gif" alt="' + statusStr[5].charAt(1) + '" />';
		statusSrc += '</p>\n';
		statusSrc += '<p>';
		statusSrc += '<img src="img/top/mark_end.gif" alt="?I??" />';
		statusSrc += '</p>\n';
		$(this).html(statusSrc);
	});


	$('div#AT_livereport p.AT_reportNum').each(function() {
		var numberStr = $(this).text();
		var numberSrc = '<img src="img/top/number/report_' + numberStr.charAt(0) + '.gif" alt="' + numberStr.charAt(0) + '" />';
		numberSrc += '<img src="img/top/number/report_' + numberStr.charAt(1) + '.gif" alt="' + numberStr.charAt(1) + '" />';
		numberSrc += '<img src="img/top/number/report_' + numberStr.charAt(2) + '.gif" alt="' + numberStr.charAt(2) + '" />';
		$(this).html(numberSrc);
	});		

});

