﻿
/*
for xforum html input interface
by feng weiguo, forxm@21cn.com, http://www.viviasoft.com,
all rights reserved.
modified 071010
*/

function MaximizeForm( objForm )
{
	objForm.elements["text"].style.width="650px";
	objForm.elements["text"].style.height="650px";
}

function CloseForm( objForm )
{
	objForm.parentNode.style.display="none";
	objForm.parentNode.innerHTML="";
}

function OnXmlChange( objSel )
{
	if( objSel.value=="-" )
	{
		objSel.nextSibling.innerHTML="";
	}
	else if( objSel.value=="Xhtml" )
	{
		objSel.nextSibling.innerHTML="编辑Xhtml数据, 或<span class='CmdText' onclick='EditXhtml(this)'>进入编辑界面</span>";
	}
	else if( objSel.value=="Polyhedra" )
	{
		objSel.nextSibling.innerHTML="编辑Polyhedra数据";
	}
	else if( objSel.value=="_user" )
	{
		objSel.nextSibling.innerHTML="编辑自定义XML数据";
	}
	
	objSel.nextSibling.style.display=(objSel.value=="-")?"none":"inline";

	var obj= objSel.nextSibling.nextSibling;
	//alert( obj.tagName );
	if( !obj.style ) obj=obj.nextSibling;
	if( obj && obj.style ) obj.style.display=(objSel.value=="-")?"none":"block";
}

function EditXhtml( objCmd )
{
	var arg={
		sXml: objCmd.parentNode.nextSibling.value
		};
	
	if( window.showModalDialog(
				g_rootpath+g_esoepath+"lib/com/viviasoft/supertree/htm/DlgEditXhtml.htm",
				arg,
				"dialogWidth:550px;dialogHeight:400px;status:0;help:0;resizable:1;"
				)
		)
	{
		objCmd.parentNode.nextSibling.value= arg.sXml;
	}
	
}
