var show_result_on='distance_select';// values: car-select OR distance-select
var ml_language = 'nl';
var offerte_url = ml_language+'/offerte/car_id=';
var contact_url = ml_language+'/contact/';	// add an = to have the car-id added to this URL

Array.prototype.sort=function(){
	var tmp;
	for(var i=0;i<this.length;i++){
		for(var j=0;j<this.length;j++){
			if(this[i].toString()<this[j].toString()){
				tmp = this[i];
				this[i] = this[j];
				this[j] = tmp;
			}
		}
	}
};

Array.prototype.sortInt=function(){
	var tmp;
	for(var i=0;i<this.length;i++){
		for(var j=0;j<this.length;j++){
			if(this[i]<this[j]){
				tmp = this[i];
				this[i] = this[j];
				this[j] = tmp;
			}
		}
	}
};

Array.prototype.in_array = function(val){
	for (var i=0; i<this.length; i++){
		if (this[i]==val)
			return i;
	}
	return -1;
}

// MODELS
function Car(id, brand, type, price, distance, classname, car_type_id, avail_any, avail_benzine, avail_diesel, price_benzine, price_diesel, image){
	this.id = id; this.brand = brand; this.type=type; this.price = price; this.distance = distance;
	this.classname = classname.toLowerCase();
	this.car_type_id = car_type_id;
	
	this.avail_any = avail_any;
	this.avail_benzine = avail_benzine;
	this.avail_diesel = avail_diesel;
	
	this.price_benzine = price_benzine;
	this.price_diesel = price_diesel;

	this.image = image;
	
	this.toShortString = function(){
		return this.brand + ' ' + this.type;
	}
	
	this.toString = function(){
		return this.brand + ' ' + this.type + ' ' + (this.avail_any?' (Direct beschikbaar)':'');
	}
}

function Carselector(){
	this.cars = new Array();
	this.classname = false;
	this.carId = false;
	this.distance = -1;
	
	this.controller = new Object();
	this.controller.model = this;
	
	this.view = new Object();
	this.view.model = this;	
	
	this.getCarsByClassFilter = function(){
		list = this.getCarsByFilter(new Array('classname'));
		// get unique results
		unq = new Array();
		fnd = new Array();
		for (var i=0; i<list.length; i++){
			if (fnd.in_array(list[i].car_type_id)==-1){
				fnd.push(list[i].car_type_id);
				unq.push(list[i]);
			}			
		}
		unq.sort();
		return unq;
	}
	
	this.getCarsByFilter = function(filters){
		if (!filters)
			filters = new Array('classname', 'carId', 'distance');
			
		cars = new Array();
		for (var i=0; i<this.cars.length; i++){
			do_push = true;
			
			if (this.classname && filters.in_array('classname')!=-1)
				if (this.cars[i].classname.toLowerCase() != this.classname.toLowerCase())
					do_push = false;

			
			if (this.carId && filters.in_array('carId')!=-1){	
				car = this.getCarById(this.carId);
				if (this.cars[i].car_type_id != car.car_type_id)
					do_push = false;
			}
			
			if (this.distance!=-1 && filters.in_array('distance')!=-1)
				if (this.cars[i].distance != this.distance)
					do_push = false;
			
			if (do_push){
				cars.push(this.cars[i]);
			}
		}
		return cars;
	
	}
	
	this.getCarById = function(id){
		for (var i=0; i<this.cars.length; i++){
			if (this.cars[i].id == id)
				return this.cars[i];
		}
		return false;
	}
	
	this.getCarByIdAndDistance = function(id, distance){
		for (var i=0; i<this.cars.length; i++){
			if (this.cars[i].id == id && this.cars[i].distance == distance)
				return this.cars[i];
		}
		return false;
	}
	
	this.getDistancesByCar = function(carId){
		distances = new Array();
		car = this.getCarById(carId);
		for (var i=0; i<this.cars.length; i++){
			if (this.cars[i].car_type_id == car.car_type_id)
				distances.push(this.cars[i].distance);
		}
		return distances;
	}
	
	this.getLowestPriceForThisFilter = function(){
		lowest = init_val = 1000000000;
		cars = this.getCarsByFilter();
		
		for (var i=0; i<cars.length; i++){
			if (cars[i].price<lowest)
				lowest = cars[i].price;
		}
		
		
		if (lowest == init_val)
			return -1;
		else
			return lowest;
	}
}

var carselector = new Carselector();

// CONTROLLER
carselector.controller.setClassName = function(classname, update_view){
	this.model.classname = classname;
	this.setCarId(false, false);
	
	if (update_view)
		this.model.view.update_all();
}

carselector.controller.setCarId = function(car_id, update_view){
	this.model.carId = car_id;
	this.setDistance(-1, false);
	
	if (update_view)
		this.model.view.update_all();
}	

carselector.controller.setDistance = function(distance, update_view){
	this.model.distance = distance;
	
	if (update_view){
		this.model.view.update_all();
	}
}

// VIEW
carselector.view.viewstate = new Object();
carselector.view.viewstate.view = carselector.view;
carselector.view.viewstate.car_selector_open = false;
carselector.view.viewstate.distance_selector_open = false;
carselector.view.viewstate.car_selected_default_html = false;

// Update alle onderdelen van de view
carselector.view.update_all = function(){

	this.update_class_selector();
	this.update_car_selector();
	this.update_car_selector_options();
	this.update_distance_selector();
	this.update_distance_selector_options();
	
	this.update_car_selected_view();
	this.update_arrow();
}

// update de class-selector
carselector.view.update_class_selector = function(){
	
	if (!this.model.classname){
		// geen klasse geselecteerd
		document.getElementById('selectClass').className = '';
		document.getElementById('selectClass').childNodes[0].innerHTML = '1. Kies een klasse';
	}
	else{
		// een klasse geselecteerd
		document.getElementById('selectClass').className = 'done';
		tr = __translate('DATASELECTED');
		// Klasse N geselecteerd:
		document.getElementById('selectClass').childNodes[0].innerHTML = '1. ' + tr.replace(/\*/, __translate('CLASS') + ' ' + this.model.classname.toUpperCase());
		//Klasse ' + this.model.classname.toUpperCase() + ' geselecteerd';
	}
	
}

// update de car-selector
carselector.view.update_car_selector = function(){

	if (!this.model.carId){
		// geen auto geselecteerd
		document.getElementById('selectCar').className = this.viewstate.car_selector_open?'select-menu':'';
		document.getElementById('selectCar').childNodes[0].innerHTML = '2. Kies een auto';
	}
	else{
		// auto geselecteerd
		car = this.model.getCarById(this.model.carId);
		document.getElementById('selectCar').className = this.viewstate.car_selector_open?'select-menu done':'done';
		tr = __translate('DATASELECTED');

		// AUDI A4 geselecteerd:
		document.getElementById('selectCar').childNodes[0].innerHTML = '2. ' + tr.replace(/\*/, car.toShortString());
		//document.getElementById('selectCar').childNodes[0].innerHTML = '2. ' + car.toShortString() + ' geselecteerd';
	}

}

// update de opties die je ziet als je op de car-selector klikt (dropdown)
carselector.view.update_car_selector_options = function(){

	cars = this.model.getCarsByClassFilter(new Array('classname'));
	// todo: sorteren!
	var html = '';
	for (var i=0; i<cars.length; i++){
		html += '<li><a href="javascript: carselector.controller.setCarId(' + cars[i].id + ', true); carselector.view.viewstate.toggle_car_selector(-2);">' + cars[i] + '</a></li>';
	}
	
	document.getElementById('select-car-ul').innerHTML = html;
	
}

carselector.view.update_distance_selector = function(){
	if (this.model.distance==-1){
		// geen auto geselecteerd
		document.getElementById('selectDistance').className = this.viewstate.car_selector_open?'select-menu last-item':'last-item';
		document.getElementById('selectDistance').childNodes[0].innerHTML = '3. Kies het aantal kilometers';
	}
	else{
		// auto geselecteerd
		document.getElementById('selectDistance').className = this.viewstate.car_selector_open?'select-menu done last-item':'done last-item';
		tr = __translate('DATASELECTED');
		document.getElementById('selectDistance').childNodes[0].innerHTML = '3. ' + tr.replace(/\*/, this.model.distance + ' km');
	}
}

carselector.view.update_distance_selector_options = function(){

	distances = this.model.getDistancesByCar(this.model.carId);
	distances.sortInt();
	
	// todo: sorteren!
	var html = '';
	
	for (var i=0; i<distances.length; i++){
		html += '<li><a href="javascript: carselector.controller.setDistance(' + distances[i] + ', true); carselector.view.viewstate.toggle_distance_selector(-2);">' + distances[i] + ' km</a></li>';
	}

	document.getElementById('select-distance-ul').innerHTML = html;
}

// update het resultaat dat je ziet als je een auto hebt geselecteerd (kolom 2 van de html)
carselector.view.update_car_selected_view = function(){

	element = document.getElementById('carselectorresult');
	if (!this.viewstate.car_selected_default_html) 
		this.viewstate.car_selected_default_html = element.innerHTML;
		
	if (show_result_on=='car_select'){
		if (this.model.carId)
			show = true;
		else
			show = false;
	}
	else
		if (this.model.distance!=-1)
			show = true;
		else
			show = false;

	if (show){
		car = this.model.getCarByIdAndDistance(this.model.carId, this.model.distance);
		html = '<div class="img-result">';
		if (car.avail_any)
			html += '<img src="images/globals/' + ml_language + '_beschikbaar.png" alt="' + __translate('TTT_DIRECTBESCH') + '" id="car-status-image" class="status" />';
		html += '<dl>';
		html += '<dt>' + car + '</dt>';
		if (this.model.distance==-1)
			html += '<dd>vanaf <strong>&euro; ' + this.model.getLowestPriceForThisFilter() + ',-</strong> (p/mnd)</dd>';
		else{
		
			if (car.price_diesel && car.price_benzine){
				html += '<dd>';
				html += '<dd>';
				html += __translate('BENZINE') + ':';
				html += '<strong>vanaf &euro; ' + car.price_benzine + ',-</strong>';
				html += '(p/mnd)';
				html += '</dd>';
				html += '<dd>';
				html += '<dd>';
				html += '<span class="set-space">' + __translate('DIESEL') + ':</span>';
				html += '<strong>vanaf &euro; ' + car.price_diesel + ',-</strong>';
				html += '(p/mnd)';
				html += '</dd>';
			}
			else{
				html += '<dd><strong>&euro; ' + this.model.getLowestPriceForThisFilter() + ',-</strong> ' + __translate('PER_MONTH') + '</dd>';
			}
		}
		html += '</dl>';
		html += '<img src="' + car.image + '" alt="' + car + '" />';
		html += '</div>';
		

		html += '<a href="' + offerte_url + car.id + ',' + this.model.distance + '/" class="offerte">' +__translate('REQUEST_TENDER')+ '</a>';
		
		if (contact_url.substring(contact_url.length-1) == '=')
			extra = car.id + '&km=' + car.distance;
		else
			extra = '';
			
		html += '<span class="contact-link"><a href="' + contact_url + extra + '">'+__translate('CONTACT_US')+'</a></span>';
		element.innerHTML = html;
		
		//document.getElementById('car-status-image').
		$('img[@src$=.png]').ifixpng(); 
	}
	else{
		html = this.viewstate.car_selected_default_html;
		element.innerHTML = html;
	}
	
	

}

carselector.view.update_arrow = function(){

	if (this.model.carId && this.model.distance!=-1)
		document.getElementById('show-result').style.display = v = 'block';
	else
		document.getElementById('show-result').style.display = v = 'none';

}

// toggle het open en dicht gaan van de car-selector dropdown
carselector.view.viewstate.toggle_car_selector = function(value){
	switch (value){
		case -1: this.car_selector_open = true; break;
		case -2: this.car_selector_open = false; break;
		default: this.car_selector_open = !this.car_selector_open; break;
	}
	
	toggleDiv('select-car', this.car_selector_open?-1:-2);
	this.view.update_car_selector();
	//document.getElementById('selectCar').className = this.car_selector_open?'select-menu':'';
}

carselector.view.viewstate.toggle_distance_selector = function(value){
	switch (value){
		case -1: this.distance_selector_open = true; break;
		case -2: this.distance_selector_open = false; break;
		default: this.distance_selector_open = !this.distance_selector_open; break;
	}
	
	toggleDiv('select-km', this.distance_selector_open?-1:-2);
	this.view.update_distance_selector();
	//document.getElementById('selectCar').className = this.car_selector_open?'select-menu':'';
}

carselector.view.hideGreyBox = function(){
	GB_hide();
}

/*
window.onload =function(){
	carselector.controller.setClassName('B', !true);
	carselector.controller.setCarId(7, !true);
	carselector.controller.setDistance(500, !true);
	carselector.view.update_all();
}
//*/








// DATA
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 35000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 45000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 25000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 40000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 50000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 30000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 45000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 25000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 35000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 50000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(1, "Citroen", "C1", 350, 30000, "A", 1, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/17(1)_245x245_245x245.jpg"));
carselector.cars.push(new Car(2, "Toyota", "Aygo", 350, 40000, "A", 2, true, true, true, 350, 0, "http://www.myshortlease.nl/cache/cars/18_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 50000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 30000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 40000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 35000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 45000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 25000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 40000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 50000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 30000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 45000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(3, "Opel", "Corsa", 415, 25000, "B", 3, true, true, true, 415, 550, "http://www.myshortlease.nl/cache/cars/opel_corsa_245x245.jpg"));
carselector.cars.push(new Car(18, "Volkswagen", "Polo bluemotion", 415, 35000, "B", 18, false, false, false, 415, 550, "http://www.myshortlease.nl/cache/cars/polo_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 30000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 45000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 25000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 35000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 50000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 30000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 40000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 35000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 45000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 25000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(6, "Opel", "Astra", 605, 40000, "C", 6, true, true, true, 605, 725, "http://www.myshortlease.nl/cache/cars/opel_astra_245x245.jpg"));
carselector.cars.push(new Car(7, "Volkswagen", "Golf", 605, 50000, "C", 7, false, false, false, 605, 725, "http://www.myshortlease.nl/cache/cars/22_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 45000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 25000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 40000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 50000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 30000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 45000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 25000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 35000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 50000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 30000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(9, "Ford", "Focus wagon", 625, 40000, "D", 9, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/ford_focus_wagon(2)_245x245.jpg"));
carselector.cars.push(new Car(8, "Opel", "Astra Station", 625, 35000, "D", 8, false, false, false, 625, 745, "http://www.myshortlease.nl/cache/cars/opel_astra_stationwagen_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 25000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 35000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 45000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 50000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 30000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 40000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 45000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 25000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 35000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 40000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 50000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 30000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 35000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 45000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 25000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(12, "Ford", "Focus C-Max", 710, 30000, "E", 12, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/ford_c-max_245x245.jpg"));
carselector.cars.push(new Car(11, "Volkswagen", "Touran", 710, 40000, "E", 11, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/volkswagen_touran_245x245.jpg"));
carselector.cars.push(new Car(10, "Opel", "Zafira", 710, 50000, "E", 10, false, false, false, 710, 0, "http://www.myshortlease.nl/cache/cars/opel_zafira_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 35000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 45000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 30000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 40000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 25000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(5, "Honda", "Hybrid", 645, 50000, "Hybride", 5, false, false, false, 645, 0, "http://www.myshortlease.nl/cache/cars/honda_civic_hybrid_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 25000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 40000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 50000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 30000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 45000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 25000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 35000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 50000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 30000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 40000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(14, "Citroen", "Berlingo", 415, 35000, "S", 14, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/berlingo_big_245x245.jpg"));
carselector.cars.push(new Car(15, "Peugeot", "Bipper", 415, 45000, "S", 15, true, true, true, 0, 415, "http://www.myshortlease.nl/cache/cars/bipper_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 35000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 45000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 30000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 40000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 25000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
carselector.cars.push(new Car(17, "Opel", "Vivaro", 649, 50000, "M", 17, true, true, true, 0, 649, "http://www.myshortlease.nl/cache/cars/opel_vivaro_niot.net_(2)_245x245.jpg"));
