//クロスブラウザ対策
var isMSIE = /*@cc_on!@*/false;			//IEかどうかを判定
if(isMSIE){
	char = document.charset;
}else{
	char = document.characterSet;
}

//PHPのrawurlencode互換のURIエンコード関数を生成
function rawurlencode(str) {
	return encodeURIComponent(str)
	.replace(/!/g,  "%21")
	.replace(/'/g,  "%27")
	.replace(/\(/g, "%28")
	.replace(/\)/g, "%29")
	.replace(/\*/g, "%2A")
	.replace(/~/g,  "%7E");
};


//参照元を取得
var ref = rawurlencode(document.referrer);
var title = document.title;
var url = rawurlencode(document.URL);

// 参照元URLとアクセスページをwrite.phpに渡す
document.write('<script type="text/javascript" src="http://lpo-tool.com/analysis/write.php?id=' +id+ '&ref=' +ref+ '&title=' +title+ '&url=' +url+ '&char=' +char+ '&param=' +Math.random()+ '"></script>');
