﻿/*******************************************************************************
 *
 * FootMark-JavaScript
 * 
 * @author dongrikin@gmail.com
 * create 2005.05.01
 * 
 * update          author                add/modify
 *------------------------------------------------------------------------------
 * 2005.06.03      dongrikin@gmail.com   add getAdvertise();
 * 2005.10.21      dongrikin@gmail.com   add getCss();
 * 2005.12.23      dongrikin@gmail.com   add getFirefox(); getAdSense();
 * 
 *******************************************************************************
 */


/**
 * 
 * サーバ内パス設定
 * 
 */
var domain=document.domain;
var url='http://'+domain;
if (domain==''){ url='file:///C:/infoking'; }


/**
 * 広告取得関数
 * Google と Amazonの広告から乱数で表示
 */
function getAdvertise(){
/*
	var rand;
	var htmlSrc;
	rand = Math.floor(Math.random() * 4);
	if ( rand == 0 ){
		htmlSrc = getAmazon();
	} else if ( rand == 1 ){
		htmlSrc = getGoogle();
	} else if ( rand == 2 ){
		htmlSrc = getFirefox();
	} else if ( rand == 3 ){
		htmlSrc = getAdSense();
	}
	
	htmlSrc = getGoogle();
	
	return htmlSrc;
*/
	
	
	htmlSrc = getRightAdSense();
	
	return htmlSrc;
}


/***************************************************************************************************************************************************/


/**
 * AdSense 広告取得関数
 * 2008年以降
 */
function getCenterAdSense(){
	
	google_ad_client = "pub-0873485684472994";
	/* 468x60, 作成済み 08/05/02 */
	google_ad_slot = "9066787041";
	google_ad_width = 468;
	google_ad_height = 60;

	/*
	google_ad_client = "pub-0873485684472994";
	google_ad_slot = "7521244350";
	google_ad_width = 468;
	google_ad_height = 60;
	*/
	
	/*
	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;
	
	*/
	
	return getCenterYoutube();

}



function getCenterYoutube(){
	htmlSrc=" "
	+ "	<div id='vu_ytplayer_vjVQa1PpcFMOtBsKcds2xaOKN_d0TuqX9bGNLFCAZmI='>"
	+ "	<a href='http://jp.youtube.com/browse'>Watch the latest videos on YouTube.com</a></div>"
	+ "	<script type='text/javascript' src='http://jp.youtube.com/cp/vjVQa1PpcFMOtBsKcds2xaOKN_d0TuqX9bGNLFCAZmI='></script>"
	+ " ";
	return htmlSrc;
}





/**
 * AdSense 広告取得関数
 * 2008年以降
 */
function getRightAdSense(){
	
	google_ad_client = "pub-0873485684472994";
	/* 120x600, 作成済み 08/05/02 */
	google_ad_slot = "8204359785";
	google_ad_width = 120;
	google_ad_height = 600;

	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;

}



/**
 * AdSense 広告取得関数(dongrikin@msn.com)
 * 2008年以前
 */
function getNewAdSense(){
	
	google_ad_client = "pub-0873485684472994";
	google_ad_width = 120;
	google_ad_height = 600;
	google_ad_format = "120x600_as";
	google_ad_type = "text";
	//2007-03-24: infoseek
	google_ad_channel = "3558465668";
	google_color_border = "CCCCCC";
	google_color_bg = "FFFFFF";
	google_color_link = "000000";
	google_color_text = "333333";
	google_color_url = "666666";
	
	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;
	
}




/**
 * AdSense 広告取得関数
 * 
 */
function getAdSense(){
	
	google_ad_client = "pub-0873485684472994";
	google_ad_width = 120;
	google_ad_height = 240;
	google_ad_format = "120x240_as_rimg";
	google_cpa_choice = "CAAQ-6ydzgEaCAYwboN1d8wvKNHI93M";
	
	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;
	
}


/**
 * Firefox 広告取得関数
 * 
 */
function getFirefox(){
	
	google_ad_client = "pub-0873485684472994";
	google_ad_width = 120;
	google_ad_height = 240;
	google_ad_format = "120x240_as_rimg";
	google_cpa_choice = "CAAQw8P8zwEaCCkfm-KkreZAKKG_93M";

	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;
	
}


/**
 * W3Cロゴ取得関数
 *
 */
function getw3c(){
	
	htmlValid = '<p/>'
	+ '<div align="left">'
	+ '<a href="http://jigsaw.w3.org/css-validator/validator?uri='+url+'" target="_blank"><img src="'+url+'/images/valid-vcss.gif" style="border:0;" alt="Valid CSS!"></a>'
	+ '</div><p/>';
	return htmlValid;
}



/**
 * 広告取得関数
 * Amazon広告
 */
function getAmazon(){
	
	htmlSrc=' ' 
	+ '<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=infoking-22&o=9&p=11&l=st1&mode=software-jp&search=%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25BF%25E3%2583%25BC%25E3%2583%258D%25E3%2583%2583%25E3%2583%2588&fc1=&=1&lc1=&lt1=&f=ifr&bg1=" marginwidth="0" marginheight="0" width="120" height="600" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>'
	+ ' ';
//	htmlSrc = htmlSrc + getw3c();
	return htmlSrc;
}

/**
 * 広告取得関数
 * Google広告
 */
function getGoogle(){
	google_ad_client = "pub-0873485684472994";
	google_alternate_color = "DDDDDD";
	google_ad_width = 120;
	google_ad_height = 600;
	google_ad_format = "120x600_as";
	google_ad_type = "text";
	google_ad_channel ="";
	google_page_url = document.location;
	google_color_border = "CCCCCC";
	google_color_bg = "FFFFFF";
	google_color_link = "000000";
	google_color_url = "0000FF";
	google_color_text = "333333";
	
	htmlSrc=' '
	+ '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	+ ' ';
	return htmlSrc;
}

/***************************************************************************************************************************************************/

/**
 * メニューツリーを表示
 */
function showChild(vCNO) {
	var targetId, targetDIV;
	var targetId = "CHILD" + vCNO;
	
	var targetDIV = document.getElementById(targetId);
	if (targetDIV.style.display == "none") {
		targetDIV.style.display = "inline";
	} else {
		targetDIV.style.display = "none";
	}
}

/**
 * すべてのツリーを表示・非表示
 */
function doOpenClose(flg){
	for (i=1;i<=5;i++){
		targetId = "CHILD" + i;
		targetDIV = document.getElementById(targetId);
		if (flg=="0"){
			targetDIV.style.display = "none";
		}else if (flg=="1"){
			targetDIV.style.display = "inline";
		}
	}
}


/**
 * ツリーを反転させる
 */
function doReverse(){
	for (i=1;i<=5;i++){
		showChild(i);
	}
}


/**
 * 掲示板を開く
 */
function openBBS(bbsurl){
	window.open(bbsurl, 'Test', 'width=800px,height=500px,scrollbars=yes');
}


/**
 * ページスタイルシート
 */
function getCss(){
	cssHtml='<link rel="stylesheet" type="text/css" href="'+url+'/css/style.css">';
	return cssHtml;
}




/**
 * 左メニュー取得関数
 */
function getMenu(){
 strHTML=' '
 + ' <br/><center><a href="'+url+'/index.html"><img src="'+url+'/images/footmark.gif" alt="FOOTMARK" border="0"></a><br/><span style="font-size:13px;">UTF-8</span></center>'
// + ' <img src=http://'+document.domain+'/cgi-bin/log/access.cgi?' + document.referrer + ' border=0 width=1 height=1>'
// + ' <script type="text/javascript" src="http://infoking.hp.infoseek.co.jp/js/keeplog.js"></script>'
 + ' <script type="text/javascript" src="http://www.gedero.com/analyze/seed.js"></script>'
// + ' <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>'
// + ' <script language="text/javascript">'
// + ' _uacct = "UA-569455-2";'
// + ' urchinTracker();'
// + ' </script>'
 + ' <script type="text/javascript">'
 + ' var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");'
 + ' document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));'
 + ' </script>'
 + ' <script type="text/javascript">'
 + ' try {'
 + ' var pageTracker = _gat._getTracker("UA-569455-2");'
 + ' pageTracker._trackPageview();'
 + ' } catch(err) {}</script>'
 + ' '
 + ' <br/>'
 + ' '
 + ' <table cellspacing="1" cellpadding="0">'
 + '   <tr>'
 + '   <td><input type="button" name="open" value=" Open " onclick="javascript:doOpenClose(1);" class="menuBut"></td>'
 + '   <td><input type="button" name="oeverse" value="Reverse" onclick="javascript:doReverse();" class="menuBut"></td>'
 + '   <td><input type="button" name="close" value=" Close " onclick="javascript:doOpenClose(0);" class="menuBut"></td>'
 + '   </tr>'
 + '   <!--tr>'
 + '   <td colspan="3" align="right">'
 + '     <a href="http://jigsaw.w3.org/css-validator/validator?uri='+url+'" target="_blank"><img style="border:0;" src="'+url+'/images/w3c_css.jpg" alt="Valid CSS!"></a>'
 + '   </td>'
 + '   </tr-->'
 + ' </table>'
 + ' '
 + ' <table cellspacing="0" cellpadding="20" border="0" width="100%">'
 + '   <tr><td>'
 + '   <SPAN class="parent" ONCLICK="showChild(1)">Developer</SPAN><BR>'
 + '   <DIV ID="CHILD1" class="struct" STYLE="display:None">'
 + '   &nbsp;├&nbsp;<A href="'+url+'/developer/java/java.html" class="child">Java</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/developer/linux/linux.html" class="child">Linux</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/developer/db/db.html" class="child">DB</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/developer/xml/xml.html" class="child">XML</A><BR>'
 + '   &nbsp;└&nbsp;<A href="'+url+'/developer/scripts/index.html" class="child">Scripts</A><BR>'
 + '   </DIV>'
 + '   <br/>'
 + ' '
 + '   <SPAN class="parent" ONCLICK="showChild(2)">Tips</SPAN><BR>'
 + '   <DIV ID="CHILD2" class="struct" STYLE="display:None">'
 + '   &nbsp;├&nbsp;<A href="'+url+'/tips/windows/index.html" class="child">Windows</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/tips/eclipse/eclipse.html" class="child">Eclipse</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/tips/apache/apache.html" class="child">Apache</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/tips/gmap/gmaps.html" class="child">G-Mpas</A><BR>'
 + '   &nbsp;├&nbsp;<A href="#" onclick="window.open(\''+url+'/tips/player/player.html\',\'myplayer\', \'width=360,height=175\')" class="child">Player</A><BR>'
 + '   &nbsp;└&nbsp;<A href="'+url+'/tips/tools/index.html" class="child">Tools</A><BR>'
 + '   </DIV>'
 + '   <br/>'
 + ' '
 + '   <SPAN class="parent" ONCLICK="showChild(3)">BBS</SPAN><BR>'
 + '   <DIV ID="CHILD3" class="struct" STYLE="display:None">'
 + '   &nbsp;├&nbsp;<A href="http://'+document.domain+'/cgi-bin/bbs-jp/patio.cgi" class="child">Japanese</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://'+document.domain+'/cgi-bin/bbs-zh/patio.cgi" class="child">Chinese</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://'+document.domain+'/cgi-bin/bbs-ko/patio.cgi" class="child">Korean</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://www.aypwip.org/webnote/king" class="child">Webnote</A><BR>'
 + '   &nbsp;└&nbsp;<A href="http://'+document.domain+'/gabbly" class="child">GabblyChat</A><BR>'
 + '   </DIV>'
 + '   <br/>'
 + ' '
 + '   <SPAN class="parent" ONCLICK="showChild(4)">Blog</SPAN><BR>'
 + '   <DIV ID="CHILD4" class="struct" STYLE="display:None">'
 + '   &nbsp;├&nbsp;<A href="http://steadiness.blogspot.com/" class="child">Split-Second</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://footmark.wordpress.com/" class="child">foot mark</A><BR>'
 + '   &nbsp;└&nbsp;<A href="http://king.blogmao.com" class="child">King`s Blog</A><BR>'
 + '   </DIV>'
 + '   <br/>'
 + ' '
 + '   <SPAN class="parent" ONCLICK="showChild(5)">Others</SPAN><BR>'
 + '   <DIV ID="CHILD5" class="struct" STYLE="display:None">'
 + '   &nbsp;├&nbsp;<A href="'+url+'/others/gadgets.html" class="child">Gadgets</A><BR>'
 + '   &nbsp;├&nbsp;<A href="'+url+'/others/links.html" class="child">Links</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://'+document.domain+'/cgi-bin/wiki3_5_10/wiki.cgi" class="child">Wiki</A><BR>'
 + '   &nbsp;├&nbsp;<A href="http://'+document.domain+'/mobile" class="child">Mobile</A><BR>'
 + '   &nbsp;└&nbsp;<A href="http://'+document.domain+'/cgi-bin/login.cgi" class="child">Admin</A><BR>'
 + '   </DIV>'
 + '   <br/>'
 + ' '
 + '   </td></tr>'
 + ' </table>'
 + ' ';
return strHTML;
}
