$.fn.clearfocus = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};

$(document).ready(function(){
	$("#cname").clearfocus();
	$("#cphone").clearfocus();
	$("#ccomment").clearfocus();
	$("#nemail").clearfocus();

	$("div.toggler").hide();

	$("div.twocolteaser").find("p:first").append("<span class='dots'>..</span> <a class='togglelink more' href='javascript:;'>weiterlesen »</a>");
	$("div.toggler p:last-child").append("<br /><br /> <a class='togglelink less' href='javascript:;'>schliessen »</a>");

	$("a.togglelink").click(function () {

		$("div.toggler").slideToggle("slow");
		if($("a.more").is(":hidden")){
			$("span.dots").show();
			$("a.more").show();
		}else{
			$("span.dots").hide();
			$("a.more").hide();
		}
	});
});
