	function user_detail_window(id, ev){

	  x_loc = ev.screenX - 150;
	  y_loc = ev.screenY - 10;

	  window.open("/common/user_detail.php?id=" + id, "user_detail", "width=400,height=400,status=no,resizable=no,scrollbars=yes,left=" + x_loc + ",top=" + y_loc);
	}

	function nothing(){
	}

	function number_format(num) {
		return num.toString().replace(/([\d]+?)(?=(?:\d{3})+$)/g, function (t) { return t+","; });
	}

	//============================================
	//幅と高さの両方を変更(市場)
	//============================================
	function admin_box_resize(){
		width_change("main_contents", 150);
		height_change("below_area", 85);
	}

	//============================================
	//指定BOXの幅を変更
	//============================================
	function width_change(id_string, margin_width){
	
		box_width = (window.document.body.clientWidth - margin_width);
		
		if(box_width < 0){
			return;
		}
		
		box_width = box_width + "px";
		
		document.getElementById(id_string).style.width = box_width;
	}

	//============================================
	//指定BOXの高さを変更
	//============================================
	function height_change(id_string, margin_height){
		
		if(document.all){
			box_height = (window.document.body.clientHeight - margin_height);
		}
		else{
			box_height = (document.body.scrollHeight - margin_height - 30);
		}
		
		if(box_height < 0){
			return;
		}
		
		box_height = box_height + "px";
		
		document.getElementById(id_string).style.height = box_height;
	}

	//============================================
	// ac&domain
	//============================================
 	function write_a(){
 		document.write(a);
 	}
 	function write_d(){
 		document.write(d.join("."));
 	}
 	
 	function m_writer(name, a, d, link_flag){
 		str = a;
 		str += "@";
 		str += d.join(".");
 		
 		if(link_flag){
	 		document.getElementById(name).href = "mailto:" + str;
	 	}
	 	else{
	 		document.getElementById(name).innerHTML = str;
	 	}
 	}
 	
 	//============================================
	// 友人の招待ウィンドウを開く
	//============================================
  function invite_friend(u_id){
    x_loc = 100;
    y_loc = 100;
    window.open("/user_home/friend/invite.php?u_id=" + u_id, "info", "width=400,height=340,scrollbars=yes,resizable=yes,left=" + x_loc + ",top=" + y_loc);
    }

 	//============================================
	// 画像の拡大表示(ぴったりウィンドウサイズ)
	//============================================
 	function pict_large_suitable_window(url, pict_width, pict_height, ev){
    x_loc = ev.screenX - 200;
    y_loc = ev.screenY - 10;
    window.open("/home/image_display.php?src=" + url, "info", "width=" + (parseInt(pict_width) + 0) + ",height=" + (parseInt(pict_height) + 0) + ",scrollbars=no,resizable=no,status=no,left=" + x_loc + ",top=" + y_loc);
  }


//=====================================================================
// HTMLエスケープの解除
// 第1引数：string
//=====================================================================
function escapeHTML(str){
	str = replace_strings(str, "&", "&amp;");
	str = replace_strings(str, ">", "&gt;");
	str = replace_strings(str, "<", "&lt;");
	str = replace_strings(str, "\"", "&quot;");
	str = replace_strings(str, "'", "&#039;");
	return str;
}

//=====================================================================
// HTMLエスケープの解除
// 第1引数：string
//=====================================================================
function unescapeHTML(str){
	str = replace_strings(str, "&gt;", ">");
	str = replace_strings(str, "&lt;", "<");
	str = replace_strings(str, "&amp;;", "&");
	str = replace_strings(str, "&quot;", "\"");
	str = replace_strings(str, "&#039;", "'");
	return str;
}


//=====================================================================
// 引数を与えてクッキーの値を取得
// 第1引数：string
//=====================================================================
function getCookie(name) {

	if (!name || !document.cookie) return;
	var cookies = document.cookie.split("; ");

	for (var i = 0; i < cookies.length; i++) {
		var str = cookies[i].split("=");
		if (str[0] != name) continue;
		return unescape(str[1]);
	}
	
	return unescape("");
}

//=====================================================================
// マイホームのボタンを表示する
// 第1引数：bool
//=====================================================================
function myhome_button_check(login_flag){

	if(login_flag){
		$("menu_button_dummy").style.display = "none";
		$("menu_button3").style.display = "inline";
	}
	
}


