function RefreshDisplay(id, id2)
{
	document.getElementById(id).style.display = 'block';
	document.getElementById(id2).style.display = 'none';
}

function ToggleDisplay(id)
{
	if (document.getElementById(id).style.display == 'block') {
		document.getElementById(id).style.display = 'none';
	} else {		document.getElementById(id).style.display = 'block';
	}
}

/*
	edUitleg
	edSmilies
	edExtended
*/
function UpdateUitleg()
{
	ToggleDisplay('edUitleg');
	document.getElementById('edSmilies').style.display = 'none';
	document.getElementById('edExtended').style.display = 'none';
	return false;
}

function UpdateSmilies()
{
	ToggleDisplay('edSmilies');
	document.getElementById('edUitleg').style.display = 'none';
	document.getElementById('edExtended').style.display = 'none';
	return false;
}

function UpdateExtended()
{
	ToggleDisplay('edExtended');
	document.getElementById('edUitleg').style.display = 'none';
	document.getElementById('edSmilies').style.display = 'none';
	return false;
}

function confirmSubmit()
{
var agree=confirm("Weet u zeker dat u wilt doorgaan?");
if (agree)
        return true ;
else
        return false ;
}

function insertBetweenTags(form_name, form_element, tag_begin, tag_end, text_prompt, begin_value, text_prompt_2)
{
	if (text_prompt == '')
		var text_between = begin_value;
	else
		var text_between = prompt(text_prompt, begin_value);

	if (tag_begin == '[url]' && text_between.length > 30) {
		var description_suggestion = text_between.substr(0, 27) + '... ';
		var link_description = prompt(text_prompt_2, description_suggestion);

		if (link_description.length > 30)
			link_description = link_description.substr(0, 27) + '...';

		tag_begin = '[url=' + text_between + ']';
		text_between = link_description;
	}

	if (text_between) {
		if (document.all)
		{
			document.forms[form_name][form_element].focus();
			var text_current = document.selection.createRange();
			var text_new = tag_begin + text_between + tag_end;
			text_current.text = text_new;
		}
		else
		{
			document.forms[form_name][form_element].focus();
			var startPos = document.forms[form_name][form_element].selectionStart;
			var endPos = document.forms[form_name][form_element].selectionEnd;
			var length = document.forms[form_name][form_element].value.length;

			document.forms[form_name][form_element].value = document.forms[form_name][form_element].value.substring(0, startPos)
										+ tag_begin + text_between
										+ tag_end + document.forms[form_name][form_element].value.substring(endPos, length);
		}
	}
} /* end insertBetweenTags() */


