
function go_ex(lid){
	target=window.open("modules.php?name=Startpages&op=startpagelinkvisit&lid="+lid, "startpage_link_"+lid);
	target.focus();
}

function go_in(lid){
	window.location="modules.php?name=Startpages&op=startpagelinkvisit&lid="+lid;
}


function setsmiley(what) {
	var string_to_insert = " "+what+" ";
	putStr(string_to_insert);
}

var target = null;
function getTarget(el) {
	target = (document.getElementById)? document.getElementById(el):0;
}

function storeCursor(el) {
	if (document.all && el.createTextRange) el.cursorPos = document.selection.createRange().duplicate();
}

function putStr(text) {
	//special function for text manipulation; Click-a-Smiley en UBB codes; http://www.codebase.nl/index.php/command/viewcode/id/189
	if (!target) target=document.enter_message.shout_text; //force target if not succeeded to store it
	if (target) {
		if (document.all && target.cursorPos) {
			target.cursorPos.text = text;
		} else if (typeof(target.selectionStart) != 'undefined') {
			var sStart = target.selectionStart;
			var sEnd = target.selectionEnd;
			target.value = target.value.substr(0, sStart) + text + target.value.substr(sEnd, target.value.length);
			target.selectionStart = (sStart == sEnd)? sStart + text.length:sStart;
			target.selectionEnd = sStart + text.length;
		} else {
			target.value += text;
		}
		target.focus();
		storeCursor(target);
	}
}

var butClicked = false;
function checkDouble(obj) {
	if (butClicked) {
		alert ("Je bericht wordt al verstuurd. Momentje geduld a.j.b..");
		return false;
	} else {
		butClicked = true;
		return true;
	}
}
