function fireCommand(command, id) {
	document.frmXms.fldCommand.value=command;
	document.frmXms.fldCommandId.value=id;
	document.frmXms.submit();
}
function confirmCommand(command, id) {
	if (confirm('Weet u het zeker?')) {
		document.frmXms.fldCommand.value=command;
		document.frmXms.fldCommandId.value=id;
		document.frmXms.submit();
	}
}
function fireChapter(command, id) {
	document.frmXms.fldCommand.value=command;
	document.frmXms.fldCommandId.value=id;
	document.frmXms.action='chapter.php';
	document.frmXms.submit();
}	
function firePage(command, id) {
	document.frmXms.fldCommand.value=command;
	document.frmXms.fldCommandId.value=id;
	document.frmXms.action='page.php';
	document.frmXms.submit();
}	
function fireNewPage(command, id) {
	document.frmPage.fldCommand.value=command;
	document.frmPage.fldCommandId.value=id;
	document.frmPage.action='page.php';
	document.frmPage.submit();
}	
function fireContents(handler, reference) {
	document.frmXms.fldContents.value=handler.contents.value;
	document.frmXms.fldCommandId.value=reference;
	document.frmXms.fldCommand.value='savetext';
	document.frmXms.submit();
}	

var winHandler;

function fireBeeldenWindow(reference) {
	document.frmXms.fldCommand.value='saveimage';
	document.frmXms.fldCommandId.value=reference;
	winHandler = window.open('beeldenwindow.php','beelden','width=700,height=400,dependent=yes');
}	
function closeBeeldenWindow(beeld) {
	//document.frmXms.fldContents.value=beeld;
	document.frmXms.fldCommand.value='saveimage';
	//document.frmXms.action='page.php';
	alert(document.frmXms.fldCommandId.value);
	alert();
	document.frmXms.submit();
}
function fireWindow(reference) {
	winHandler = window.open(reference,'item','width=525,height=400,dependent=yes,scrollbars');
	return;
}


function fireCardWindow(image,width,heigth) 
{
	var image_name = image;
	winHandler = window.open('../../parts/cardpopup.php?card='+image_name,'item','width='+width+',height='+heigth+'');
	return;
}

function firePopUpWindow(reference, optie)
{
	winHandler = window.open(reference,'item',optie);
	return;
}

function firePopUpCurrentWindow(reference, optie)
{
	winHandler = window.open(reference,'_self',optie);
	return;
}

function FireCommand2(frm, command, commandId)
{
	eval('document.'+frm+'.fldCommand.value=command');
	eval('document.'+frm+'.fldCommandId.value=commandId');
	eval('document.'+frm+'.submit()');
}

