function WriteBg()
{
	var a=["#EDF0F5","#FAFBE6","#FFF2E2","#FDE6E0","#F3FFE1","#DAFAF3","#EAEAEF","#FFF"]
	for(var i=0;i<a.length;i++){
		document.write("<img src='/Templets/MB_CSS/b.gif' style='cursor:pointer;width:7px;height:6px;border:1px solid #999;background:"+ a[i] +"' alt='"+(i==a.length-1?"默认":a[i])+"' onclick='ContentBg(\""+(i==a.length-1?"":a[i])+"\")'/> ");
	}
}



function ContentBg(color)
{
	var obj=document.getElementById("content");
	obj.style.backgroundColor=color;

}


// 打印 ===== begin =====
function doPrint()
{
	var adBegin="<!--MB_AD_BEGIN-->";
	var adEnd="<!--MB_AD_END-->";
	var body;
	var css;
	var str;
	str += "<style media=print>.Noprint{display:none;}.PageNext{page-break-after: always;}</style>";
	str = "\n<script type='text/javascript'>\r\nfunction doPrint(){window.print();}\r\n</script>\r\n";
	str += "<center class='Noprint'><p><object id='WebBrowser'  classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'  height='0'  width='0'></object>";
	str += "<input type='button' value='打印' onclick='document.all.WebBrowser.ExecWB(6,1)'> ";
	str += "<input type='button' value='直接打印' onclick='document.all.WebBrowser.ExecWB(6,6)'> ";
	str += "<input  type='button' value='页面设置' onclick='document.all.WebBrowser.ExecWB(8,1)'> ";
	str += "</p><p><input type='button' value='打印预览' onclick='document.all.WebBrowser.ExecWB(7,1)'> ";
	str += "[字体：<input type='button' value='大' onclick='javascript:ContentSize(16)'> <input type='button' value='中' onclick='javascript:ContentSize(14)'> <input type='button' value='小' onclick='javascript:ContentSize(12)'>]";
	str += "</p><hr align='center' width='90%' size='1' noshade='noshade'></center>";
	str += "<div id=\"con\" contenteditable='true'>";
	body= document.getElementById("printBody").innerHTML;
	//去掉广告
	if (body.indexOf(adBegin)>=0)
	{
		str+=body.substr(0,body.indexOf(adBegin));
		str+=body.substr(body.indexOf(adEnd)+adEnd.length,body.length);
	}else{
		str+=body;
	}
	str +="</div>";
	document.body.innerHTML=str;
}
// 打印 ===== end =====




// 内容样式 ===== begin =====
function ContentSize(size)
{
	var obj=document.getElementById("content");
	obj.style.fontSize=size>0 ? size+"px" : "";
}
