// 定义编辑器

function defineEditor(name){
	$.ajaxSetup({async: false});
	$.get("web.ini", function(data){
		G_Options = parseINIString(data);
	});

	var ueditor_Options = G_Options["ueditor"];
	
	G_Editor=UE.getEditor(name,{
	
	//关闭字数统计
	wordCount:ueditor_Options["wordCount"]
	
	, toolbars: [G_ToolBars[ueditor_Options["toolbars"]]]
	//关闭elementPath
	, elementPathEnabled:ueditor_Options["elementPathEnabled"]
	//默认的编辑区域高度
	, initialFrameHeight:ueditor_Options["initialFrameHeight"]
	//分页标识符,默认是_ueditor_page_break_tag_
	,pageBreakTag:ueditor_Options["pageBreakTag"]
	//如果自定义，最好给p标签如下的行高，要不输入中文时，会有跳动感
	,initialStyle:ueditor_Options["initialStyle"]//编辑器层级的基数,可以用来改变字
	// 是否自动长高,默认true
	,autoHeightEnabled:false
	//更多其他参数，请参考ueditor.config.js中的配置项
	});

	G_Editor_height = $(".edui-editor-iframeholder").width();
	G_Editor_width = $(".edui-editor").width();
	
	$(window).resize(function(){
		
		t_height = $(window).height() - $(".edui-editor-toolbarbox").height() - $(".edui-editor-bottomContainer").height() - 60;
		t_width = $(window).width()-10;
		if(t_height != G_Editor_height && t_height > 100) {
			G_Editor.setHeight( t_height );
			G_Editor_height = t_height;
		}
		if(t_width != G_Editor_width && t_width > 150) {
			$(".edui-editor").css("width", t_width );
			$(".edui-editor-toolbarbox").css("width", t_width );
			$(".edui-editor-iframeholder").css("width", t_width );
			G_Editor_width = t_width;
		}
	});

}


