AjaxRoot = '/quote/6/ajax/';

function Populate(DropDownID, LoaderID){
	


	VehicleTypeID = GetSelectValue('VehicleTypeID');
	ManufacturerID = GetSelectValue('ManufacturerID');
	ModelID = GetSelectValue('ModelID');
	DerivativeID = GetSelectValue('DerivativeID');
	FuelID = GetSelectValue('FuelID');
		
	url = AjaxRoot + 'modeloptions.php?current=' + DropDownID  + '&VehicleTypeID=' + VehicleTypeID + '&ManufacturerID=' + ManufacturerID 	+  '&ModelID=' + ModelID + '&DerivativeID=' + DerivativeID + '&FuelID=' + FuelID + '&' + Math.random() ;
	//alert(url);
	
//	url = AjaxRoot + 'modeloptions.php?current=' + DropDownID  + '&' + $('frmQuoteByModel').serialize() + 	'&' + Math.random();
	
	$('frmQuoteByModel').disable();	
	
	
	ajaxCallV2(url, '');
}

function StartUp(){
	Populate('StartUp', '');
	
}
function StartUp_Prepopulate(){
	
	url = AjaxRoot + 'modeloptions.php?current=' + 'Prepopulate'  + '&VehicleTypeID=' + VehicleTypeID + '&ManufacturerID=' + ManufacturerID 	+  '&ModelID=' + 0 + '&DerivativeID=' + 0 + '&FuelID=' + 0 + '&' + Math.random() ;
	//alert(url);
	ajaxCallV2(url, '');
	
}




/*
	Super Shopper
*/

function StartUp_SuperShopper(){
	Populate_SuperShopper('StartUp', '');
}

function Populate_SuperShopper(DropDownID){
	//document.body.style.cursor='wait';
	url = AjaxRoot + 'supershopper.php?current=' + DropDownID  + '&' + $('frmSuperShopper').serialize() + 	'&' + Math.random();
	
	$('frmSuperShopper').disable();
	//alert($('frmSuperShopper').serialize());
	ajaxCallV2(url, '');
}



function StartUp_SuperShopper_Refine(qs){
	//document.body.style.cursor='wait';

	url = AjaxRoot + 'supershopper.php?current=StartUp&ScreenType=Refine&' + qs +'&' + Math.random();
	ajaxCallV2(url, '');
}






/*
	Step 2
*/
function StartUp_Step2(){
	Populate_Step2('StartUp', 'ContractLengthID_Loader');
	
}
function Populate_Step2(DropDownID, LoaderID){
	
	//CAPDataID = GetSelectValue('CAPDataID');
	ContractLengthID = GetSelectValue('ContractLengthID');
	MileageID = GetSelectValue('MileageID');
	MaintenanceTypeID = GetSelectValue('MaintenanceTypeID');
	AgreementTypeID = GetSelectValue('AgreementTypeID');
		
	url = AjaxRoot + 'step2.php?current=' + DropDownID  + '&CAPDataID=' + CAPDataID  + '&BudgetRangeID=' + BudgetRangeID + '&ContractLengthID=' + ContractLengthID+  '&MileageID=' + MileageID + '&MaintenanceTypeID=' + MaintenanceTypeID + '&AgreementTypeID=' + AgreementTypeID + '&' + Math.random() ;
	//alert(url);
	ajaxCallV2(url, LoaderID);
}


function PrePopulateContractType(){
	action = 'prepopulate';

	url = AjaxRoot + 'step2.php?current=' + action  + '&CAPDataID=' + CAPDataID  + '&BudgetRangeID=' + BudgetRangeID  + '&CO2RangeID=' + CO2RangeID  + '&MPGRangeID=' + MPGRangeID + '&ContractLengthID=' + ContractLengthID+  '&MileageID=' + MileageID + '&MaintenanceTypeID=' + MaintenanceTypeID + '&AgreementTypeID=' + AgreementTypeID + '&ShopperTypeID=' + ShopperTypeID + '&' + Math.random() ;
	//alert(url);
	ajaxCallV2(url, 'ContractLengthID_Loader');
	
	}
	

function GetExtra(id, CAPDataID, ContractLengthID, MileageID, MaintenanceTypeID, AgreementTypeID, BudgetRangeID, CO2RangeID, MPGRangeID, ShopperType, csvManufacturerID){

	url = AjaxRoot + 'extra.php?destination='+ id +'&CAPDataID=' + CAPDataID  + '&ContractLengthID=' + ContractLengthID+  '&MileageID=' + MileageID + '&MaintenanceTypeID=' + MaintenanceTypeID + '&AgreementTypeID=' + AgreementTypeID + '&BudgetRangeID=' + BudgetRangeID + '&CO2RangeID=' + CO2RangeID + '&MPGRangeID=' + MPGRangeID + '&ShopperType=' + ShopperType + '&csvManufacturerID=' + csvManufacturerID + '&' + Math.random() ;	//alert(url);
	ajaxCallV2(url, id + '_Loader');
	}
	

function Populate_Refine(DropDownID, LoaderID){
	$('frmRefine').enable();
	url = AjaxRoot + 'refine.php?current=' + DropDownID  + '&' + $('frmRefine').serialize() + 	'&' + Math.random();
	
	$('frmRefine').disable();

		
//	url = AjaxRoot + 'refine.php?current=' + DropDownID  + '&CAPDataID=' + CAPDataID  + '&BudgetRangeID=' + BudgetRangeID + '&ContractLengthID=' + ContractLengthID+  '&MileageID=' + MileageID + '&MaintenanceTypeID=' + MaintenanceTypeID + '&AgreementTypeID=' + AgreementTypeID + '&' + Math.random() ;
	//alert(url);
	ajaxCallV2(url, '');
}


function StartUp_Populate_Refine(qs){
	//document.body.style.cursor='wait';

	url = AjaxRoot + 'refine.php?current=Prepopulate&ScreenType=Refine&' + qs +'&' + Math.random();
	
	$('frmRefine').disable();

	ajaxCallV2(url, '');
}




function HideShowWishListItem(e, ItemID){
	
	
	if (e.checked){
		$(ItemID).show();;
	}else{
		$(ItemID).hide();
	}
	
}

