function checkKey( frm )
{
	
	
	if( frm.elements["key"].value == "" )
	{
		alert("検索するキーワードを入力してください。");
		return false;
	}
	else
	{
		loading();
	}
	
	
}


function sectionOpen( openName, closeName )
{
	var obj1 = eval(document.getElementById(openName)).style;
	var obj2 = eval(document.getElementById(closeName)).style;


	if(obj1.display=="none")
	{
		obj1.display="";
	}
	else
	{
		obj1.display="none";
	}

	if(obj2.display=="none")
	{
		obj2.display="";
	}
	else
	{
		obj2.display="none";
	}


	
}


function loading()
{

	var objBody = document.getElementById("pageBody"); 

	var element = document.createElement("div"); 
	element.id = "loading";
	element.style.position = "absolute"; 
	element.style.left = "0px";
	element.style.top = "150px";        
	element.style.width = "950px";
	element.style.height = "100%";
	element.style.backgroundColor = "#ffffff";  
	
	var objBody = document.getElementById("pageBody");
	objBody.appendChild(element);
}

function ch_bg(target,col){
	target.style.backgroundColor = col;
	target.style.cursor="pointer";
}
 
function rt_bg(target,col){
	target.style.backgroundColor = col;
}


function materialOnBg( target ){
	target.style.backgroundColor ="#FFF8E6";
	target.style.cursor="pointer";	
}

function materialOffBg( target ){
	target.style.backgroundColor ="#FFFFFF";
}

function digiBook(url){
	window.open( url , 'ebook', 'width=1015, height=700,left=0, top=0');
}


function eventWindow(url){
	window.open( url , 'ebook', 'width=700, height=700, resizable=1,scrollbars=1,status=1,toolbar=0,menubar=0,location=0');
}


function checkDate()
{ 

	var flag = 0; 
	
	
	wfyy = document.ksform.fyy.value;
	wfmm = document.ksform.fmm.value;
	wfdd = "01";
	
	wtyy = document.ksform.fyy.value;
	wtmm = document.ksform.fmm.value;
	
	wtdd = monthday(wtyy,wtmm);
	
	wgakko = document.ksform.gakko.value;
	if(wgakko == "All"){
			wgakko = "gkbe=on&gkbj=on&gkbh=on&gkbo";
	}
	
	wkamoku = document.ksform.kamoku.value;
	wprefecture = document.ksform.prefecture.value;
	
	
	location.href = "http://ten.tokyo-shoseki.co.jp/enetap/kenjo/newkenjosn2.php?fyy=" + wfyy + "&fmm=" + wfmm + "&fdd=" + wfdd + "&tyy=" + wtyy + "&tmm=" + wtmm + "&tdd=" + wtdd + "&" + wgakko + "=on" + "&" + wkamoku + "=on" + "&" + wprefecture + "=on";

} 


function monthday(years,months){
	var lastday = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if (((years % 4 == 0) && (years % 100 != 0)) || (years % 400 == 0)){
		lastday[1] = 29;
	}
	return lastday[months - 1];
}


function popupWindow(goURI,wid,hei){
	var windowName;
	var winRect="height=" + hei + ",width="+wid+",";
	windowName = window.open(goURI , "fovorite", winRect+"resizable=1,scrollbars=1,status=1,toolbar=0,menubar=0,location=0");
	windowName.focus();


	//document.write(myURI);//dgb	
}

//親窓で移動，自分は閉じる
function openerLoad(goURI){
	opener.location.href = goURI;
	self.close();
}
