var debugOn = false;

function setDispatch(target) {

	if (debugOn) {
		alert("Dispatching to '" + target + "'");
	}

	for (var i = 0; i < document.forms.length; i++) {
		var form = document.forms[i];
		if (debugOn) {
			alert("Updating form '" + form.name + "'");
		}
		if (form.dispatch != null) {
			form.dispatch.value = target; 	
		}
	}
						     
}


function openWindow(url) {
 	 		
	var remote = null; 	 		
 	 		
	remote = window.open(url,
	     	'Popup',
	     	'width=' + 640 + 
	     	',height=' + 480 +
	     	',status=no,resizable=no,scrollbars=yes,location=no,toolbar=no');
						     
} 

function openWindow(url, width, height) {
 	
	var remote = null;
		
	remote = window.open(url,
	     	'Popup',
     		'width=' + width + 
     		',height=' + height +
     		',status=no,resizable=yes,scrollbars=yes,location=no,toolbar=no');
						     
} 


function openEditLiveEditor(url) {
 	
 	var remote = null;
 		
	remote = window.open(url,
	     	'Editor',
	     	'width=' + 880 + ',' +
	     	'height=' + 660 + ',' +
	     	'status=no,resizable=no,scrollbars=no,location=no,toolbar=no');
						     
} 

function saveEditLiveEditor() {

	if (debugOn) {
		alert(document.articleForm.body.value);
	}
	
	var parentWindow = window.opener;
	parentWindow.document.articleForm.body.value = document.articleForm.body.value;
	window.close();
	
}

function confirmDelete() {

	return confirm('Are you sure that you want to delete the selected item?');
	
}


function confirmSend() {

	return confirm('Are you sure that you want to send the selected item?');

}

function confirmAction() {

	return confirm('Are you sure that you want to perform the selected action?');

}