function displayManuals( activeFlag )
{		
	var modelCombo;
	var specCombo;

	if (activeFlag ) {		
		modelCombo 	= document.manualsForm.cmb_model;
		specCombo 	= document.manualsForm.cmb_specLetter;		
	} else {
		modelCombo 	= document.manualsForm.cmb_oldModel;
		specCombo 	= document.manualsForm.cmb_oldSpecLetter;	
	}
	
	if (modelCombo.options.length == 1 && modelCombo.options[0].value == '') {		
		alert('No manuals exists for \'' + document.manualsForm.hdn_market.value + '\' market.\nPlease visit manuals page for different market.');
		return;
	}				
	
	if (!validateComboBox( modelCombo )) {
		alert('Please select the model.');
		modelCombo.focus();		
		return;
		
	} else if( !validateComboBox( specCombo )) {
		alert('Please select the Specification Letter.');
		specCombo.focus();		
		return;		
	}
	
	document.manualsForm.hdn_model.value 		= modelCombo.options[ modelCombo.options.selectedIndex ].value;
	document.manualsForm.hdn_specLetter.value 	= specCombo.options[ specCombo.options.selectedIndex ].value;		
	document.manualsForm.hdn_activeFlag.value 	= activeFlag ? 'true' : 'false';
	
	document.manualsForm.submit();
}

function downloadManual( fileElemId )
{

	document.hdn_downloadManualForm.action = '/downloadManual';		
	
	var fileToDownload = document.getElementById( fileElemId ).getAttribute("value");
	document.hdn_downloadManualForm.file.value = fileToDownload;	
	
	document.hdn_downloadManualForm.submit();
}
