function doSpell() {
    window.open("/admin/spellexternal/window.cfm?jsvar=document.forms[0].messagedesc.value", null, 
        "height=230,width=450,status=no,toolbar=no,menubar=no,location=no"); 
}
function calendar (baseurl)
	{
	calender = window.open(baseurl + "calendar.cfm", "CalendarWindow", "width=190,height=200");
	calender.moveTo(185, 200);
	}
		
function formchanged ()
	{
	document.form.form_changed.value = 'yes';
	}

function LinkSubmit(submitto,myID)
	{
	this.href = submitto;
	}
// Set Focus on the first field that contains an error
function errfocus (fieldname)
		{
		document.forms[0].elements[fieldname].focus();
		}

// Rückfrage (Ja,Nein) auslösen, Aktion zwischenspeichern


// Aktion über URL-Variable verschicken.
	function ActionSubmit(action) {
		document.forms[0].jsaction.value = action;
		document.forms[0].submit();
	}
	
function FormSubmit() {
	document.forms[0].submit();
}


	<!-- begin to hide script contents from old browsers
	function checksearch()
	  {
		var searchlen = document.forms[0].searchterm.value;
		if(searchlen == "")
			{
			alert("Please type in keyword(s) to search!");
			}
		else {
				ActionSubmit('act_content_search');
			 }
	  }
	// end hiding script from old browsers -->



	function popitup(destination,win_name,win_dim) 
	{
			window.open (destination ,win_name,win_dim + ',' + 'resizable=no,scrollbars=no,toolbar=no,Left=250,Top=250,status=no,directories=no,menubar=no,location=tabelle');
 	}

	function newwindow(destination,win_name,win_dim) 
	{
			window.open (destination ,win_name,win_dim + ',' + 'resizable=yes,scrollbars=yes,toolbar=no,Left=250,Top=250,status=no,directories=no,menubar=no,location=tabelle');
 	}

	if (document.layers) document.captureEvents(Event.KEYPRESS); 
	// needed if you wish to cancel the key

	document.onkeypress = keyhandler;
	
	function keyhandler(e) {
	    if (document.layers){
	        Key = e.which;
			ename = e.target.name;}
	    else{
	        Key = window.event.keyCode;
			ename = window.event.srcElement.name;}

//        alert("Key pressed! ASCII-value: " + Key + " - " + event.srcElement.name);

	    if (Key == 13 && (ename == "searchterm" || ename == "searchterm")){
			var searchlen = document.forms[0].searchterm.value;
			if(searchlen == "")
				{
				alert("Please type in keyword(s) to search!");
			    if (document.layers)
					return false;
		    	else
					window.event.returnValue = false;
				}
			else {
					for(var iii=0; iii < document.forms[0].elements.length; iii++){
						if(document.forms[0].elements[iii].type == "submit"){
							document.forms[0].elements[iii].name = "act_content_search";
							}
						}	
					ActionSubmit('act_content_search');
				 }
			}
	}


function noSpamMailLink(user,domain,tld,param) {
	locationstring = "mailto:" + user + "@" + domain + "." + tld + param;
	window.location = locationstring;
}

// Script for auto tab

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}


