/*
/////////////////////////////////////////////////
共通項目呼び出しFunction
-------------------------------------------------
■初期設定
■Footerインクルード
■ディレクトリパス取得
/////////////////////////////////////////////////
*/

/* +++++++++++ 初期設定 +++++++++++ */

//リンク設定
var linkPath = getPath();

//設置するURL
var urlName = 'http://' + location.hostname + '/';

//ディレクトリ取得
var path = window.location.href;
var startNum = path.lastIndexOf('/',path.length);
var dirName = path.substring(path.lastIndexOf('/',startNum-1)+1,startNum);
var fileName = path.substring(path.lastIndexOf('/',path.length)+1);


/* +++++++++++ Footerインクルード +++++++++++ */

function putFooter(){
	//HTMLコード書き出し
	var code = '';
	
	code += '<div id="Footer">';
	code += '<div class="Contents">';
	
	code += '<div class="MenuArea">';
	code += '<p><a href="/site_policy/index.html">サイトポリシー</a></li> | <a href="/privacy/index.html">プライバシーポリシー</a> | <a href="/transaction/index.html">特定商取引法に基づく表示</a> | <a href="/sitemap/index.html">サイトマップ</a></li>';
	code += '</p>';
	code += '</div>';
	
	code += '<p class="Copyright">COPYRIGHT&copy;2010 Social Alliance Co.,Ltd. ALL RIGHTS RESERVED</p>';
	
	code += '</div>';
	code += '</div>';
	
	document.write(code);
};


/*
/////////////////////////////////////
ディレクトリパス取得
/////////////////////////////////////
*/

function getPath() {
	//このJSのパス
	var ThisName = 'common/js/inc.js';
	
	//JavaScriptリンクを取得
	var ScriptArray = document.getElementsByTagName('script');
	
	//このJSのリンク先を取得
	for(var i = 0; i < ScriptArray.length; i++) {
		var ScriptSrc = ScriptArray[i].getAttribute('src');
		var MatchSrc = ScriptSrc.match(ThisName);
		
		if(MatchSrc != null) {
			var Path = ScriptSrc.replace(ThisName, '');
			return Path;
		}
	}
};

