<script language="javascript">
//<!--
var uagent = navigator.userAgent.toLowerCase();
var ie_ok = -1;
var gecko_ok = -1;
if(uagent.indexOf("gecko") && navigator.productSub >= 20030210)
{ gecko_ok=1; }
if(uagent.indexOf("msie") != -1 && uagent.indexOf("opera")== -1 && (uagent.indexOf("msie 5.5") || uagent.indexOf("msie 6.")))
{ ie_ok = 1; }
function InitToolbarButtons()
{
kids = document.getElementsByTagName('div');
for (var i=0; i < kids.length; i++)
{
if (kids[i].className == "imagebutton")
{
kids[i].onclick = tbclick;
}
}
}
function tbmousedown(e)
{
if(gecko_ok==1)
{
e.preventDefault();
}
}
function tbmouseout(id)
{
document.images[id].src="mycms/editor/images/buttons/"+ id +"n.gif";
}
function tbmouseover(id)
{
document.images[id].src="mycms/editor/images/buttons/"+ id +"a.gif";
}
function tbclick()
{
if(this.id == 'createlink')
{
if(ie_ok == 1)
{
edit.document.execCommand('createlink');
edit.focus();
}
if(gecko_ok == 1)
{
var szURL = prompt("Enter a URL:", "");
document.getElementById('edit').contentWindow.document.execCommand("CreateLink",false,szURL);
}
}
else
{
if(gecko_ok == 1)
{
document.getElementById('edit').contentWindow.document.execCommand(this.id, false, null);
}
if(ie_ok == 1)
{
edit.document.execCommand(this.id, false, null);
edit.focus();
}
}
}
function Start()
{
if(gecko_ok == 1)
{
document.getElementById('edit').contentWindow.document.designMode = "on";
try
{
document.getElementById('edit').contentWindow.document.execCommand("undo", false, null);
}
catch (e)
{
gecko_ok = -1;
}
}
}
function processData()
{
if(ie_ok==1) var htmlCode = edit.document.body.innerHTML;
if(gecko_ok==1) var htmlCode = document.getElementById('edit').contentWindow.document.body.innerHTML;
document.form_content.content.value = htmlCode;
if(document.form_content.content.value == '')
{
alert('Da is nix drinnen ... das nicht gut!');
return false;
}
}
//-->
</script>