function copyright(){
	myD = new Date();
	myYear = myD.getFullYear();
	document.write('<p class="copyright">Copyright(C)'+myYear+' Tsunashima Information Agency All Rights Reserved.</p>\n');
}

function changeBlock(mode){
	if (document.getElementById){
		if(mode=='map'){
			document.getElementById('entry_map').style.display = "block";
			document.getElementById('comment').style.display = "none";
			location.href = 'javascript:void(0)';
            return true;
		}else if(mode=='comment'){
			document.getElementById('entry_map').style.display = "none";
			document.getElementById('comment').style.display = "block";
			location.href = 'javascript:void(0)';
            return true;

		}
	}
}

function changeBlock2(mode,id){
	if (document.getElementById){
		if(mode=='comment'){
			var thisComment = document.getElementById('comment'+id);
			thisComment.style.display == "none" ? thisComment.style.display = "block" : thisComment.style.display = "none";
			document.getElementById('tb'+id).style.display = "none";
			location.href = 'javascript:void(0)';
            return true;
		}else if(mode=='tb'){
			var thisTB = document.getElementById('tb'+id);
			thisTB.style.display == "none" ? thisTB.style.display = "block" : thisTB.style.display = "none";
			
			document.getElementById('comment'+id).style.display = "none";
			location.href = 'javascript:void(0)';
            return true;

		}
	}
}
function closeBlock(mode,id){
	if (document.getElementById){
		if(mode=='comment'){
			document.getElementById('comment'+id).style.display = "none";
			location.href = 'javascript:void(0)';
            return true;
		}else if(mode=='tb'){
			document.getElementById('tb'+id).style.display = "none";
			location.href = 'javascript:void(0)';
            return true;

		}
	}
}

//
// Copyright (c) 2005 koikikukan All Rights Reserved.
// http://yujiro.dyndns.com/blog/koikikukan/
// License is granted if and only if this entire
// copyright notice is included. By Yujiro ARAKI.

// Ver1.00 initial version.
// Ver1.01 corresponds to tree structure.
// Ver1.02 corresponds to MTSubCategories tag.
// Ver1.03 2005.09.10 fix bug for Mozilla.
// Ver1.04 2005.10.26 fix bug for empty data.
// Ver1.05 2006.01.26 corresponds to Serene Bach and sb.
// Ver1.06 2006.07.16 fix JavaScript error.

// 不要テキストノード削除(Mozilla対応)
function deleteTextNode(nodes) {
    for (var k = 0; k < nodes.length; k++) {
        if(nodes[k].nodeName == '#text') {
            nodes[k].parentNode.removeChild(nodes[k]);
        }
    }
}

// サブカテゴリー用（再帰呼び出し）
function setClass(nodes){

    // サブカテゴリーが存在しない場合の対処
    if(!nodes[0]){
        return;
    }

    // 最初の要素がULの場合, class属性(tree)を設定
    for (var i = 0; i < nodes.length; i++) {
        if(nodes[i].nodeName == 'UL'|| nodes[i].nodeName == 'ul'){
            nodes[i].setAttribute('class', 'tree');
            nodes[i].setAttribute('className', 'tree');
            break;
        }
    }

    for (var i = 0; i < nodes.length; i++) {

        // 現在の要素がULの場合, 最後の子要素(LI)にclass属性(end)を設定
        if(nodes[i].nodeName == 'UL' || nodes[i].nodeName == 'ul'){
            var ulNodes = nodes[i].childNodes;

            // 不要テキストノード削除(Mozilla対応)
            deleteTextNode(ulNodes);

            // JavaScript エラー対処 2006.07.16
            if((ulNodes.length - 1) >= 0){

                // Mozilla 警告対処 2005.09.10
                if(ulNodes[ulNodes.length - 1].innerHTML){
                    ulNodes[ulNodes.length - 1].setAttribute('class', 'end');
                    ulNodes[ulNodes.length - 1].setAttribute('className', 'end');
                }
            }
        }

        // 再帰処理
        var childNodes = nodes[i].childNodes;
        if(childNodes.length > 0){
            setClass(childNodes);
        }
    }
}

// サブカテゴリーリスト用ツリー化
function generateSubcategoryTree(){
    if(document.getElementById('categories') == null) {
        return;
    }
    nodes = document.getElementById('categories').childNodes;
    deleteTextNode(nodes);    // 不要テキストノード削除(Mozilla対応)
    setClass(nodes);
}

// ツリー構造リスト用ツリー化
function generateTreeForTreeStructure(name){
    if(document.getElementById(name) == null) {
        return;
    }
    nodes = document.getElementById(name).childNodes;
    deleteTextNode(nodes);    // 不要テキストノード削除(Mozilla対応)
    setClass(nodes);
}

// 一般リスト用ツリー化
function generateNormalTree(name) {
    if(document.getElementById(name) == null) {
        return;
    }
    nodes = document.getElementById(name).childNodes;

    // 不要テキストノード削除(Mozilla対応)
    deleteTextNode(nodes);

    for (var i = 0; i < nodes.length; i++) {

        // ul要素へのクラス属性追加
        if(nodes[i].nodeName == 'UL'|| nodes[i].nodeName == 'ul'){
            nodes[i].setAttribute('class', 'tree');
            nodes[i].setAttribute('className', 'tree');
        }
        list = nodes[i].getElementsByTagName('li');

        // li要素にclass属性(tree)を設定
        for (var j = 0; j < list.length; j++) {
            list[j].setAttribute('className', 'tree');
            list[j].setAttribute('class', 'tree');
            list[list.length - 1].setAttribute('className', 'end');
            list[list.length - 1].setAttribute('class', 'end');
        }
    }
}
function flash(file,width,height){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="top" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+file+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="'+file+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}




