function backToTop() {
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if (document.documentElement) {
	x1 = document.documentElement.scrollLeft || 0;
	 y1 = document.documentElement.scrollTop || 0;
	 }
	 if (document.body) {
	 x2 = document.body.scrollLeft || 0;
	 y2 = document.body.scrollTop || 0;
	 }
	 x3 = window.scrollX || 0;
	 y3 = window.scrollY || 0;
	 var x = Math.max(x1, Math.max(x2, x3));
	 var y = Math.max(y1, Math.max(y2, y3));
	 window.scrollTo(Math.floor(x / 4), Math.floor(y / 4));
	 if (x > 0 || y > 0) {
	 window.setTimeout("backToTop()", 25);
	 }
}
function setGoiken(){

	var response = "<br><br><b>ご意見ありがとうございました。</b><br><br>頂いたご意見には必ず目を通しますが、個々のご意見にお返事できないことを予めご了承ください。<br>";
	response    += '<br>返事が必要な<br>お問い合わせの場合は<br><a href="http://loopshoot.com/feedback.pl">こちらから連絡ください。</a>';

	var goiken_len = document.getElementById("goiken_len").value;

	document.getElementById("goiken").innerHTML = response ;

	if(goiken_len.length > 0 ){
		goiken_len = goiken_len.replace(/</g, '＜') ;
		goiken_len = goiken_len.replace(/>/g, '＞') ;
		goiken_len = goiken_len.replace(/\"/g, '"') ;
	}
	var url = document.URL ;
	var get_url = "set_goiken.cgi?goiken_len=" + goiken_len + "&url=" +url ; 
	xmlhttp = new XMLHttpRequest() ;

	xmlhttp.open("get",get_url);
	xmlhttp.send("");
	//$.get("set_goiken.cgi?", { goiken_len: goiken_len , url : url} );

	return;


}
function post_twitter() {
	var my_url = location.href ;
	var h_tw   = $("#h_tw").text();

	var bitly    = "bitly.pl?long_url=" + encodeURIComponent(my_url) ;
	$("#birly_response").text(" Looding ...") ;
		$.ajax({
		  type: "Get",
		  url: bitly,
		  success: function(data){
				$("#birly_response").text(" Looding ......") ;
				var twitter = 'http://twitter.com/home?status='+encodeURI(h_tw + ' ' + data+' @assister ' ) ;
				document.getElementById("birly_response").innerHTML 	= "<a target=\"_blank\" href=\""+ twitter + "\"> Tweet this !</a>" ;
				}	
		  
		});
				

	return;
}    
