function $(v) {
	return(document.getElementById(v));
}

function agent(v) {
	return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0));
}

function xy(e,v) {
	return(v?(agent('msie')?event.clientY+document.body.scrollTop:e.pageY):(agent('msie')?event.clientX+document.body.scrollTop:e.pageX));
}

function dragOBJ(d,e) {
	function drag(e) {
		if(!stop) {
			tempY=xy(e)+oX-eX
			if(tempY<-1150){
            	tY='-1150px';    
            }else if(tempY>0){
				tY='0px';
			}else{
				tY=(tempY+'px');	
			}
			d.style.left=tY;
			document.getElementById("stage").style.left=tY;
		}
	}
	var oX=parseInt(d.style.left),oY=parseInt(d.style.top),eX=xy(e),eY=xy(e,1),tX,tY,stop;
	document.onmousemove=drag;
	document.onmouseup=function(){
		stop=1;
		document.onmousemove='';
		document.onmouseup='';
	};
}

function fitWindow(){
	var ua = navigator.userAgent;	// ユーザーエージェント
     var nWidth, nHeight;	// サイズ
     var nHit = ua.indexOf("MSIE");	// 合致した部分の先頭文字の添え字
     var bIE = (nHit >=  0);	// IE かどうか
     var bVer6 = (bIE && ua.substr(nHit+5, 1) >= "6");	// バージョンが 6 かどうか
     var bStd = (document.compatMode && document.compatMode=="CSS1Compat");		// 標準モードかどうか
 
     if (bIE && !window.opera) {
          if (bVer6 && bStd) {
               nWidth = document.documentElement.clientWidth;
               nHeight = document.documentElement.clientHeight;
          } else {
               nWidth = document.body.clientWidth;
               nHeight = document.body.clientHeight;
          }
     } else {
          nWidth = window.innerWidth;
          nHeight = window.innerHeight;
     }
	document.getElementById("scheduleArea").style.height=nHeight-80+'px';
	document.getElementById("scheduleArea").style.width=nWidth-120+'px';
	document.getElementById("timeArea").style.height=nHeight-80+'px';
	document.getElementById("stageArea").style.width=nWidth-120+'px';
	document.getElementById("dateArea").style.top=nHeight-160+'px';
	document.getElementById("dateArea").style.left=nWidth-160+'px';
	document.getElementById("dateArea").style.visibility='visible';
}

window.onresize = fitWindow;
window.onload = fitWindow;


function openArtist(id){
	url = "/artist/artistdata.asp?id=" + id;
	//url = "../artist/artistdata.html";
	subWidth = 500;
	subHeight = 600;
	subWin=window.open(url,"artist","menubar=0,scrollbars=1,toolbar=0,resizable=1,status=1,width=" + subWidth + ",height=" + subHeight);
}