/*
function final_destination() {
	// How many web content editor input fields does the web page contain?
	var number_of_web_content_editor_input_fields = webeditor.count;

	// Check if all all web content editor input fields have been loaded and initialised
	if (webeditor.inited < number_of_web_content_editor_input_fields) {

		// No - wait 50 ms and try again.
		setTimeout("final_destination()", 50);

	} else if (number_of_web_content_editor_input_fields > 0 && browserIs("MSIE")) {

//		// Yes - focus the web content editor input field named "content"
//		if (document.getElementById(place) && document.getElementById(place).contentWindow && document.getElementById(place).contentWindow.focus) {
//			try {
//				document.getElementById(place).contentWindow.focus();
//			} catch(e) {
//			}
//		} else if (document.getElementById(place) && document.getElementById(place).focus) {
//			try {
//				document.getElementById(place).focus();
//			} catch(e) {
//			}
//		}
//		window.getElementById(place).focus();

		alert("scrolling");
		window.scrollTo(0,0);

//		alert("replacing");
//		location='#' + place;
//		window.location.replace(location);

//		window.location='#'+place;
	}
}
*/

function webeditor_custom_videoembedcode () {

	var wce_window = window.open("/web/popups/hardcore_videoembedcode", "wce_window", "width=720,height=300,resizable=yes,status=yes,titlebar=yes,scrollbars=yes,menubar=no,location=no,toolbar=no", true);

	wce_window.focus();

//	wce_window.document.write('<html><head><title>Paste HTML</title></head><body><textarea id="htmlcode" rows="10" cols="80"></textarea><p><input type="button" value="Paste HTML" onclick="window.opener.WebEditorPasteContent(document.getElementById(\'htmlcode\').value); window.close();"></body></html>');

	wce_window.document.close;
}

function webeditor_custom_encode(content) {
	// Place your own Javascript code here to modify the content
	// before the content is inserted into the web content editor
	return content;
}
function webeditor_custom_decode(content) {
	// Place your own Javascript code here to modify the content
	// before the content is submitted to the web server
	return HardCoreWebEditorCleanContentString(content, false, true, true, true, false, false, true, false, true, false, true, true);
}
