//ロールオーバー
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//ポップアップ
function  WOpen1(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=1","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen2(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=2","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen3(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=3","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen4(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=4","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen5(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=5","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen6(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=6","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen7(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=7","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen8(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=8","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen9(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=9","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen10(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=10","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen11(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=11","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen12(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=12","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

function  WOpen13(){ window.open("https://tafc.clickmovie.jp/p.p/0005/index.php?g=13","bosyu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=auto,resizable=yes,copyhistory=0,width=800,height=480") }

/*<a href="JavaScript:WOpen();"></a>*/


//ポップアップ
function Popup(theURL,winName,features){ window.open(theURL,winName,features);}
/*<a href="JavaScript:Popup('xxxx.html','xxxx','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=xxxx,height=xxxx')">*/




/*************
*設定
**************/

function CreateList()
{
	// カテゴリ別
	Create(document.frmCate.cateCateList, Cat_Ar);
	cateChgCateList();
}

// きょうの報ステ用 start
function ShowResult()
{
    menuURLcate='/dap/program/hst/backnumber_menu.php';

	var nSelectIndex = "";
	var nSelectIndex = (document.frmToDay.ymList.value =="")?(""):(document.frmToDay.ymList.value);

	var strResult = "";
	if(nSelectIndex != "") {
		strResult = "?td_ym=" + nSelectIndex;
	}

	window.location.href = menuURLcate+strResult;
}
// end きょうの報ステ用

// カテゴリ別用 start
function cateChgCateList(is_changed)
{   
    if(!is_changed){
        
    	cateYearClear();
    	Create(document.frmCate.cateYear, Year_Ar);
    	cateChgYear();

    }
	
	var nSelectIndex = 0;
	var nSelectIndex = (document.frmCate.cateCateList.value =="")?("0"):(document.frmCate.cateCateList.value);
    
    cateURLcate='/dap/program/hst/backnumber.php?mode=cate&c_id='+ nSelectIndex;
    
}

function cateChgYear()
{
	cateMonthClear();
	
	var nSelectIndex = (document.frmCate.cateYear.value =="")?("0"):(document.frmCate.cateYear.value);
    var SelectYear = Year_Ar[nSelectIndex];
    
    Create(document.frmCate.cateMonth, Month_Ar[SelectYear]);
    cateURLYear='&y='+ SelectYear;
    CatListByYear(SelectYear);
}

function cateChgMonth()
{
    
	var nSelectIndex = (document.frmCate.cateYear.value =="")?("0"):(document.frmCate.cateYear.value);
    CatListByYear(Year_Ar[nSelectIndex]);
}

function CatListByYear(SelectYear){
	var nSelectIndex = (document.frmCate.cateMonth.value =="")?("0"):(document.frmCate.cateMonth.value);
	cateURLMonth=(Month_Ar[SelectYear][nSelectIndex].length < 2)?('&m=0'+ Month_Ar[SelectYear][nSelectIndex]):('&m='+ Month_Ar[SelectYear][nSelectIndex]);
    
}

function cateShowResult()
{
	var strResult = "";
	strResult = cateURLcate+cateURLYear+cateURLMonth;
	window.open(strResult,"HstTodays");
}

//クリア関数
function cateYearClear()
{
	for (nDel = 0; nDel < Year_Ar.length; nDel++)
	{ 
    document.frmCate.cateYear.remove(0); 
    }
}

function cateMonthClear()
{
    
    for(i = 0 ; i < Year_Ar.length;i++){
        
        for (j=0;j < Month_Ar[Year_Ar[i]].length;j++){
            document.frmCate.cateMonth.remove(0);
        }
        
    }
    
}


function Create(objList, objArray)
{
    
	var nMax = objArray.length;
	var nLoop = 0;
    
	for (nLoop = 0; nLoop < nMax; nLoop++)
	{
        var str;
		var oAdd = document.createElement("OPTION");
        
        //カテゴリの場合は要素を分解
        if(objList.name =="cateCateList"){
            var data =objArray[nLoop].split("|");
    		oAdd.value = data[0];
    		str = document.createTextNode(data[1]);
            
        }else if(objList.name.match("Year")){
            
    		oAdd.value = nLoop;
    		str = document.createTextNode(objArray[nLoop] + "年");
            
        }else if(objList.name.match("Month")){
        	//oAdd.value =(nLoop.length < 2)?('0'+ nLoop):(nLoop);
    		oAdd.value = nLoop;
    		str = document.createTextNode(objArray[nLoop] + "月");
            
        }else{
            
    		oAdd.value = nLoop;
    		str = document.createTextNode(objArray[nLoop]);
            
        }
        
        
		oAdd.appendChild(str);
		objList.appendChild(oAdd);
        //objList.insertBefore(oAdd, objList.options[0]);

	}
}


