// JavaScript Document
function $$(o){ return document.getElementById(o);}
function $$F(o){ return document.getElementById(o).value;}
function creatajax(){var xmlHttp;try{xmlHttp = new XMLHttpRequest();}catch(e){xmlHttp=null;var XmlHttpVersions = new Array("Microsoft.XMLHTTP","MSXML2.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.6.0");     for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++){xmlHttp=null;try{xmlHttp = new ActiveXObject(XmlHttpVersions[i]);}   catch (e) {}}}if(!xmlHttp){window.alert("创建实例失败...");return false;}return xmlHttp;}
function DrawImage(ImgD,width,height){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width/image.height>= width/height){ 
			if(image.width>height){ 
				ImgD.width=width; 
				ImgD.height=(image.height*width)/image.width; 
			}else{ 
				ImgD.width=image.width; 
				ImgD.height=image.height; 
			} 
		ImgD.alt=image.width+" x "+image.height; 
	} 
	else{ 
		if(image.height>height){ 
			  ImgD.height=height; 
			  ImgD.width=(image.width*height)/image.height; 
		  }else{ 
			  ImgD.width=image.width; 
			  ImgD.height=image.height; 
		  } 
		  ImgD.alt=image.width+" x "+image.height; 
		} 
	} 
} 

function ResetBssEditor(o)
{
	document.getElementById('ba_1').style.display='none';
	document.getElementById('ba_2').style.display='none';
	document.getElementById('SimpleEdit').style.display='none';
	document.getElementById('HighEdit').style.display='none';
	var bbseditorvalue;
	if(o=='txt')
	{
		document.getElementById('ba_1').style.display='';
		document.getElementById('nmtype').value='yb';
		document.getElementById('SimpleEdit').style.display='block';
		document.getElementById('bbskb').style.visibility="hidden";
		bbseditorvalue=0;
		var oEditor = FCKeditorAPI.GetInstance("textdetail");
		document.getElementById('txtdetail').value=oEditor.GetXHTML(true);
	}
	if(o=='fck')
	{
		document.getElementById('ba_2').style.display='';
		document.getElementById('nmtype').value='gj';
		document.getElementById('HighEdit').style.display='block';
		document.getElementById('bbskb').style.visibility='visible';
		bbseditorvalue=1;
		var oEditor = FCKeditorAPI.GetInstance("textdetail");
		oEditor.SetHTML(document.getElementById('txtdetail').value);
	}
	
	var ajax=creatajax();
	ajax.onreadystatechange = function(){
		if(ajax.readyState==4)
		{
			if(ajax.status==200||ajax.status==0)
			{		
			}
			else
				 alert("请求的页面异常");
		}
	}
	ajax.open("POST",'UserCenter.asp',true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gb2312");
	ajax.send('Action=ModiyUserSet&BbsEditor='+bbseditorvalue+'&T=T');
}