//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
itunes_no = "";
songtitle = ""
songbody = "";

//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
// 通常
function itunes_song(x,y){
	/////////////////////////////////////////////////////
	itunes_no = "it" + x;
	/////////////////////////////////////////////////////
	itunes_data = document.getElementById(itunes_no).innerHTML;
	/////////////////////////////////////////////////////
	if(itunes_data == ""){
		/////////////////////////////////////////////////////
		// 処理中
		now_play = "<img src='http://www.cdjournal.com/image/parts/nowload.gif'><span style='#FF0000'> iTunes Storeで楽曲販売が行なわれているのか確認しています。一部、表示に時間を要する場合がございます。ご了承ください。</span>";
		document.getElementById(itunes_no).innerHTML = now_play;
		/////////////////////////////////////////////////////	
		songtitle = "tl" + x;
		title_name = document.getElementById(songtitle).innerHTML;
		/////////////////////////////////////////////////////	
		songbody = "bo" + x;
		////////////////////////////////////////////////////
		/////////////////////////////////////////////////////
		// Mozilla, Firefox, Safari, IE7
		if (window.XMLHttpRequest){
			httpObject = new XMLHttpRequest();
		// IE5, IE6
		} else if (window.ActiveXObject){
			try {
				httpObject = new ActiveXObject("Msxml2.XMLHTTP"); 
			} catch(e) {
				httpObject = new ActiveXObject("Microsoft.XMLHTTP"); 
			}
		}
		///////////////////////////////////////////////	
		// サーバーからデータ到着後に実行する関数
		httpObject.onreadystatechange = display_itunes;
		///////////////////////////////////////////////	
		// HTTP非同期通信でPHPにアクセス  page
		httpObject.open ("GET", "../sub/itunes.php?artist=" + encodeURIComponent(y) + "&name=" + encodeURIComponent(title_name) + "&" + (new Date).getTime(), true);

		httpObject.send (null);
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
// 通常
function itunes_song_b(x,y){
	/////////////////////////////////////////////////////
	itunes_no = "it" + x;
	/////////////////////////////////////////////////////
	itunes_data = document.getElementById(itunes_no).innerHTML;
	/////////////////////////////////////////////////////
	if(itunes_data == ""){
		/////////////////////////////////////////////////////
		// 処理中
		now_play = "<img src='http://www.cdjournal.com/image/parts/nowload.gif'><span style='#FF0000'> iTunes Storeで楽曲販売が行なわれているのか確認しています。一部、表示に時間を要する場合がございます。ご了承ください。</span>";
		document.getElementById(itunes_no).innerHTML = now_play;
		/////////////////////////////////////////////////////	
		songtitle = "tl" + x;
		title_name = document.getElementById(songtitle).innerHTML;
		/////////////////////////////////////////////////////	
		songbody = "bo" + x;
		////////////////////////////////////////////////////
		/////////////////////////////////////////////////////
		// Mozilla, Firefox, Safari, IE7
		if (window.XMLHttpRequest){
			httpObject = new XMLHttpRequest();
		// IE5, IE6
		} else if (window.ActiveXObject){
			try {
				httpObject = new ActiveXObject("Msxml2.XMLHTTP"); 
			} catch(e) {
				httpObject = new ActiveXObject("Microsoft.XMLHTTP"); 
			}
		}
		///////////////////////////////////////////////	
		// サーバーからデータ到着後に実行する関数
		httpObject.onreadystatechange = display_itunes;
		///////////////////////////////////////////////	
		// HTTP非同期通信でPHPにアクセス  page
		httpObject.open ("GET", "../../../sub/itunes.php?artist=" + encodeURIComponent(y) + "&name=" + encodeURIComponent(title_name) + "&" + (new Date).getTime(), true);	
		
		
		httpObject.send (null);
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////	
// 表示
	function display_itunes(){
		if(httpObject.readyState == 4 && httpObject.status == 200){
			body_txt = decodeURIComponent(httpObject.responseText);
			
			document.getElementById(songbody).style.height = "auto";
			document.getElementById(itunes_no).style.marginLeft = "5px";	
			document.getElementById(itunes_no).style.marginTop = "10px";
			document.getElementById(itunes_no).innerHTML = body_txt;
		}
	}

