// JavaScript Document

function recommendPropeller(rcmPageLocation,queryString,serverURL){
	
var submitInformation = 1;	
var engineSelected = document.getElementById('engineSelected').value;	
var boatSelected = document.getElementById('boatSelected').value;
var hullTypeSelected = document.getElementById('hullTypeSelected').value;
var boatPeopleWeight = document.getElementById('boatPeopleWeight').value;
var boatFuelWeight = document.getElementById('boatFuelWeight').value;
var boatExtraWeight = document.getElementById('boatExtraWeight').value;
var numOfEngines = document.getElementById('numOfEngines').value;
var boatAltitude = document.getElementById('boatAltitude').value;
var noBoat_length = document.getElementById('noBoat_length').value;
var noBoat_weight = document.getElementById('noBoat_weight').value;
var noBoat_beam = document.getElementById('noBoat_beam').value;
var noBoat_mph = document.getElementById('noBoat_mph').value;


//CHECKS IF ENGINE HAS BEEN SELECTED
if (engineSelected == ''){
alert('Please select your engine.');
moveToDiv(0,'selectionBase',40);
bc_selection_styleChange('bc_engine_1','bc_selection_sel','bc_selection');
submitInformation = 0;
return;
}


//CHECKS IF BOAT HAS BEEN SELECTED
if (boatSelected == ''){
alert('Please select your boat.');	
moveToDiv(-257,'selectionBase',40);
bc_selection_styleChange('bc_boat_2','bc_selection_sel','bc_selection');
submitInformation = 0;
return;
}	


//CHECKS IF BOAT HAS BEEN SELECTED
if (hullTypeSelected == '' && boatSelected == 'na'){
alert('Please choose your boats category.');
moveToDiv(-514,'selectionBase',40);
document.getElementById('noBoat_hullType').focus();
document.getElementById('noBoat_hullType').style.background = '#ffff00';
submitInformation = 0;
return;
}



if (boatSelected == 'na'){

//CHECKS IF BOAT LENGTH HAS BEEN SELECTED
if (noBoat_length == ''){
alert('Please select the length of your boat.');
moveToDiv(-514,'selectionBase',40);
document.getElementById('noBoat_length').focus();
document.getElementById('noBoat_length').style.background = '#ffff00';
submitInformation = 0;
return;
}

//CHECKS IF BOAT BEAM HAS BEEN SELECTED
if (noBoat_beam == ''){
alert('Please enter the beam of your boat.');	
moveToDiv(-514,'selectionBase',40);
document.getElementById('noBoat_beam').focus();
document.getElementById('noBoat_beam').style.background = '#ffff00';
submitInformation = 0;
return;
}



//CHECKS IF BOAT HAS BEEN SELECTED
if (noBoat_weight == ''){
alert('Please enter the net weight of your boat.');	
moveToDiv(-514,'selectionBase',40);
document.getElementById('noBoat_weight').focus();
document.getElementById('noBoat_weight').style.background = '#ffff00';
submitInformation = 0;
return;
}


}




//CHECKS IF BOAT FUEL WEIGHT HAS BEEN SELECTED
if (boatFuelWeight == ''){
alert('Please input the average amount of fuel.');
document.getElementById('boatFuelWeight').focus();
document.getElementById('boatFuelWeight').style.background = '#ffff00';
submitInformation = 0;
return;
}



if (submitInformation != 0){
	xmlhttpPost(rcmPageLocation + 
				'&engineSelected='+engineSelected+
				'&boatSelected='+boatSelected+
				'&hullTypeSelected='+hullTypeSelected+
				'&boatPeopleWeight='+boatPeopleWeight+
				'&boatFuelWeight='+boatFuelWeight+
				'&boatExtraWeight='+boatExtraWeight+
				'&numOfEngines='+numOfEngines+
				'&boatAltitude='+boatAltitude+
				'&noBoat_length='+noBoat_length+
				'&noBoat_beam='+noBoat_beam+
				'&noBoat_mph='+noBoat_mph+
				'&noBoat_weight='+noBoat_weight+queryString
				,'selectionResults','<img src=\''+serverURL+'IMAGES/loading_img.gif\' alt=\'Loading......\' style=\'margin-left:5px;\' />');
}

	
}