function getKeyword () {

var str = document.referrer;
//var newStr = str;

//  検索エンジン別の処理

if (str.match(/google/)){
var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
//	return newStr;
	}

else if (str.match(/yahoo/)){
	var newStr = str . replace(/.+p=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}
	
else if (str.match(/msn/)){
	var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}

else if (str.match(/being/)){
	var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}


//var newStr = "荻窪";//テスト


//対応ワードをそれぞれグループし配列へ

var flash_name = "1";//デフォルト値キーワードなし

search2 = new Array("杉並","荻窪","中央線","アウル");
search3 = new Array("売","顧客","成果");



//foreach相当
for (var i = 0; i < search2.length; i ++) {

	var searchKye = search2[i];
	if (newStr.match(searchKye)){flash_name = "2";}

}
for (var i = 0; i < search3.length; i ++) {

	var searchKye = search3[i];
	if (newStr.match(searchKye)){flash_name = "3";}

}

	return flash_name;

}//EMD



//URIリファラーを返す関数
function getURI () {

urlstring = document.referrer;
    return urlstring;
}


//検索キーワード表示確認用
function showKeyword () {

var str = document.referrer;
//var newStr = str;

if (str.match(/google/)){
var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
//	return newStr;
	}

else if (str.match(/yahoo/)){
	var newStr = str . replace(/.+p=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}
	
else if (str.match(/msn/)){
	var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}

else if (str.match(/being/)){
	var newStr = str . replace(/.+q=([^&]+).*/i,"$1");
	newStr = decodeURI(newStr);
	newStr = decodeURI(newStr);
//	return newStr;
	}

document.write("<br><br><fontsize=2>");
document.write(newStr);
document.write("</fontsize=2>");



}//EMD