<!-- Hide from older browsers...
/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}
    function toggleLayer(whichLayer)
    {
    	if (document.getElementById)
    	{
    		// this is the way the standards work
    		var style2 = document.getElementById(whichLayer).style;
    		style2.display = style2.display? "":"block";
    	}
    	else if (document.all)
    	{
    		// this is the way old msie versions work
    		var style2 = document.all[whichLayer].style;
    		style2.display = style2.display? "":"block";
    	}
    	else if (document.layers)
    	{
    		// this is the way nn4 works
    		var style2 = document.layers[whichLayer].style;
    		style2.display = style2.display? "":"block";
    	}
    }

    function toggleLayerClose(whichLayer)
    {
    	if (document.getElementById)
    	{
    		// this is the way the standards work
    		var style2 = document.getElementById(whichLayer).style;
    		style2.display = "";
    	}
	}

	var checkflag = false;
	function check(field) {
	if (checkflag == false) {
	for (i = 0; i < field.length; i++) {
	field[i].checked = true;}
	checkflag = true;
	return ""; }
	else {
	for (i = 0; i < field.length; i++) {
	field[i].checked = false; }
	checkflag = false;
	return "checked"; }
	}

function popup(mylink, windowname)
{
if (! window.focus)return true;
	var href;
	if ( typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
   window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
	return false;
}

function targetopener(mylink, closeme, closeonly)
{
if (! window.focus (( window.opener)));return true;
window.opener.focus();
if (! closeonly)window.opener.location.href=mylink.href;
if (closeme)window.close();
return false;
}

//Function to format text in the text box
function FormatText(command, option)
{  	frames.message.document.execCommand(command, true, option);
  	frames.message.focus();
}
function insertTable(command, option)
{  	//frames.message.document.all.innermessage.innerHTML = "<table border=1><tr><td>test</td></tr></table>";
	var sel = frames.message.document.selection;
	if (sel!=null)
	{  	var rng = sel.createRange();
	    if (rng!=null)
		{	var parameterstring = prompt("Bitte geben Sie die Anzahl der Zeilen, Spalten und Randstärke durch ',' getrennt ein:","3,2,1");
			var parameter = parameterstring.split(",");
			var returnstring = "<table border=" + parameter[2] + ">";
			for (var i=0; i < parseInt(parameter[0]); i++)
			{	returnstring = returnstring + "<tr>";
				for (var j=0; j < parseInt(parameter[1]); j++)
					returnstring = returnstring + "<td>"+i*j+"</td>";
				returnstring = returnstring + "</tr>";
			} // for
			returnstring = returnstring + "</table>";
			rng.pasteHTML(returnstring.toString());
		}
	}
  	frames.message.focus();
}
//Function to add image
function AddImage()
{	imagePath = prompt('Bitte geben Sie die Internetadresse ein', 'http://');
	if ((imagePath != null) && (imagePath != ""))
	{	frames.message.document.execCommand('InsertImage', false, imagePath);
  		frames.message.focus();
	}
	frames.message.focus();
}
//Function to add smiley
function AddSmileyIcon(imagePath)
{	frames.message.document.execCommand('InsertImage', false, imagePath);
  	frames.message.focus();
}

//Function to clear form
function ResetForm()
{	status = false;
	ok = window.confirm('Wollen Sie wirklich alle Einträge zurücksetzen?');
	if (ok)
	{ 	frames.message.document.body.innerHTML = '';
	 	status = true;
	}
	return status;
}

function confirmdelete()
{	var ok = false;
	ok = window.confirm('Soll dieser Datensatz wirklich unwideruflich gelöscht werden?');
	return ok;
} // confirmdelete
function changeGroup()
{
var Eingabe;
Eingabe = confirm ("Sie wollen diese Person einer neuen Gruppe zuordnen!");
if (Eingabe == true)
alert("Person wird neu zugeordnet!");
else history.back();
}
function searchcontrol(language)
{	var errorlog = "";
	if (language == 'en')
	{		if (window.document.dbsearch.suchstring.value == "") errorlog = errorlog + "* Searchfield cannot be leaved blank!\n";
			if (!window.document.dbsearch.searchtype[0].checked && !window.document.dbsearch.searchtype[1].checked) errorlog = errorlog + "* Seachtype must be selected!\n";
	} else
	{		if (window.document.dbsearch.suchstring.value == "") errorlog = errorlog + "* Bitte geben Sie einen Suchbegriff an!\n";
			if (!window.document.dbsearch.searchtype[0].checked && !window.document.dbsearch.searchtype[1].checked) errorlog = errorlog + "* Suchart ist nicht ausgewählt!\n";
	} //language
	if (errorlog)
	{	errorlog = errorlog + "Die Suche konnte nicht ausgeführt werden!\n\n";
		alert(errorlog);
	} else
	{	window.document.dbsearch.submit();
	} //errorlog
}


function ShowProgress()
{
  strAppVersion = navigator.appVersion;
  if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "")
  {
    if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
    {
      winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes";
      window.showModelessDialog('<% = barref %>&b=IE',null,winstyle);
    }
    else
    {
      window.open('<% = barref %>&b=NN','','width=370,height=115', true);
    }
  }
  return true;
}

/*
Submit Once form validation-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
function submitonce(theform){
//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
	//screen thru every element in the form, and hunt down "submit" and "reset"
	for (i=0;i<theform.length;i++){
		var tempobj=theform.elements[i]
		if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
		//disable em
		tempobj.disabled=true
		}
	}
}
-->