function MM_findObj(n,d) {
	var p,i,x;
	if(!d)d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById)x=document.getElementById(n);return(x);
}

function MSHL() {
	var i,p,v,obj,args=MSHL.arguments;
	for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
	if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;}
	obj.visibility=v;}
}

function MN1(n) {
	document.write("<div id=Layer" + n + " style='position:absolute'>");
	document.write("<div id=serve" + n + " style='position:absolute; left:0px; top:14px; width:70px; height:30px; z-index:20; visibility: hidden;' onMouseOut=MSHL('serve" + n + "','','hide') onMouseOver=MSHL('serve" + n + "','','show')>");
	document.write("<table width=100% border=0 cellspacing=1 cellpadding=3 bgcolor=#cccccc class=TBMenu style='FILTER: alpha(opacity=85)'>");
	document.write("<tr bgcolor=eeeeee class=MenuBG><td style='line-height:16px'>");
	document.write("<table width=100% border=0 border=0 cellspacing=0 cellpadding=1 style=cursor:hand>");
}

function MN(m,n) {
	document.write("<tr><td onmouseover=\"this.className='MenuColor';\" onmouseout=\"this.className='';\">");
	document.write("<img src=images/blank.gif height=2 width=2><br><img src=images/blank.gif height=2 width=2><a href=\"");
	if(m.substr(0,5) != "http:"){document.write("" + m + "\">" + n + "</a></td></tr>");}
	else { document.write(m + "\">" + n + "</a></td></tr>"); }
}

function MN2(i,m,n) {
	document.write("</table></td></td></tr></table></div></div>");
	document.write("<a href=\"" + m + "\" onMouseOver=\"MSHL('serve" + i + "','','show','subscibe','','hide','order','','hide','feature','','hide','defuser','','hide','spread','','hide')\" onMouseOut=\"MSHL('serve" + i + "','','hide','subscibe','','hide','order','','hide','feature','','hide','defuser','','hide','spread')\">" + n + "</a>");
}

function MNL() { document.write(" ● "); }

function OpenMode(box) {
	var isPopNew   = box.checked;
	var anchorTags = document.getElementsByTagName('a');
	for (var i=0; i<anchorTags.length; i++) {
		if (anchorTags[i].getAttribute('name') != 'topiclink') continue;
		anchorTags[i].target = isPopNew ? '_blank' : '_self';
	}
}

function mOvr(src,clrOver) {
	if (!src.contains(event.fromElement)) {
		//src.style.cursor = 'hand';
		src.bgColor = clrOver;
	}
}

function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		src.bgColor = clrIn;
	}
}

function mClk1(src,id) { window.location .href =src; }
//-->

function opencat(cat) {
	if(cat.style.display=="none") {
		cat.style.display="";
	} else {
		cat.style.display="none"; 
	}
}

function showchild(objDiv) {
	if(objDiv.style.display == "none") { objDiv.style.display = "block"; }
	else { objDiv.style.display = "none"; }
}

function showimg() {
	if (document.FrontPage_Form1.hx66htm.checked == true) {
		img.style.display = "";
		up.style.display = "";
	} else {
		img.style.display = "none";
		up.style.display = "none";
	}
}

function showimg1() {
	if (document.FrontPage_Form2.hx66cms.checked == true) {
		img1.style.display = "";
		advance1.innerText="關閉操作"
	} else {
		img1.style.display = "none";
		advance1.innerText="貼子管理"
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function CheckAll(form) {
	for (var i=0;i<form.elements.length;i++) {
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked = form.chkall.checked;
	}
}

function DoTitle(addTitle) {
	document.FrontPage_Form1.title.value=addTitle+document.FrontPage_Form1.title.value
	document.FrontPage_Form1.title.focus();
	return (false);
}

function showpic() {
	if(document.all.MaoDiv.style.display=='block')
		{ document.all.MaoDiv.style.display='none' }
	else
		{ document.all.MaoDiv.style.display='block' }
	document.all.MaoDiv.style.posLeft=window.event.x-400;
	if(document.all.MaoDiv.style.posLeft<0) {
		document.all.MaoDiv.style.posLeft = 250;
	}
	document.all.MaoDiv.style.posBottom=window.event.y+document.body.scrollTop-230;
	if(MView.location=='about:blank') { MView.location.replace('cms_bbs_inc/emotpic.htm') }
	if(document.all.MaoDiv.style.posBottom<0) {
		document.all.MaoDiv.style.posBottom= 0;
	}
}

function Insert(theSmilie) {
	if (document.selection && document.selection.type == "Text") {
		var range = document.selection.createRange();
		range.text += theSmilie
	}
	else {
		document.FrontPage_Form1.body.value +=theSmilie + '';
		document.FrontPage_Form1.body.focus();
	}
}

