// shoutbox.js v0.1, Jan 2009
document.observe("dom:loaded", function() {
	if($("shoutbox_countsigns")!=null) {
//	   var shout = new shoutbox();
	}
});

var sbct = true;
function textcounter(field, countfield, limit) {
	if (field.value.length > limit) {
		field.value = field.value.substring(0, limit);
	} else {
		countfield.value = String(limit - field.value.length)+ ' Zeichen';
	}
}

function textcounter2(field, countfield, limit) {
	var text = jq('#' + field).val();
	var l = limit - text.length;

	if (l < 0) {
		jq('#' + field).val(text.substring(0, limit));
		jq('#' + field).scrollTop(jq('#' + field)[0].scrollHeight);
		l = 0;
	}
	jq('#' + countfield).html(l + ' Zeichen');
}

function cleartextarea(field) {}
/*
var SBwhatsup_default = 'Schreib was!';

// feedlist class
var shoutbox = Class.create( {
	initialize : function(name) {
			this.SBname = name;
			this.SBWatchThis();
			this.SBSetStartConfig();
	},
	SBWatchThis : function() {
		$("shoutbox_countsigns").style.visibility = "visible";
		Element.extend(document.shoutboxform.message).observe('click', this.SBSetInputClick);
		Element.extend(document.shoutboxform.message).observe('blur', this.SBblur);
	},
	SBSetStartConfig : function() {
		document.shoutboxform.message.value = SBwhatsup_default;
	},
	SBSetInputClick : function() {
		if (document.shoutboxform.message.value == SBwhatsup_default) {
			document.shoutboxform.message.value = '';
		}
	},
	SBblur : function() {
		if (document.shoutboxform.message.value == '') {
			document.shoutboxform.message.value = SBwhatsup_default;
		}

	}

});
*/

jq(document).ready(function(jQuery) {
	initPlaceholder();
});

/**
 * Initilisiert die Placholder-Funktion, falls die LIB geladen wurde.
 */
function initPlaceholder() {
	if (typeof(jq.fn.placeholder) == 'function') {
		jq('input[placeholder]').placeholder();
		jq('textarea[placeholder]').placeholder();
	}
}

