//ÊÇ·ñ¿É¼û
function SwitchVisibleState(element)
{
	var div = element;
	while(div!=null && div.tagName!="DIV")
	{
		div = div.parentElement;
	}
	
	if(div!=null)
	{
		div = div.nextSibling;
		
		if(div!=null)
		{
			if(div.style.display=="none")
			{
				div.style.display = "";
			}
			else
			{
				div.style.display = "none";
			}
		}
		/*
		if(div==null) return;
		
		div = div.nextSibling;
		
		if(div!=null)
		{
			if(element.innerText=="5")
			{
				element.innerText = "6";
				div.style.display = "none";
			}
			else
			{
				element.innerText = "5";
				div.style.display = "";
			}
		}
		*/
	}
}

function InsertFileToMyWebEditor(path, file_name, content_type)
{
  var editor = null;
  
  if(editor_focused != null)
  {
    editor = document.frames(editor_focused.id);
  }
  
  if(editor!=null)
  {
    var html = "";
    
	if(content_type.toLowerCase().indexOf("image/")>=0)
	{
		// Paste Image 
		if(editor.Mode=="Design")
		{
			html = "<img border=0 src='" + path + "'>";
		}
		else if(editor.Mode=="Html")
		{
			html = "&lt;img border=0 src='" + path + "'&gt;";
		}
	}
	else
	{
		// Paste Link
		if(editor.Mode=="Design")
		{
			html = "<a href='" + path + "'>" + file_name + "</a>";
		}
		else if(editor.Mode=="Html")
		{
			html = "&lt;a href='" + path + "'&gt;" + file_name + "&lt;/a&gt;";
		}
	}
		
	if(html!="" && MyWebEditor_PasteHtml!=null)
	{
		MyWebEditor_PasteHtml(editor, html);
	}
  }
}    
