


function EditCss(pfield,pcss)
{
	var range = document.selection.createRange();
	if (document.getElementById(pfield + "_set").value == "FALSE")
	{
		document.getElementById(pfield).focus();
		alert("Bitte wählen Sie zuerst einen Text aus");
	}
	else // TRUE 
	{
		if (range.text.length > 0)
		{
			document.execCommand("removeformat");
			range.pasteHTML("<FONT class="+ pcss + ">"+ range.text + "</FONT>");
			range.select();
		}
		else
		{
			document.getElementById(pfield).focus();
			alert("Bitte wählen Sie zuerst einen Text aus");
		}
	}
	document.getElementById(pfield + "_content").value = document.getElementById(pfield).innerHTML;
	document.getElementById(pfield + "_ecss").selectedIndex = 0;
}


function EditRange(pfield,pcommand)
{
	var range = document.selection.createRange();
	if (document.getElementById(pfield + "_set").value == "FALSE")
	{
		document.getElementById(pfield).focus();
		alert("Bitte wählen Sie zuerst einen Text aus");
	}
	else // TRUE 
	{
		if (range.text.length > 0)
		{
			document.execCommand(pcommand);
			
		}
		else
		{
			document.getElementById(pfield).focus();
			alert("Bitte wählen Sie zuerst einen Text aus");
		}
	}
	document.getElementById(pfield + "_content").value = document.getElementById(pfield).innerHTML;
}

function SetField(pID,pValue)
{
	document.getElementById(pID).value = pValue;
}



function RedirectPage(paddpath)
{
	if (pageUrl != "")
		window.location.href = pageUrl + paddpath;
}

function RedirectParentPage(paddpath)
{
	if (pageUrl != "")
		parent.location.href = pageUrl + paddpath;
}



function OpenDialog(purl,pname,pwidth,pheight)
{
	dialog = window.open(purl,pname,"dependent=yes,height="+ pheight +",width="+ pwidth +",resizable=yes,scrollbars=no,status=no,location=no,toolbar=no,menubar=no",true);
	dialog.moveTo((screen.width-pwidth)/2,(screen.height-pheight)/2);
	dialog.focus();
}

function OpenScrollDialog(purl,pname,pwidth,pheight)
{
	dialog = window.open(purl,pname,"dependent=yes,height="+ pheight +",width="+ pwidth +",resizable=yes,scrollbars=yes,status=no,location=no,toolbar=no,menubar=no",true);
	dialog.moveTo((screen.width-pwidth)/2,(screen.height-pheight)/2);
	dialog.focus();
}


function MessageLink(pmessage,purl)
{
	if (window.confirm(pmessage) == true)
	{
		window.location.href = purl;
	}
}

function ParentMessageLink(pmessage,purl)
{
	if (window.confirm(pmessage) == true)
	{
		parent.location.href = purl;
	}
}


function MessageDialog(pmessage,purl,pwidth,pheight)
{
	if (window.confirm(pmessage) == true)
	{
		OpenDialog(purl,'Spawn',pwidth,pheight);
	}
}

function OpenFileDialog(purl,pname,pwidth,pheight,pfiletext)
{
	dialog = window.open(purl,pname,"height="+ pheight +",width="+ pwidth +",resizable=yes,scrollbars=no,status=no,location=no,toolbar=no,menubar=no",true);
	dialog.document.write("<HTML><HEAD><TITLE>"+ pname +"</TITLE></HEAD><BODY>"+pfiletext+"</BODY></HTML>");
	dialog.moveTo((screen.width-pwidth)/2,(screen.height-pheight)/2);
	dialog.focus();
}


function ValidateDownload(pmsg,ppath)
{
	window.setTimeout("MessageLink('"+ pmsg +"','"+ ppath +"&dwnsc=true')", 6500);
// 	if (window.confirm(pmsg) == true)
// 	{
// 		window.location.href = ppath + "&dwnsc=true"
// 	}
}


