﻿/****************************************************
 RO69 JACK 
 ****************************************************/

$(document).ready(function () {
	$(".text-pop-layer").hide();
	$(".music-title").each(function(){
		var numval=$(this).find(".number").html();
		var txt=$(this).find(".text a");
		txt.click(function(){text_pop_toggle(numval,false,txt); return false;});
		$("#pop-layer"+numval+" div.close").click(function(){text_pop_toggle(numval,true);});
		$("#pop-layer"+numval).click(function(){text_pop_toggle(numval,true);});
		$("#pop-layer"+numval).appendTo("#page");
		
	});

});
function text_pop_toggle(num,isClose,txt){
	var c_obj=$("#pop-layer"+num);
	var dsp=$(c_obj).css("display");
	$("*[id*=pop-layer]").hide();
	if( !isClose ){
		var hi=$("#header").height();
		if( !hi){
			hi=$("#header2").height();
		}
		var lt=$("#page").position().left;
		var off=$(txt).offset();
		var c_hight=$(c_obj).height();
		/* 上位置設定 */
		var m_top=off.top-(c_hight*0.4);
		/* ヘッダー天地分調整（FLASHの場合、下にもぐる為） */
		if( m_top < hi ){
			m_top=hi+10;
		}
		$(c_obj).css("left",off.left-lt+20).css("top",m_top);
		$(c_obj).css("display",dsp).toggle();
	}
	return false;
}
/*	call whatsjack toggle	*/
function whatsjack_subcall(){
	$(".text-pop-layer").hide();
}
