//設定ここから --------

var Keywords = new Array();
Keywords[0] = "";
Keywords[1] = "制作";
Keywords[2] = "メンテナンス";
Keywords[3] = "運用";
Keywords[4] = "SEO";
Keywords[5] = "LPO";

var Cords = new Array();
Cords[0] = '<img src="/img/topimg.jpg" width="780" height="282" alt="TopImage" border="0" />';
Cords[1] = '<a href="/service/outline/production.html?1" title="デザイン・制作【PRODUCITON】"><img src="/img/topimg2.jpg" width="780" height="282" alt="TopImage" border="0" /></a>';
Cords[2] = '<a href="/service/outline/management.html?1" title="管理・運用【MANAGEMENT】"><img src="/img/topimg3.jpg" width="780" height="282" alt="TopImage" border="0" /></a>';
Cords[3] = '<a href="/service/outline/management.html?1" title="管理・運用【MANAGEMENT】"><img src="/img/topimg3.jpg" width="780" height="282" alt="TopImage" border="0" /></a>';
Cords[4] = '<a href="/service/outline/promotion.html?1" title="プロモーション【PROMOTION】"><img src="/img/topimg4.jpg" width="780" height="282" alt="TopImage" border="0" /></a>';
Cords[5] = '<a href="/service/outline/promotion.html?1" title="プロモーション【PROMOTION】"><img src="/img/topimg4.jpg" width="780" height="282" alt="TopImage" border="0" /></a>';

//設定ここまで、以下編集不要 --------

var Str = "";
var Domain = "";
var Strs = new Array();
var Keyword = "";
var n = new Array();
var i = 0;

Str = document.referrer;
Domain = Str.substring(0,Str.indexOf("?")+1);
Str = Str.substring(Str.indexOf("?")+1,Str.length);
Strs = Str.split("&");

re = new RegExp("yahoo","i");
while(i < Strs.length){
	n = Strs[i].split("=");
	if((Domain.match(re))&&(n[0]=="p")){
		Keyword = decodeURI(n[1]);
		break;
	}	else if(n[0]=="q"){
		Keyword = decodeURI(n[1]);
		break;
	}
	i++;
}

i = 1;
while(i < Keywords.length){
	re = new RegExp(Keywords[i],"i");
	if(Keyword.match(re)){
		document.write(Cords[i]);
		var flag = 0;
		break;
	}
	i++;
}
if(flag != "0"){ document.write(Cords[0]); }
