	var select_obj;


	function init(){
		iView.document.designMode = 'On';
	}

	function doSelectColor(){
		if (document.all.colorChooser.style.display == "none")
			document.all.colorChooser.style.display = "";
		else
			document.all.colorChooser.style.display = "none";
	}

	function doColor(color){
		iView.document.execCommand('ForeColor', true, color);
		iView.focus();
	}

	function doBold(){
		iView.document.execCommand('Bold', false, null);
		iView.focus();
	}

	function doItalic(){
		iView.document.execCommand('Italic', false, null);
		iView.focus();
	}

	function doUnderline(){
		iView.document.execCommand('Underline', false, null);
		iView.focus();
	}

	function doOrdList(){
		iView.document.execCommand('insertorderedlist', false, null);
	}

	function doUnOrdList(){
		iView.document.execCommand('insertunorderedlist ', false, null);
	}

	function doBulList(){
		iView.document.execCommand('insertunorderedlist', false, null);
	}

	function doMusic(){
		var sel = iView.document.selection;
		var rng = sel.createRange();
		rStr = window.prompt("音楽ファイルのURLを入力してください。\"http://\"");
		if (rStr!=null && rStr!=""){
			;
		}
	}

	function doFont(fName){
		if(fName != '')
		iView.document.execCommand('fontname', false, fName);
	}

	function doSize(fSize){
		if(fSize != '')
		iView.document.execCommand('fontsize', false, fSize);
	}

	function doHead(hType){
		if(hType != ''){
			iView.document.execCommand('formatblock', false, hType);  
			doFont(selFont.options[selFont.selectedIndex].value);
		}
	}

//	function insertEmoticon(emo){
//		iView.focus();
//		iView.document.execCommand('InsertImage', false, emo);
//	}

	function insertEmoticon(emoText){
		var contentObj = document.getElementById('boardContent');

		if (contentObj.createTextRange && contentObj.caretPos){
			var caretPos = contentObj.caretPos;
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? emoText + ' ' : emoText;
		}else{
			contentObj.value  = contentObj.value  + emoText;
		}
	}

	function storeTextArea(obj){
		if (obj.createTextRange){
			obj.caretPos = document.selection.createRange().duplicate();
		}
	}

	function insertEmotext(ch){
		var now_txt = iView.document.body.innerHTML;
		iView.document.body.innerHTML = now_txt + ch
		iView.focus();
	}

	function doToggleView(){  
		if(viewMode == 1){
			iHTML = iView.document.body.innerHTML;
			iView.document.body.innerText = iHTML;
			divToolbars.style.display = 'none';
			iView.focus();
			viewMode = 2;
		}else{
			iText = iView.document.body.innerText;
			iView.document.body.innerHTML = iText;
			divToolbars.style.display = '';
			iView.focus();
			viewMode = 1;
		}
	}

	function openimg(img){
		imageViewer(img)
	}

	function imageViewer(img){  
		foto1= new Image();  
		foto1.src=(img);  
		contImg(img);
	}

	function contImg(img){  
		if((foto1.width!=0)&&(foto1.height!=0)){
			viewImg(img);
		}else{
			funzione="contImg('"+img+"')"; 
			intervallo=setTimeout(funzione,20);  
		}
	}

	function viewImg(img){  
		largh=foto1.width+20;  
		altez=foto1.height+25;  
		stringa="width="+largh+",height="+altez+",resizable=1";  
		finestra=window.open("/6th/include/module/_imageViewer.asp?target="+img+"","",stringa);
	}

	function imageLoad(strimg){
		var doc_image = new Image;
		doc_image.src = strimg;
		if(doc_image.width > 442){document.news_img.width = 442;}
	}

	function mabi_layerAction(name,status) { 
		var obj = document.getElementById(name)
		var _tmpx,_tmpy, marginx, marginy;
		_tmpx = event.clientX + parseInt(obj.offsetWidth);
		_tmpy = event.clientY + parseInt(obj.offsetHeight);
		_marginx = document.body.clientWidth - _tmpx;
		_marginy = document.body.clientHeight - _tmpy ;

		if(_marginx < 0)
			_tmpx = event.clientX + document.documentElement.scrollLeft + _marginx ;
		else
			_tmpx = event.clientX + document.documentElement.scrollLeft ;
		if(_marginy < 0)
			_tmpy = event.clientY + document.documentElement.scrollTop + _marginy +20;
		else
			_tmpy = event.clientY + document.documentElement.scrollTop ;
		obj.style.posLeft=_tmpx-13;
		obj.style.posTop=_tmpy-12;
		if(status=='visible') {
			if(select_obj) {
				select_obj.style.visibility='hidden';
				select_obj=null;
			}
			select_obj=obj;
		}else{
			select_obj=null;
		}
		obj.style.visibility=status;
	}

	function print_mabilayer(name, MemberIP, CharName, SvrName, sePt) {
		var printHeight = 0;
		var printMain="";
	
		printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#58A1CA' onMouseOut=this.style.backgroundColor='' onMouseDown=searchUser('"+sePt+"','"+CharName+"','"+SvrName+"');><td height=20 nowrap>&nbsp;&nbsp;<font color=ffffff>書き込みを見る</font>&nbsp;&nbsp;</td></tr>";
		//printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#58A1CA' onMouseOut=this.style.backgroundColor='' ><td height=20 nowrap>&nbsp;&nbsp;<font color=ffffff>その他のメニュ</font>&nbsp;&nbsp;</td></tr>";
		//printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#58A1CA' onMouseOut=this.style.backgroundColor='' ><td height=20 nowrap>&nbsp;&nbsp;<font color=ffffff>その他のメニュ</font>&nbsp;&nbsp;</td></tr>";
		printMain = printMain +	"<tr onMouseOut=this.style.backgroundColor=''><td  height=20 nowrap><font class=eng0 style='color:#58A1CA;'>&nbsp;&nbsp;"+MemberIP+"</font></td></tr>";
		
		printHeight = printHeight + 16;
		var printHeader = "<div id='"+name+"' style='position:absolute; left:10px; top:25px; width:147; height: "+printHeight+"; z-index:99999; visibility: hidden' onMousedown=mabi_layerAction('"+name+"','hidden')><table border=0 ><tr><td colspan=3 onMouseover=mabi_layerAction('"+name+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=mabi_layerAction('"+name+"','hidden') rowspan=2>&nbsp;</td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='ffffff' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100% bgcolor=9BC7DF>";
		var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=mabi_layerAction('"+name+"','hidden')>&nbsp;</td></tr><tr><td colspan=3 height=10 onMouseover=mabi_layerAction('"+name+"','hidden')></td></tr></table></div>";
	
		document.writeln(printHeader+printMain+printFooter);
	}

	function searchUser(sePt,pUser,pSv){
		window.location.href = sePt+'.asp?sv='+pSv+'&st=w&se='+escape(pUser)
	}