function jsvi_editor (rooth_path, id, width, height) {
	
	var editor_id = id + "_editor";
	
	document.write('<iframe width="' + width + '" height="' + height + '" id="' + editor_id + '" style="border-style: solid; border-width: 1px;"></iframe>');
	
	var jsvi_getIframe = function jsvi_getIframe() {
		var oDoc = jsvi_updatevalue();
		var obj1 = oDoc.getElementById('content');
		if (!obj1) return;
		var obj2 = document.getElementById(id);
		obj2.value = obj1.value;
	}
	
	var jsvi_updatevalue = function jsvi_updatevalue() {
		var obj = document.getElementById(editor_id);
		var oDoc = (obj.contentWindow || obj.contentDocument);
		if (oDoc.document) oDoc = oDoc.document;	
		return oDoc;	
	}
	
	var jsvi_init = function jsvi_init() {
		var obj1 = document.getElementById(id);
		var obj2 = document.getElementById(editor_id);
		if ((!obj1) || (!obj2)) {
			setTimeout(jsvi_init, 500);
			return;			
		}
		obj1.style.display = 'none';
		obj2.style.display = 'block';
		var oDoc = jsvi_updatevalue();		
		oDoc.ta = obj1;	
		oDoc.write('<link rel="stylesheet" href="' + rooth_path + 'editor/vi.css" type="text/css" />')
		oDoc.write('<script src="' + rooth_path + 'editor/vi.js" type="text/javascript" language="javascript"></script>');
		oDoc.write('<p><textarea name="content" id="content" onfocus="editor(this);" onattrmodified="alert(500);" style="width: 100%; height: 100%; border-style: none; background-color: transparent;">' + obj1.value +'</textarea></p>');
		setInterval(jsvi_getIframe, 100);
		//oDoc.style.padding = 0;
		//oDoc.style.margin = 0;
		//oDoc.write('<script type="text/javascript" language="javascript" defer="defer">editor(document.getElementById("content"));</script>');
	}
	
	jsvi_init();
		
}