function bridge_artist(){ tb_show('aaa', '../forlife/pv/index.html?height=500&width=710&TB_iframe=true'); }
function bridge_auction(){ tb_show('aaa', '../forlife/auction/index.html?height=500&width=710&TB_iframe=true'); }
function bridge_goods(){ tb_show('aaa', '../forlife/goods/index.html?height=500&width=710&TB_iframe=true'); }

/* 起動 */
$(function(){

	// NAVI EXTERNAL
	if(location.href.match(RegExp('/about/')) || 
		location.href.match(RegExp('/news/')) || 
		location.href.match(RegExp('/schedule/')) || 
		location.href.match(RegExp('/access/')) || 
		location.href.match(RegExp('/artist/')) || 
		location.href.match(RegExp('/ticket/')) || 
		location.href.match(RegExp('/a-park/')) || 
		location.href.match(RegExp('/goods/'))){
		$("#header .external").load("/external/navi.html", function(){
			// グローバルメニュークリック処理
			$("#header .navi a").click(function () {
				$("div#header ul.navi ul").hide();
		    $("#header .navi img.on").fadeTo( 0, 0 );
			});
			// メニューフォーカス（グローバル）
			if(location.href.match(RegExp('/about/'))){
		    $("#header .navi img#navi_about").attr('src', $("#header .navi img#navi_about").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/news/'))){
		    $("#header .navi img#navi_news").attr('src', $("#header .navi img#navi_news").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/schedule/'))){
		    $("#header .navi img#navi_schedule").attr('src', $("#header .navi img#navi_schedule").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/access/'))){
		    $("#header .navi img#navi_access").attr('src', $("#header .navi img#navi_access").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/artist/'))){
		    $("#header .navi img#navi_artist").attr('src', $("#header .navi img#navi_artist").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/ticket/'))){
		    $("#header .navi img#navi_ticket").attr('src', $("#header .navi img#navi_ticket").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/a-park/'))){
		    $("#header .navi img#navi_a-park").attr('src', $("#header .navi img#navi_a-park").attr('src').replace("_off2.", "_on2."));
			}
			if(location.href.match(RegExp('/goods/'))){
		    $("#header .navi img#navi_goods").attr('src', $("#header .navi img#navi_goods").attr('src').replace("_off2.", "_on2."));
			}
			// プルダウンメニュー
			$("#header .navi").droppy();
		});
	}else{
		// プルダウンメニュー
		$("#header .navi").droppy();
	}
	// ABOUT EXTERNAL
	if(location.href.match(RegExp('/about/'))){
		$("#subCol .external").load("../external/about.html", function(){});
	}
	// NEWS EXTERNAL
	if(location.href.match(RegExp('/news/'))){
		$("#subCol .external").load("/external/news.html", function(){});
	}
	// SCHEDULE EXTERNAL
	if(location.href.match(RegExp('/schedule/'))){
		$("#subCol .external").load("../external/schedule.html", function(){});
	}
	// ACCESS EXTERNAL
	if(location.href.match(RegExp('/access/'))){
		$("#subCol .external").load("../external/access.html", function(){});
	}
	// ARTIST EXTERNAL
	if(location.href.match(RegExp('/artist/'))){
		$("#subCol .external").load("/external/artist.html", function(){});
	}
	// TICKET EXTERNAL
	if(location.href.match(RegExp('/ticket/'))){
		$("#subCol .external").load("../external/ticket.html", function(){});
	}
	// COMUNITY EXTERNAL
	if(location.href.match(RegExp('/a-park/'))){
		$("#subCol .external").load("../external/a-park.html", function(){});
	}
	// GOODS EXTERNAL
	if(location.href.match(RegExp('/goods/'))){
		$("#subCol .external").load("/external/goods.html", function(){});
		$("#mainCol .list").load("/external/goods_list.html", function(){
			$("body#goods div#mainCol div.list ul.first li img").each(function(i) {
				if((i + 1) % 5 == 0){
					$(this).css('margin','0 0 6px 0');
				}
			});
		});
	}
	// FOOTER EXTERNAL
	$("#footer .external").load("/external/footer.html", function(){});

	// スタイル調整
	$('body#artist ul.navi_menu li:last').css('padding','0 0 0 0');
	$('body#artist div.entry:last').css('padding','0 0 0 0');
	$('body#access div.ehime').css('display','block');
	$('body#access div.hukuoka').css('display','none');
	$('body#access div.aichi').css('display','none');
	$('body#access div.osaka').css('display','none');
	$('body#access div.tokyo').css('display','none');

	// メニューフォーカス（アーティストページ）
	if(location.href.match(RegExp('date_0730.html'))){
    $("body#artist img#date_0730").attr('src', $("body#artist img#date_0730").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0806.html'))){
    $("body#artist img#date_0806").attr('src', $("body#artist img#date_0806").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0813.html'))){
    $("body#artist img#date_0813").attr('src', $("body#artist img#date_0813").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0820.html'))){
    $("body#artist img#date_0820").attr('src', $("body#artist img#date_0820").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0821.html'))){
    $("body#artist img#date_0821").attr('src', $("body#artist img#date_0821").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0827.html'))){
    $("body#artist img#date_0827").attr('src', $("body#artist img#date_0827").attr('src').replace("_off.", "_on."));
	}
	if(location.href.match(RegExp('date_0828.html'))){
    $("body#artist img#date_0828").attr('src', $("body#artist img#date_0828").attr('src').replace("_off.", "_on."));
	}

//	$('div#pageTo').css('left', $(window).width() / 2 + 490);
//	$(window).resize(function(){
//		$('div#pageTo').css('left', $(window).width() / 2 + 490);
//	});

});

/* 時限ニューマーク */
function newUp(y, m, d, c) {
  delDay = 7; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    if(c == "new") document.write("&nbsp;<img src='/images/new.gif'>");
  }
}

