/* bannerset.js
   株式会社セキュアヴェイル
   logstare.com 向けバナー切り替えスクリプト
   ver 0.9
   created by eency-weency
   2009.9.28
 */
 


function setBanner(mode){

//	alert(mode);

	if(mode == "sub"){
		imgPath = "../img/common/";
		linkPath = "../";
	} else if(mode == "global_sub"){
		imgPath = "../img/common/";
		linkPath = "http://www.logstare.jp/";
	} else {
		imgPath = "img/common/";
		linkPath = "";
	}
	
	var bnCompany = new Array();
	var bnCopy = new Array();
	var bnImg = new Array();

	bnCompany[0] = "いちよし証券";
	bnCompany[1] = "テレマーケティング ジャパン";
	bnCompany[2] = "熊本中央信用金庫";
	bnCompany[3] = "富士通システムソリューションズ";
	bnCompany[4] = "紀伊國屋書店";
	
	bnCopy[0] = "ログ管理を新たな業務管理に<br>活かす";
	bnCopy[1] = "独自システムのログにも<br>柔軟に対応";
	bnCopy[2] = "シンクライアント環境での<br>ログ分析を可能に";
	bnCopy[3] = "LogStare の技術が活きている<br>アウトソーシングサービス";
	bnCopy[4] = "特権IDユーザの操作ログを<br>集中管理";


	bnImg[0] = "cs_thmab_ichiyoshi.png";
	bnImg[1] = "cs_thmab_tmj.png";
	bnImg[2] = "cs_thmab_kumacyu.png";
	bnImg[3] = "cs_thmab_fsol.png";
	bnImg[4] = "cs_thmab_kinokuniya.png";


	bnNo = getCookie("bnNo");
	if (bnNo == "") {
	    bnNo = 0;
	}
	
	
//	alert("バナー番号：" + bnNo);

	
	document.write('<a href="' +linkPath+ 'casestudy.html"><img src="' +imgPath+bnImg[bnNo]+'" /></a>');
	document.write('<div class="caption">');
	document.write('<p class="company"><a href="' +linkPath+ 'casestudy.html">'+bnCompany[bnNo]+'</a></p>');
	document.write('<p class="copy"><a href="' +linkPath+ 'casestudy.html">'+bnCopy[bnNo]+'</a></p>');
	document.write('</div>');
	document.write('<div class="clear"></div>');
	
	bnNo++;
	bnNo = bnNo % 5;

	document.write('<a href="' +linkPath+ 'casestudy.html"><img src="' +imgPath+bnImg[bnNo]+'" /></a>');
	document.write('<div class="caption">');
	document.write('<p class="company"><a href="' +linkPath+ 'casestudy.html">'+bnCompany[bnNo]+'</a></p>');
	document.write('<p class="copy"><a href="' +linkPath+ 'casestudy.html">'+bnCopy[bnNo]+'</a></p>');
	document.write('</div>');
	document.write('<div class="clear"></div>');

	bnNo++;
	bnNo = bnNo % 5;

	setCookie("bnNo", bnNo);

}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}
function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    // tmp += "path=" + location.pathname + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}
function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}