
function CarSelectorControl()
{
	
	var update = function( brandId, modelId, year )
	{
		$.get( 'ajax/get-car-selector-control', 
				{ brand: brandId, model: modelId, year: year }, 
				function( result ) {
					var container = $('#carSelectorControl:first');
					
					container.html(result);
				});
	};

	// init
	var init = function( brand, model, year  ) {
		update( brand, model, year );
	};
	
	// export public functions
	return ({
		update: update,
		//loadCarList: loadCarList,
		init: init
	});
}


function CarDetailControl(carid, level)
{
	$.get( 'ajax/details', 
		{ carid: carid, level: level }, 
		function(result){ 
			var listContainer = $('#carDetailControl');
			listContainer.html(result);
		 	listContainer.slideDown( 'slow' );
			}
		);
}
function CloseCarDetailControl()
{
	var listContainer = $('#carDetailControl');
	listContainer.html('');
 	listContainer.slideUp( 'slow' );
}


function AmsToPublicAds (id, uid, ucarid, carid,portalid)
{
alert ('Ihre Anzeigedaten werden an auto motor und sport weitergeleitet');
	$.get( 'ajax/write-public-ads', 
		{ id:id, uid: uid, ucarid: ucarid, carid: carid, portalid:portalid },
		function(result){
		//	alert(result);
			
			location.href = "/my/buy-and-sell/";
		}	
		);
}





