 var RecaptchaOptions = {
    theme : 'white'
 };


function confirm_delete(link) {
	q = confirm("Willst du dieses Objekt wirklich löschen?");
	if (q == true)
		location.href=link;
}

function addTags(id, start, end){
		var text=$("#" + id).getSelection().text;
		$("#" + id).replaceSelection(start + text + end);
}

function addLink(id) {
	var url=prompt("Bitte die URL angeben:","http://");
	var text=$("#" + id).getSelection().text;
	$("#" + id).replaceSelection('<a href="' + url + '" target="_blank">' + text + '</a>');
}

function addYoutube(id) {
	var text=$("#" + id).getSelection().text;
	var url=prompt("Bitte die YouTube-URL angeben (http://www.youtube.com/watch?v=...):",text);
	$("#" + id).replaceSelection('[YOUTUBE]' + url + '[/YOUTUBE]');
}

var postletFilename="";
var postletMaxViewWidth=600;

function postletFinished() {
			$("#divbild").empty();
			$("#divbild").css("backgroundColor","transparent");
			$("#divbild").css("border","none");
			$("#divbild").css("width","");
			$("#divbild").html('<img id="bild" src="http://tsv-eibelstadt.de/img/temp/' + postletFilename + '?' + Math.random() + '"></img>');
			$("#newimage").attr("value","1");
			$("#bild").load(function() {
					var height=$("#bild").height();
					var width=$("#bild").width();
					var rw=width/postletMaxViewWidth;
					height=Math.round(height/Math.max(rw, 1));
					width=Math.round(width/Math.max(rw, 1));
					$("#bild").css("height",height + "px");
					$("#bild").css("width",width + "px");
				});
			
		}
