function SetStartRow( n ){
	document.form.elements[ "nStartRow" ].value = n;
}
function bu( nMonthly, cPriceField ){
	if ( document.form.nSelPriceLow != null ){
		document.form.elements[ "nSelPriceLow" ].selectedIndex = 0;
		document.form.elements[ "nSelPriceHigh" ].selectedIndex = 0;
	}
	if( nMonthly != "" )
		BottomUpSimple( document.form.nDuration.value, nMonthly, cPriceField );
	else{
		RequestNResults();
		document.form.elements[ cPriceField ].value = "";
	}
}
function NoValidate(){
	document.form.onsubmit = function(){return true;};
}
function SetMakeOrderBy() {
	with ( parent.document.form.cOrderBy ) { 
		options[ 8 ] = new Option( "Merk van A tot Z", "fcMake,fcType" );
		options[ 9 ] = new Option( "Merk van Z tot A", "fcMake desc, fcType desc" );
	}
}
function SetTypeOrderBy() {
	with ( parent.document.form.cOrderBy ) { 
		options[ 8 ] = new Option( "Type van A tot Z", "fcMake,fcType" );
		options[ 9 ] = new Option( "Type van Z tot A", "fcMake desc, fcType desc" );
	}
}
function RequestType() {
	with ( document.form ) {
		DisableSelect( nTypeID );
		if ( nMakeID.value != "" ) {
			document.getElementById( "GetCF" ).src = "/files/occasions/jsMotors/GetType.cfm" + Comstr();
		}
		else {
			RequestNResults();
		}
	}
}
function RequestYears() {
	with ( document.form ) {
		if ( nMakeID.value != "" ) {
			document.getElementById( "GetCF" ).src = "/files/occasions/jsMotors/GetYears.cfm" + Comstr();
		}
	}
}		
function Comstr() {
	var c
	with ( document.form ) {
		c = "?nMakeID=" + nMakeID.value + 
				"&nTypeID=" + nTypeID.value + 
				"&nYear=" + nYear.value + 
				"&nPriceLow=" + nPriceLow.value + 
				"&nPriceHigh=" + nPriceHigh.value +
				"&cCarrosserieID=" + cCarrosserieID.value +
				"&nKMStandLow=" + nKMStandLow.value +
				"&nKMStandHigh=" + nKMStandHigh.value +
				"&cColour=" + cColour.value +
				"&cAcc=" + GetAcc() +
				"&nDealerID=" + nDealerID.value +
				"&cSort=" + cSort.value +
				"&bNew=" + bNew.value +
				"&bSchad=" + bSchad.value +
				"&_cCarrosserieID=" + _cCarrosserieID.value +
				"&_cCustomSQL=" + _cCustomSQL.value +
				"&_cSite=" + _cSite.value;
		if ( document.form.nOldestProductionYear != null )
			c += "&nOldestProductionYear=" + nOldestProductionYear.value;
		else
			c += "&nOldestProductionYear=0";
	}
	return c;
}
function GetAcc() {
	var cAcc = "";
	var objs = document.getElementsByName( "cAcc" );
	if ( objs.length != 0 ){
		for ( var i = 0; i < objs.length; i++ ) {
			if ( objs[ i ].checked ) {
				if ( cAcc != "" )
					cAcc += ",";
				cAcc += ( objs[i].value );
			}
		}
		return cAcc;
	}
}
function RequestNResults() {
	with ( document.form ) {
		document.getElementById( "GetCF" ).src = "/files/occasions/jsMotors/GetNResults.cfm" + Comstr();
	}
}		
function DisableSelect( o ) {
	with ( o ) { 
		options.length = 0; 
		options[ options.length ] = new Option( "-- Geen voorkeur --", "" ); 
		disabled = true;
	}
}
