/**
 * Opens the cashbook view popup and sends the needed parameters.
 * @param displayType - can be 'office' or 'user'
 */
function cashBookView() {

	// collect info into formData
	var formData='';
	formData+='&idOffice='+$F('officeField');
	if ($('userField')) formData+='&idUser='+$F('userField');
	formData+='&dateStart='+$F('intervalStart');
	formData+='&dateEnd='+$F('intervalEnd');
	if ($('showEquivDefCurr').checked) formData+='&showEquivDefCurr=1';
	if ($('showEquivWorkCurr').checked) formData+='&showEquivWorkCurr=1';
	if ($('showExchRate').checked) formData+='&showExchRate=1';
	// collect currencies
	$('cashbookForm').select('input[name^=\'currencies[\']').each(function(input){
		if (input.checked){
			formData+='&currencies['+input.value+']='+input.value;
		}
	});

	new Popup( 'cashBookView.php?'+formData, 990, 600, 'cashBookViewWindow');
}
