var wizard_window = null

function initialise() {
	var ilist = document.eform.cchoose;
	if (ilist != null) {
		for (i = 0; i < ilist.length; i++) {
			if (ilist[i].checked)
				document.cartoon.src = 'image/standard/' + ilist[i].value;
		}
	}
	if (self.init_dates)
		init_dates();
	if (self.init_keywords)
		init_keywords();
	if (self.init_names)
		init_names();
}
function clearup() {
}
function go_to(url) {
	window.location = url;
}
function insert_query(s) {
	document.search_form.search.value = s;
	document.search_form.submit();
	window.focus();
}
function show_wizard() {
	if (!wizard_window || wizard_window.closed)
		wizard_window = window.open('/cartoonx/query-wizard.html','query_wizard','menubar,resizable,scrollbars,status=no,width=590,height=735');
	wizard_window.focus();
}

function edit_content(name) {
	content_window = window.open('/cartoonx-cgi/content_edit.py?name=' + name,'content','menubar,resizable,scrollbars,status=no,width=630,height=450');
}

function preview_content(id, content) {
	document.getElementById(id).innerHTML = content;
}

function fetch_image(name) {
	document.cartoon.src = 'image/standard/' + name;
}

function full_image() {
	var image = document.getElementById('image').src;
	image = image.replace(/standard/, "full");
	if (image == null)
		return;
	var win = window.open('', 'ifull');
	win.document.write('<body><img align=center src="' + image + '"></body>');
	win.document.close();
}
