function abortClick() {
	return FALSE;
}

function moreSmilies() {
  var winProperties = "toolbar=no,location=no,scrollbars=yes,directories=no,status=yes,copyhistory=no,width=200,height=560,resizable=yes";
  windowSmilies = window.open("index.php?section=smilies", "Smilies", winProperties);
	windowSmilies.focus();
	return false;
}

function toggleAll (thisid,idfirst,idlast) {
	var id = 0;
	
	if (document.getElementById("img_toggle_" + thisid).firstChild.data == "[-]") {
		for(id = idfirst; id <= idlast; id++) {
			document.getElementById("img_toggle_" + id).firstChild.data = "[-]";
			document.getElementById("text_toggle_" + id).style.display = "";
		}
	} else {
		for(id = idfirst; id <= idlast; id++) {
			document.getElementById("img_toggle_" + id).firstChild.data = "[+]";
			document.getElementById("text_toggle_" + id).style.display = "none";
		}
	}
}

var scriptRunned = new Date();

function toggle (id) {
	akDate = new Date();
	if (scriptRunned.getTime()+500 < akDate.getTime()) {
		if (document.getElementById("text_toggle_" + id).style.display == 'none') {
			document.getElementById("img_toggle_" + id).firstChild.data = "[-]";
			document.getElementById("text_toggle_" + id).style.display = "";
		} else {
			document.getElementById("img_toggle_" + id).firstChild.data = "[+]";
			document.getElementById("text_toggle_" + id).style.display = "none";
		}
		scriptRunned = new Date();
	}
}

function confirmLink(aLink, text) {
	var is_confirmed = confirm(text);
	if (is_confirmed)
		aLink.href += '&confirmed=true';
	return is_confirmed;
}

function count(e,form,text,input,limit,text_standard,text_toomuch) {
	var textarea = document.forms[form].elements[text];
	var span = document.getElementById(input+'_span');
	var input = document.forms[form].elements[input+'_input'];
	
	if (!e.which)
		keyCode = event.keyCode; // ie5+ op5+
	else
		keyCode = e.which; // nn6+

	var textStrlen = textarea.value.length;
	
	if (textStrlen < limit + 1) {
		input.value = limit - textStrlen;
		span.firstChild.data = text_standard;
		span.style.fontWeight = "normal";
	} else {
		span.style.fontWeight = "bold";
		if (textStrlen > limit + 1000) {
				span.firstChild.data = text_toomuch+"!!!!!!!!!!!!";
				input.value = "x";
		} else {
			input.value = textStrlen - limit;
			span.firstChild.data = text_toomuch;
		}
	}
}

function KlassenTauschen()
{
  var obj=document.getElementsByTagName("p");
  for(i=0;i<obj.length;i++)
  {
    if(obj[i].className=="abc")obj[i].className="xyz";
  }
}

// Control Panel Menü

var cpLastId = false;
var cpLastAddEditDel = false;
function cpMenu(id,AddEditDel) {
	if (cpLastId) {
		if (!(cpLastAddEditDel == AddEditDel && cpLastId == id))
			document.getElementById( "cpTD" + cpLastId + cpLastAddEditDel ).className = 'menuNorm' + cpLastAddEditDel;
		if (cpLastId != id)
			document.getElementById( "cpTD" + cpLastId ).className = 'menuNorm';
	}

	if (id != false) {
		cpLastId = id;
		cpLastAddEditDel = AddEditDel;

		document.getElementById( "cpTD" + id + AddEditDel ).className = 'menuOver' + AddEditDel;
		document.getElementById( "cpTD" + id ).className = 'menuOver';
	}
}
