function active_layout_swf () {

	var so = new SWFObject("template/lecarweb/swf/Logo.swf", "Logo", "200", "165", "9", "#FFF");
	so.addParam("menu","false"); so.addParam("wmode","opaque"); so.addParam("detectflash","false");
	so.write("topscud");

	var so = new SWFObject("template/lecarweb/swf/Welcome.swf", "Welcome", "570", "235", "9", "#FFF");
	so.addParam("menu","false"); so.addParam("wmode","opaque"); so.addParam("detectflash","false");
	so.write("welcome");

}

ELO.functionsToCallOnload.push('active_layout_swf()');

function erase_select ( select ) { var option = document.createElement('option'); option.setAttribute('value', ''); option.appendChild(document.createTextNode(' ')); select.innerHTML = ''; select.appendChild(option); }
function activ_select ( select ) { select.disabled = false; }

function give_categories () { new Ajax('/modules/conc/inquiry-xml.do?wp_conc_inquiry=SEARCH_CATEGORIES', {method: 'GET', callback: put__categories}); }
function put__categories ( xml ) {

	var category = document.getElementById('category'),
					list_categories = xml.responseXML.getElementsByTagName('VEHICLES').item(0).getElementsByTagName('CATEGORY');

	erase_select(category);
	if (list_categories.length) activ_select(category);

	for (var i = 0; i != list_categories.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', list_categories.item(i).firstChild.data);
		option.appendChild(document.createTextNode(list_categories.item(i).firstChild.data));
		category.appendChild(option);

	}

}

ELO.functionsToCallOnload.push('give_categories()');

function give_brands ( category ) { new Ajax('/modules/conc/inquiry-xml.do?wp_conc_inquiry=SEARCH_BRANDS&wp_conc_category=' + category, {method: 'GET', callback: put__brands}); }
function put__brands ( xml ) {

	var brand = document.getElementById('brand'),
					list_brands = xml.responseXML.getElementsByTagName('VEHICLES').item(0).getElementsByTagName('BRAND');

	erase_select(brand);
	if (list_brands.length) activ_select(brand);

	for (var i = 0; i != list_brands.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', list_brands.item(i).firstChild.data);
		option.appendChild(document.createTextNode(list_brands.item(i).firstChild.data));
		brand.appendChild(option);

	}

}

function give_remainder ( brand ) { var category = document.getElementById('category'); new Ajax('/modules/conc/inquiry-xml.do?wp_conc_inquiry=SEARCH_INFOS&wp_conc_category=' + category.value + '&wp_conc_brand=' + brand, {method: 'GET', callback: put__remainder}); }
function put__remainder ( xml ) {

	var model = document.getElementById('model'),
					matriculation = document.getElementById('matriculation'),
					feed = document.getElementById('feed'),
					price = document.getElementById('price'),
					list_infos = xml.responseXML.getElementsByTagName('VEHICLES').item(0);

	erase_select(model);
	var items = list_infos.getElementsByTagName('MODELS').item(0).getElementsByTagName('MODEL');
	if (items.length) activ_select(model);
	for (var i = 0; i != items.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', items.item(i).firstChild.data);
		option.appendChild(document.createTextNode(items.item(i).firstChild.data));
		model.appendChild(option);

	}

	erase_select(matriculation);
	var items = list_infos.getElementsByTagName('MATRICULATIONS').item(0).getElementsByTagName('MATRICULATION');
	if (items.length) activ_select(matriculation);
	for (var i = 0; i != items.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', items.item(i).firstChild.data);
		option.appendChild(document.createTextNode(items.item(i).firstChild.data));
		matriculation.appendChild(option);

	}

	erase_select(feed);
	var items = list_infos.getElementsByTagName('FEEDS').item(0).getElementsByTagName('FEED');
	if (items.length) activ_select(feed);
	for (var i = 0; i != items.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', items.item(i).firstChild.data);
		option.appendChild(document.createTextNode(items.item(i).firstChild.data));
		feed.appendChild(option);

	}

	erase_select(price);
	var items = list_infos.getElementsByTagName('PRICES').item(0).getElementsByTagName('PRICE');
	if (items.length) activ_select(price);
	for (var i = 0; i != items.length; i++) {

		var option = document.createElement('option');
		option.setAttribute('value', (i + 1));
		option.appendChild(document.createTextNode(items.item(i).firstChild.data));
		price.appendChild(option);

	}

}