function BgChange(id,x,y) {
	document.getElementById(id).style.backgroundPosition=x+"px "+y+"px";
}

function Access() {
	if(document.URL.search(/gala_test\//)>0){
		document.write("<img src='http://www.oyamadai.com/cgi/acc_oyamadai_gala_test/acclog.cgi?");
	}else if(document.URL.search(/test\//)>0){
		document.write("<img src='http://www.oyamadai.com/cgi/acc_oyamadai_test/acclog.cgi?");
	}else if(document.URL.search(/check\//)>0){
		document.write("<img src='http://www.oyamadai.com/cgi/acc_oyamadai_check/acclog.cgi?");
	}else{
		document.write("<img src='http://www.oyamadai.com/cgi/acc_oyamadai/acclog.cgi?");
	}
	document.write("referrer="+document.referrer+"&");
	document.write("width="+screen.width+"&");
	document.write("height="+screen.height+"&");
	document.write("color="+screen.colorDepth+"'>");
}


// 最速にある wait 関数
function wait(a,func){
	var check = 0;
	try{
		eval("check = " + a);
	}catch(e){
	}
	if(check){
		func()
	}else{
		var f = function(){wait(a,func)};
		setTimeout(f,100);
	}
}

function MailTo(madrs1,madrs2,subject){
	madrs=madrs1+"%40"+madrs2;
	if(navigator.platform.indexOf("Mac")>-1){
		location.href="mai"+"lto:"+madrs+"?subject="+subject;
	}else if(navigator.userAgent.indexOf("Opera")>-1){
		location.href="mai"+"lto:"+madrs;
	}else{
		//esc.jsを読み込み、件名をEscapeSJIS()でエスケープ
		window.status="メールソフトが起動するまでしばらくお待ちください";
		url=document.URL;
		if(url.indexOf("test/")>-1){
			escjs_path=url.substring(0,url.indexOf("test/")+5)+"js/esc.js";
		}else{
			escjs_path=url.substring(0,url.indexOf("jp/")+3)+"js/esc.js";
		}
		var ele = document.createElement("script");
		ele.type = "text/javascript";
		ele.src = escjs_path;
		document.body.appendChild(ele);

		wait('EscapeSJIS', function() {
			// 実行したい処理
			location.href="mai"+"lto:"+madrs+"?subject="+EscapeSJIS(subject);
		});
	}
}

