// JavaScript Document
function openEditor(section, id, language) {
	editorWindow = window.open('../htmleditor/editor.php?section=' + section + '&id=' + id + '&language=' + language,'editorWindow','width=600, height=600');
	editorWindow.resizeTo(600,600);
	editorWindow.focus();
}

function openEditor2(section, id, main_cat_id, language) {
	editorWindow = window.open('htmleditor/editor.php?section=' + section + '&id=' + id + '&main_cat_id=' + main_cat_id + '&language=' + language,'editorWindow','width=600, height=600');
	editorWindow.resizeTo(600,600);
	editorWindow.focus();
}

function openEditor3(section, id, main_cat_id, language) {
	editorWindow = window.open('../htmleditor/editor.php?section=' + section + '&id=' + id + '&main_cat_id=' + main_cat_id + '&language=' + language,'editorWindow','width=600, height=600');
	editorWindow.resizeTo(600,600);
	editorWindow.focus();
}

function openUploadWindow(section, main_cat_id, id, language) {
	uploadWindow = window.open('../uploadimage.php?section=' + section + '&main_cat_id='+ main_cat_id + '&id=' + id + '&language=' + language,'uploadWindow','width=300, height=200');
	uploadWindow.resizeTo(300,135);
	uploadWindow.focus();
}

function openDirectoryWindow(section, main_cat_id, id, language) {
	imageSelectWindow = window.open('../htmleditor/selectimage.php?section=' + section + '&main_cat_id=' + main_cat_id + '&id=' + id + '&language=' + language,'imageselect','width=440, height=150');
	imageSelectWindow.focus();
}

function browseWindow(section, main_cat_id, id, language) {
	browsewindow = window.open('../htmleditor/viewfiles.php?section=' + section + '&main_cat_id=' + main_cat_id + '&id=' + id + '&language=' + language,'browsewindow', 'height=550,width=400');
	browsewindow.focus();
}

function openImageWindow(URL, width, height) {
        var image = URL;
        msgWindow = window.open('','Nieuw', 'width=' + width + ' height=' + height + '');
        msgWindow.document.open('text/html');
        msgWindow.document.write('<html><head><title>Foto</title><head>');
        msgWindow.document.write('<body leftmargin="0" topmargin="0">');
        msgWindow.document.write('<img src="' + URL + '">');
        msgWindow.document.write('</body></html>');
        msgWindow.document.close();
}

function check_boxes(name, state) {
	for (i = 0; i < document.forms[0].elements.length; i++) {
		if (document.forms[0].elements[i].name == name)
			document.forms[0].elements[i].checked = state;
	}
}
