if (REQUIRE_ONCE_COMMON == null)
{

	var REQUIRE_ONCE_COMMON = true;
	

	function number_format(numString) { 
		alert(numString);
		var arrStr = numString.split('.'); 
		var re = /(-?\d+)(\d{3})/; 
		
		while (re.test(arrStr[0])) { 
			arrStr[0] = arrStr[0].replace(re, "$1,$2"); 
		} 
		
		if(arrStr[1]) { 
			return arrStr[0] +'.' + arrStr[1]; 
		} else { 
			return arrStr[0]; 
		} 
	} 

	

	function confirm_del(href) 
	{
		if(confirm("本当にサックゼハシゲッスブカ")) 
				document.location.href = href;
	}


	function set_checkbox(form,fname,val) {
		var chk_count=0;
		for(i=0;i<form.length;i++) {
			if(form[i].type=="checkbox" && form[i].name==fname) {
				if(val=='inv') {
					form[i].checked=!form[i].checked;
				} else {
					form[i].checked=val;
				}
				chk_count++;
			}
		}
		return chk_count;
	}


	function chk_checkbox(form,fname,val) {
		var Check_List=false;
		for(i=0;i<form.length;i++) {
			if(form[i].type=="checkbox" && form[i].name==fname) {
				if(form[i].checked==val) Check_List=true;
			}
		}
		return Check_List;
	}
	

	function window_open() {
		var a=window_open.arguments;
		if(a.length==1)
			window.open(a[0]);
		else if(a.length==2)
			window.open(a[0],a[1]);
		else
			window.open(a[0],a[1],a[2]);
	}
	

	function search_post(url_path,form_info) {
		window_open(url_path+'search_post.php?form_info='+form_info,'search_post','scrollbars=yes,width=470,height=400');
	}
	

	function search_mb_id(url_path,form_info,mb_id) {
		window_open(url_path+'search_id.php?form_info='+form_info+'&mb_id='+mb_id,'search_id','scrollbars=no,width=350,height=300');
	}
	

	function note_write(url_path,recv_id) {
		window_open(url_path+'note_write.php?recv_id='+recv_id,'note_write','scrollbars=no,width=370,height=380');
	}
	

	function note_view(url_path,mode,num) {
		window_open(url_path+'note_view.php?mode='+mode+'&num='+num,'note_view','scrollbars=no,width=370,height=380');
	}
	

	function find_parent_tag(e,tag)
	{
		if(e.target)
			var obj = e.target
		else
			var obj = e.srcElement
		while (obj.tagName.toLowerCase() != tag)
		{
			if(obj.parentNode)
				obj = obj.parentNode
			else
				obj = obj.parentElement
			if(typeof(obj.tagName)=='undefined') break;
		}
		return obj
	}
	
	var list_tmp_color="";

	function list_over_color(e,color,title_idx) {
		var obj=find_parent_tag(e,'tr');
		if(!obj.style) return;
		var idx = obj.rowIndex;
		if(idx>=title_idx)	 {
			list_tmp_color=obj.style.backgroundColor;
			obj.style.backgroundColor=color
		}
	}
	function list_out_color(e) {
		var obj=find_parent_tag(e,'tr');
		if(obj.style) obj.style.backgroundColor=list_tmp_color
	}
	

	function toggle_display_object() {
		var a=toggle_display_object.arguments;
		var target=a[0];
		var disp=a[1];
		var on=a[2];
		var off=a[3];
		if(target.style.display=='') {
			target.style.display='none';
			disp.innerHTML=off;
		} else {
			target.style.display='';
			disp.innerHTML=on;
		}
	}
	
	//--------------------------------------------------
	// ｱﾛｺｸｱ篩｡ｼｭ ﾀﾌｹﾌﾁ ﾃｳｸｮｸｦ ﾀｧﾇﾑ ｺﾎｺﾐ
	var img_width=Array();
	var img_array=Array();
	
	function set_img_width_init() {
		var img = eval((navigator.appName=='Netscape') ? nsdoc+'.view_image' : 'document.all.view_image');
		if(typeof(img)!='undefined') {
			if(img.length>0) {
				for(i=0;i<img.length;i++) {
					img_width[i] = img[i].width;
					img_array[i] = img[i];
				}
			} else {
				img_width[0] = img.width;
				img_array[0] = img;
			}
			setInterval(set_width_img, 100);
		}
		if(set_img_old_onload) set_img_old_onload();
	}
	
	function set_width_img(){
		var view_image_width = eval((navigator.appName=='Netscape') ?
																 nsdoc+'.view_image_width' :
																 'document.all.view_image_width');
		
		if(img_array.length>0) {
			for(i=0;i<img_array.length;i++){ 
				if(img_width[i] > view_image_width.offsetWidth) {
					img_array[i].width = view_image_width.offsetWidth;
				} else if(img_width[i] < view_image_width.offsetWidth) {
					img_array[i].width = img_width[i];
				}
			}
		}
	}
	
	function view_image_popup(img) {
		var img_window=window.open('',img_window,'scrollbars=yes,resizable=yes,width=100,height=100');
		if(img_window) {
			img_window.document.writeln('<html>');
			img_window.document.writeln('<title>イメージ表示</title>');

			img_window.document.writeln('<scr'+'ipt>');
			img_window.document.writeln('function load_image() {');
			img_window.document.writeln('if((view_image.width+30)>(screen.width-5)) ');
			img_window.document.writeln('imgWidth=screen.width-5;');
			img_window.document.writeln('else');
			img_window.document.writeln('imgWidth=view_image.width+30;');
			
			img_window.document.writeln('if((view_image.height+55)>(screen.height-30)) ');
			img_window.document.writeln('imgHeight=screen.height-30;');
			img_window.document.writeln('else');
			img_window.document.writeln('imgHeight=view_image.height+55;');
			
			img_window.document.writeln('var x=screen.width/2-imgWidth/2;');
			img_window.document.writeln('var y=(screen.height-30)/2-imgHeight/2;');
			img_window.document.writeln('self.resizeTo(imgWidth,imgHeight);');
			img_window.document.writeln('self.moveTo(x,y);');			
			img_window.document.writeln('}');
			img_window.document.writeln('</scr'+'ipt>');		}

			img_window.document.writeln('<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">');
			img_window.document.writeln('<img src="'+img.src+'" id="view_image" onclick="self.close()" style="cursor:hand;" onload="load_image()">');
			img_window.document.writeln('</body>');
			img_window.document.writeln('</html>');
	}
	

	var layername = 'rg_layer_div'

	function rg_layer_action(name, status)
	{
		var obj = document.all[name];

		if (typeof(obj) == 'undefined') {
			return;
		}

		if (status) {
			obj.style.visibility = status;
		} else {
			if(obj.style.visibility == 'visible')
				obj.style.visibility='hidden';
			else
				obj.style.visibility='visible';
		}
	}

	var bbs_url = '';
	var member_url = '';
	var skin_url = '';

	function set_url(bbs,member,skin) {
		bbs_url=bbs;
		member_url=member;
		skin_url=skin;
	}

	function rg_bbs_layer(bbs_code,num,name,id,homepage,email,profile,memo)
	{

		var obj = document.all[layername];
		var x, y;
		var body = "";
		var height = 0;

		x = event.clientX + document.body.scrollLeft - 20;
		y = event.clientY + document.body.scrollTop - 20;
		obj.style.posLeft = x;
		obj.style.posTop = y;
		
	
		if (name) {
			body += "<tr onmouseover=this.style.backgroundColor='#ffffff' onmouseout=this.style.backgroundColor='#e5e5e5' onmousedown=\"location.href='"+bbs_url+"list.php?bbs_code="+bbs_code+"&ss[sn]=1&kw="+name+"';\"><td height=20>&nbsp; <IMG src="+skin_url+"images/namesearch_icon.gif border=0 width='12' height='12'> &nbsp;ﾀﾌｸｧﾀｸｷﾎ ｰﾋｻ&nbsp;&nbsp;</td></tr>";
			height += 20;
		}

		if (homepage) {
			body += "<tr onmouseover=this.style.backgroundColor='#ffffff' onmouseout=this.style.backgroundColor='#e5e5e5' onmousedown=\"window.open('"+bbs_url+"layer_action.php?mode=homepage&data="+homepage+"');\"><td height=20>&nbsp; <IMG src="+skin_url+"images/home_icon.gif border=0 width='12' height='12'> &nbsp;ﾈｨﾆ菎ﾌﾁ&nbsp;&nbsp;</td></tr>";
			height += 20;
		}

		if (email) {
			body += "<tr onmouseover=this.style.backgroundColor='#ffffff' onmouseout=this.style.backgroundColor='#e5e5e5' onmousedown=\"window.open('"+bbs_url+"layer_action.php?mode=email&data="+email+"');\"><td height=20>&nbsp; <IMG src="+skin_url+"images/home_icon.gif border=0 width='12' height='12'> &nbsp;ﾀﾌｸﾞﾀﾏ&nbsp;&nbsp;</td></tr>";
			height += 20;
		}
		
		if (profile && id) {
			body += "<tr onmouseover=this.style.backgroundColor='#ffffff' onmouseout=this.style.backgroundColor='#e5e5e5' onmousedown=\"window.open('"+member_url+"view_profile.php?mb_id="+id+"','profile','left=50,top=50,width=550,height=400,scrollbars=1');\"><td height=20>&nbsp; <IMG src="+skin_url+"images/home_icon.gif border=0 width='12' height='12'> &nbsp;ﾈｸｿﾁ､ｺｸ&nbsp;&nbsp;</td></tr>";
			height += 20;
		}

		if (memo && id) {
			body += "<tr onmouseover=this.style.backgroundColor='#ffffff' onmouseout=this.style.backgroundColor='#e5e5e5' onmousedown=\"note_write('"+member_url+"','"+id+"');\"><td height=20>&nbsp; <IMG src="+skin_url+"images/memo_icon.gif border=0 width='12' height='12'> &nbsp;ﾂﾊﾁｺｸｳｻｱ&nbsp;&nbsp;</td></tr>";
			height += 20;
		}

		if (body) {
			var layer_body = "<table border=0 width=100%><tr><td colspan=3 height=10></td></tr><tr><td width=5></td><td bgcolor=222222 style='cursor:hand'><table border=0 cellspacing=0 cellpadding=3 width=100% height=100% bgcolor=e5e5e5>"+body+"</table></td><td width=10></td></tr><tr><td colspan=3 height=10></td></tr></table>";
			obj.innerHTML = layer_body;
			obj.style.width = 150;
			obj.style.height = height;
			obj.style.visibility='visible';
		}
	}


	function rg_init_layer(layername)
	{
		document.writeln("<div id="+layername+" style='position:absolute; left:1px; top:1px; width:1px; height:1px; z-index:1; visibility: hidden' onmousedown=\"rg_layer_action('"+layername+"', 'hidden')\" onmouseout=\"rg_layer_action('"+layername+"', 'hidden')\" onmouseover=\"rg_layer_action('"+layername+"', 'visible')\">");
		document.writeln("</div>");
	}
	
	rg_init_layer('rg_layer_div');	
}