/********************************
* © Copyright 2005 Richard Heyes
*********************************/

/**
* Global vars
*/
__AutoComplete = new Array();

// Basic UA detection
isIE = document.all ? true : false;
isGecko = navigator.userAgent.toLowerCase().indexOf('gecko') != -1;
isOpera = navigator.userAgent.toLowerCase().indexOf('opera') != -1;


/**
* Attachs the autocomplete object to a form element. Sets
* onkeypress event on the form element.
* 
* @param string formElement Name of form element to attach to
* @param array  data        Array of strings of which to use as the autocomplete data
*/
function AutoComplete_Create (id, data)
{
	__AutoComplete[id] = {'data':data,
						  'isVisible':false,
						  'element':document.getElementById(id),
						  'dropdown':null,
						  'highlighted':null};

	__AutoComplete[id]['element'].setAttribute('autocomplete', 'off');
	__AutoComplete[id]['element'].onkeydown  = function(e) {return AutoComplete_KeyDown(this.getAttribute('id'), e);}
	__AutoComplete[id]['element'].onkeyup    = function(e) {return AutoComplete_KeyUp(this.getAttribute('id'), e);}
	__AutoComplete[id]['element'].onkeypress = function(e) {if (!e) e = window.event; if (e.keyCode == 13 || isOpera) return false;}
	__AutoComplete[id]['element'].ondblclick = function() {AutoComplete_ShowDropdown(this.getAttribute('id'));}
	__AutoComplete[id]['element'].onclick    = function(e) {if (!e) e = window.event; e.cancelBubble = true; e.returnValue = false;}

	// Hides the dropdowns when document clicked
	var docClick = function()
	{
	   for (id in __AutoComplete) {
		   AutoComplete_HideDropdown(id);
	   }
	}

	if (document.addEventListener) {
		document.addEventListener('click', docClick, false);
	} else if (document.attachEvent) {
		document.attachEvent('onclick', docClick, false);
	}


	// Max number of items shown at once
	if (arguments[2] != null) {
		__AutoComplete[id]['maxitems'] = arguments[2];
		__AutoComplete[id]['firstItemShowing'] = 0;
		__AutoComplete[id]['lastItemShowing']  = arguments[2] - 1;
	}
	
	AutoComplete_CreateDropdown(id);
	
	// Prevent select dropdowns showing thru
	if (isIE) {
		__AutoComplete[id]['iframe'] = document.createElement('iframe');
		__AutoComplete[id]['iframe'].id = id +'_iframe';
		__AutoComplete[id]['iframe'].style.position = 'absolute';
		__AutoComplete[id]['iframe'].style.top = '0';
		__AutoComplete[id]['iframe'].style.left = '0';
		__AutoComplete[id]['iframe'].style.width = '0px';
		__AutoComplete[id]['iframe'].style.height = '0px';
		__AutoComplete[id]['iframe'].style.zIndex = '98';
		__AutoComplete[id]['iframe'].style.visibility = 'hidden';
		__AutoComplete[id]['element'].parentNode.insertBefore(__AutoComplete[id]['iframe'], __AutoComplete[id]['element']);
	}
}


/**
* Creates the dropdown layer
* 
* @param string id The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_CreateDropdown(id)
{
	var left  = AutoComplete_GetLeft(__AutoComplete[id]['element']);
	var top   = AutoComplete_GetTop(__AutoComplete[id]['element']) + __AutoComplete[id]['element'].offsetHeight;
	var width = __AutoComplete[id]['element'].offsetWidth;

	__AutoComplete[id]['dropdown'] = document.createElement('div');
	__AutoComplete[id]['dropdown'].className = 'autocomplete'; // Don't use setAttribute()

	__AutoComplete[id]['element'].parentNode.insertBefore(__AutoComplete[id]['dropdown'], __AutoComplete[id]['element']);
	
	// Position it
	__AutoComplete[id]['dropdown'].style.left       = left + 'px';
	__AutoComplete[id]['dropdown'].style.top        = top + 'px';
	__AutoComplete[id]['dropdown'].style.width      = width + 'px';
	__AutoComplete[id]['dropdown'].style.zIndex     = '99';
	__AutoComplete[id]['dropdown'].style.visibility = 'hidden';
}


/**
* Gets left coord of given element
* 
* @param object element The element to get the left coord for
*/
function AutoComplete_GetLeft(element)
{
	var curNode = element;
	var left    = 0;

	do {
		left += curNode.offsetLeft;
		curNode = curNode.offsetParent;

	} while(curNode.tagName.toLowerCase() != 'body');

	return left;
}


/**
* Gets top coord of given element
* 
* @param object element The element to get the top coord for
*/
function AutoComplete_GetTop(element)
{
	var curNode = element;
	var top    = 0;

	do {
		top += curNode.offsetTop;
		curNode = curNode.offsetParent;

	} while(curNode.tagName.toLowerCase() != 'body');

	return top;
}


/**
* Shows the dropdown layer
* 
* @param string id The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_ShowDropdown(id)
{

	AutoComplete_HideAll();

	var value = __AutoComplete[id]['element'].value;
	var toDisplay = new Array();
	var newDiv    = null;
	var text      = null;
	var numItems  = __AutoComplete[id]['dropdown'].childNodes.length;

	// Remove all child nodes from dropdown
	while (__AutoComplete[id]['dropdown'].childNodes.length > 0) {
		__AutoComplete[id]['dropdown'].removeChild(__AutoComplete[id]['dropdown'].childNodes[0]);
	}

	// Go thru data searching for matches
	for (i=0; i<__AutoComplete[id]['data'].length; ++i) {
		if (__AutoComplete[id]['data'][i].substr(0, value.length) == value) {
			toDisplay[toDisplay.length] = __AutoComplete[id]['data'][i];
		}
	}
	
	// No matches?
	if (toDisplay.length == 0) {
		AutoComplete_HideDropdown(id);
		return;
	}



	// Add data to the dropdown layer
	for (i=0; i<toDisplay.length; ++i) {
		newDiv = document.createElement('div');
		newDiv.className = 'autocomplete_item'; // Don't use setAttribute()
		newDiv.setAttribute('id', 'autocomplete_item_' + i);
		newDiv.setAttribute('index', i);
		newDiv.style.zIndex = '99';
		
		 // Scrollbars are on display ?
		if (toDisplay.length > __AutoComplete[id]['maxitems'] && navigator.userAgent.indexOf('MSIE') == -1) {
			newDiv.style.width = __AutoComplete[id]['element'].offsetWidth - 22 + 'px';
		}

		newDiv.onmouseover = function() {AutoComplete_HighlightItem(__AutoComplete[id]['element'].getAttribute('id'), this.getAttribute('index'));};
		newDiv.onclick     = function() {AutoComplete_SetValue(__AutoComplete[id]['element'].getAttribute('id')); AutoComplete_HideDropdown(__AutoComplete[id]['element'].getAttribute('id'));}
		
		text   = document.createTextNode(toDisplay[i]);
		newDiv.appendChild(text);
		
		__AutoComplete[id]['dropdown'].appendChild(newDiv);
	}
	
	
	// Too many items?
	if (toDisplay.length > __AutoComplete[id]['maxitems']) {
		__AutoComplete[id]['dropdown'].style.height = (__AutoComplete[id]['maxitems'] * 15) + 2 + 'px';
	
	} else {
		__AutoComplete[id]['dropdown'].style.height = '';
	}

	
	/**
	* Set left/top in case of document movement/scroll/window resize etc
	*/
	__AutoComplete[id]['dropdown'].style.left = AutoComplete_GetLeft(__AutoComplete[id]['element']);
	__AutoComplete[id]['dropdown'].style.top  = AutoComplete_GetTop(__AutoComplete[id]['element']) + __AutoComplete[id]['element'].offsetHeight;


	// Show the iframe for IE
	if (isIE) {
		__AutoComplete[id]['iframe'].style.top    = __AutoComplete[id]['dropdown'].style.top;
		__AutoComplete[id]['iframe'].style.left   = __AutoComplete[id]['dropdown'].style.left;
		__AutoComplete[id]['iframe'].style.width  = __AutoComplete[id]['dropdown'].offsetWidth;
		__AutoComplete[id]['iframe'].style.height = __AutoComplete[id]['dropdown'].offsetHeight;
		
		__AutoComplete[id]['iframe'].style.visibility = 'visible';
	}


	// Show dropdown
	if (!__AutoComplete[id]['isVisible']) {
		__AutoComplete[id]['dropdown'].style.visibility = 'visible';
		__AutoComplete[id]['isVisible'] = true;
	}

	
	// If now showing less items than before, reset the highlighted value
	if (__AutoComplete[id]['dropdown'].childNodes.length != numItems) {
		__AutoComplete[id]['highlighted'] = null;
	}
}


/**
* Hides the dropdown layer
* 
* @param string id The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_HideDropdown(id)
{
	if (__AutoComplete[id]['iframe']) {
		__AutoComplete[id]['iframe'].style.visibility = 'hidden';
	}


	__AutoComplete[id]['dropdown'].style.visibility = 'hidden';
	__AutoComplete[id]['highlighted'] = null;
	__AutoComplete[id]['isVisible']   = false;
}


/**
* Hides all dropdowns
*/
function AutoComplete_HideAll()
{
	for (id in __AutoComplete) {
		AutoComplete_HideDropdown(id);
	}
}


/**
* Highlights a specific item
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
* @param int    index The index of the element in the dropdown to highlight
*/
function AutoComplete_HighlightItem(id, index)
{
	if (__AutoComplete[id]['dropdown'].childNodes[index]) {
		for (var i=0; i<__AutoComplete[id]['dropdown'].childNodes.length; ++i) {
			if (__AutoComplete[id]['dropdown'].childNodes[i].className == 'autocomplete_item_highlighted') {
				__AutoComplete[id]['dropdown'].childNodes[i].className = 'autocomplete_item';
			}
		}
		
		__AutoComplete[id]['dropdown'].childNodes[index].className = 'autocomplete_item_highlighted';
		__AutoComplete[id]['highlighted'] = index;
	}
}


/**
* Highlights the menu item with the given index
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
* @param int    index The index of the element in the dropdown to highlight
*/
function AutoComplete_Highlight(id, index)
{
	// Out of bounds checking
	if (index == 1 && __AutoComplete[id]['highlighted'] == __AutoComplete[id]['dropdown'].childNodes.length - 1) {
		__AutoComplete[id]['dropdown'].childNodes[__AutoComplete[id]['highlighted']].className = 'autocomplete_item';
		__AutoComplete[id]['highlighted'] = null;
	
	} else if (index == -1 && __AutoComplete[id]['highlighted'] == 0) {
		__AutoComplete[id]['dropdown'].childNodes[0].className = 'autocomplete_item';
		__AutoComplete[id]['highlighted'] = __AutoComplete[id]['dropdown'].childNodes.length;
	}

	// Nothing highlighted at the moment
	if (__AutoComplete[id]['highlighted'] == null) {
		__AutoComplete[id]['dropdown'].childNodes[0].className = 'autocomplete_item_highlighted';
		__AutoComplete[id]['highlighted'] = 0;

	} else {
		if (__AutoComplete[id]['dropdown'].childNodes[__AutoComplete[id]['highlighted']]) {
			__AutoComplete[id]['dropdown'].childNodes[__AutoComplete[id]['highlighted']].className = 'autocomplete_item';
		}

		var newIndex = __AutoComplete[id]['highlighted'] + index;

		if (__AutoComplete[id]['dropdown'].childNodes[newIndex]) {
			__AutoComplete[id]['dropdown'].childNodes[newIndex].className = 'autocomplete_item_highlighted';
			
			__AutoComplete[id]['highlighted'] = newIndex;
		}
	}
}


/**
* Sets the input to a given value
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_SetValue(id)
{
	__AutoComplete[id]['element'].value = __AutoComplete[id]['dropdown'].childNodes[__AutoComplete[id]['highlighted']].innerHTML;
}


/**
* Checks if the dropdown needs scrolling
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_ScrollCheck(id)
{
	// Scroll down, or wrapping around from scroll up
	if (__AutoComplete[id]['highlighted'] > __AutoComplete[id]['lastItemShowing']) {
		__AutoComplete[id]['firstItemShowing'] = __AutoComplete[id]['highlighted'] - (__AutoComplete[id]['maxitems'] - 1);
		__AutoComplete[id]['lastItemShowing']  = __AutoComplete[id]['highlighted'];
	}
	
	// Scroll up, or wrapping around from scroll down
	if (__AutoComplete[id]['highlighted'] < __AutoComplete[id]['firstItemShowing']) {
		__AutoComplete[id]['firstItemShowing'] = __AutoComplete[id]['highlighted'];
		__AutoComplete[id]['lastItemShowing']  = __AutoComplete[id]['highlighted'] + (__AutoComplete[id]['maxitems'] - 1);
	}
	
	__AutoComplete[id]['dropdown'].scrollTop = __AutoComplete[id]['firstItemShowing'] * 15;
}


/**
* Function which handles the keypress event
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_KeyDown(id)
{
	// Mozilla
	if (arguments[1] != null) {
		event = arguments[1];
	}

	var keyCode = event.keyCode;

	switch (keyCode) {

		// Return/Enter
		case 13:
			if (__AutoComplete[id]['highlighted'] != null) {
				AutoComplete_SetValue(id);
				AutoComplete_HideDropdown(id);
			}
			
			event.returnValue = false;
			event.cancelBubble = true;
			break;

		// Escape
		case 27:
			AutoComplete_HideDropdown(id);
			event.returnValue = false;
			event.cancelBubble = true;
			break;
		
		// Up arrow
		case 38:
			if (!__AutoComplete[id]['isVisible']) {
				AutoComplete_ShowDropdown(id);
			}
			
			AutoComplete_Highlight(id, -1);
			AutoComplete_ScrollCheck(id, -1);
			return false;
			break;
		
		// Tab
		case 9:
			if (__AutoComplete[id]['isVisible']) {
				AutoComplete_HideDropdown(id);
			}
			return;
		
		// Down arrow
		case 40:
			if (!__AutoComplete[id]['isVisible']) {
				AutoComplete_ShowDropdown(id);
			}
			
			AutoComplete_Highlight(id, 1);
			AutoComplete_ScrollCheck(id, 1);
			return false;
			break;
	}
}


/**
* Function which handles the keyup event
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_KeyUp(id)
{
	// Mozilla
	if (arguments[1] != null) {
		event = arguments[1];
	}

	var keyCode = event.keyCode;

	switch (keyCode) {
		case 13:
			event.returnValue = false;
			event.cancelBubble = true;
			break;

		case 27:
			AutoComplete_HideDropdown(id);
			event.returnValue = false;
			event.cancelBubble = true;
			break;
		
		case 38:
		case 40:
			return false;
			break;

		default:
			AutoComplete_ShowDropdown(id);
			break;
	}
}

/**
* Returns whether the dropdown is visible
* 
* @param string id    The form elements id. Used to identify the correct dropdown.
*/
function AutoComplete_isVisible(id)
{
	return __AutoComplete[id]['dropdown'].style.visibility == 'visible';
}


/************************************************************************************
* © Temporary auto complete model lists : will change to become dynamic from database
*************************************************************************************/
function remoteModel(make) {
	if (make == '') {
		data = '';
		AutoComplete_Create('qck_model', data);
	}

    if (make == 1) {
		data = ['145','146','147','155','156','159','164','166','33','6','75','90','alfasud','alfetta','arna','brera','giulia','giulietta','gt','gtv','r.z.','s.z.','spider','sprint'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 2) {
		data = ['db7','db9','lagonda','v8','vanquish','vantage','virage','volante'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 3) {
		data = ['100','200','80','90','a2','a3','a4','a6','a8','cabriolet','coup\351','q7','quattro','rs4','rs6','s2','s3','s4','s6','s8','sport quattro','tt','v8'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 4) {
		data = ['arnage','azure','brooklands','continental','mulsanne','turbo r','turbo rt','turbo s'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 5) {
		data = ['116','118','120','130','2.0','2002','3.0','316','318','320','323','324','325','328','330','335','518','520','523','524','525','528','530','535','540','545','550','630','635','645','650','725','728','730','735','740','745','750','760','840','850','m','m1','m3','m5','x3','x5','z1','z3','z4','z8'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 6) {
		data = ['b10','b12','b3','b5','b6','b7','b8','d10','d3','roadster','z8'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 7) {
		data = ['allant\351','bls','catera','cts','deville','eldorado','escalade','fleetwood','seville','srx','sts','xlr'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 8) {
		data = ['alero','astro','aveo','beretta','blazer','c/k pickup','camaro','caprice','captiva','cavalier','celebrity','citation','corsica','corvette','epica','evanda','g-van','impala','kalos','lacetti','lumina','malibu','matiz','monte carlo','nubira','s/t pickup','s10','ssr','suburban','t-blazer','tacuma','tahoe','trailblazer','trans sport','venture'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 9) {
		data = ['300c','300m','crossfire','daytona shelby','es','grand voyager','gs','gts','le baron','neon','new yorker','pt','saratoga','sebring','stratus','valiant','viper','vision','voyager'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 10) {
		data = ['2cv6','ax','berlingo','bx','c1','c15','c154','c158','c159','c2','c25','c3','c35','c4','c5','c6','c8','cx','ds','evasion','gsa','jumper','jumpy','lna','saxo','visa','xantia','xm','xsara','zx'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 11) {
		data = ['applause','charade','charmant','copen','cuore','feroza','gran move','hi jet','move','rocky','sirion','taft','terios','yrv'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 12) {
		data = ['3.6 i','double six','six','sovereign','super eight','super v8','v8','vanden plas'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 13) {
		data = ['avenger','caliber','caravan','charger','dakota','durango','grand caravan','intrepid','magnum','ram','ram pickup','ram wagon','stealth','stratus','viper'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 14) {
		data = ['308','328','348','365','400','412','456','512','575','575m','612','dino','f355','f360','f40','f430','f50','f550','mondial','testarossa'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 15) {
		data = ['124 spider','126','127','130','131','132','242','500','argenta','barchetta','brava','bravo','cinquecento','coup\351','croma','dino','doblo','ducato','fiorino','idea','marea','multipla','palio','panda','punto','regata','ritmo','scudo','sedici','seicento','spider europa','stilo','strada','tempra','tipo','ulysse','uno','x 1/9'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 16) {
		data = ['briklin','capri','courier','escort','fiesta','focus','ft','fusion','galaxy','granada','ka','maverick','mercury','mondeo','orion','probe','puma','ranger','s-max','scorpio','sierra','streetka','taunus','tourneo','transit'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 17) {
		data = ['accord','ballade','civic','concerto','cr-v','crx','fr-v','hr-v','integra','jazz','joker','legend','logo','mdx','nsx','odyssey','prelude','quintet','s2000','shuttle','stream'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 18) {
		data = ['h2','h3'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 19) {
		data = ['accent','atos','coup\351','elantra','galloper','getz','grandeur','h 100','h-1','lantra','matrix','pony','santa fe','santamo','scoupe','sonata','starex','terracan','trajet','tucson','xg'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 20) {
		data = ['daimler','e','mk ii','mk x','s-type','sovereign','x-type','xj','xj 220','xj-s','xj12','xj40','xj6','xj8','xjr','xk','xk120','xk140','xk150','xk8','xk9','xkr'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 21) {
		data = ['cherokee','cj-5','cj-6','cj-7','cj-8','commander','grand cherokee','wagoneer','wrangler'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 22) {
		data = ['carens','carnival','cerato','clarus','k2500','leo','magentis','opirus','picanto','pregio','pride','rio','sephia','shuma','sorento','sportage'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 23) {
		data = ['110','111','112','1300','1500','1600','2110','2111','2112','kalina','niva','nova','samara'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 24) {
		data = ['countach','diablo','gallardo','jalpa','lm-002','murci\351lago'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 25) {
		data = ['a112','beta','dedra','delta','flavia','fulvia','gamma','hpe','junior','kappa','lybra','musa','phedra','prisma','thema','thesis','trevi','y','y10','z turbo','zeta'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 26) {
		data = ['109','110','88','90','defender','discovery','freelander','range rover'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 27) {
		data = ['gs 300','gs 430','gs 450h','is 200','is 220','is 250','is 300','ls 400','ls 430','rx 300','rx 350','rx 400','sc 400','sc 430'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 28) {
		data = ['elan','elise','esprit','europa','exige','super seven'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 29) {
		data = ['3200','biturbo','coup\351 gransport','coup\351 gt','ghibli','karif','mexico','quattroporte','shamal','spyder'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 30) {
		data = ['121','2','3','323','5','6','626','929','b 2500','demio','e','mpv','mx-3','mx-5','mx-6','premacy','rx-7','rx-8','tribute','xedos'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 31) {
		data = ['113','114','190','200','208','210','211','212','213','214','216','220','220 sb','230','240','250','260','280','300','310','311','312','313','314','316','320','350','380','400','410','411','412','413','414','416','420','430 ml','450','500','560','560 sl','600','611','612','616','a 140','a 150','a 160','a 170','a 180','a 190','a 200','a 210','b 150','b 170','b 180','b 200','c 180','c 200','c 220','c 230','c 240','c 250','c 270','c 280','c 30','c 32','c 320','c 350','c 36 amg','c 43 amg','c 55 amg','ce 300','cl','clk','cls','e 2.2 bus','e 200','e 220','e 230','e 240','e 250','e 270','e 280','e 290','e 300','e 320','e 350','e 36 amg','e 400','e 420','e 430','e 50','e 500','e 55 amg','e 63 amg','g','gl','ml 230','ml 270','ml 280','ml 320','ml 350','ml 400 cdi','ml 420','ml 430','ml 500','ml 55 amg','ml 63 amg','r 280','r 320','r 350','r 500','r 63 amg','s 280','s 300','s 320','s 350','s 400','s 420','s 430','s 500','s 55','s 600','s 65','sl 280','sl 300','sl 320','sl 350','sl 500','sl 55 amg','sl 600','sl 65 amg','slk','slr','sprinter','v 220','v 230','v 280','v van','vaneo','viano','vito'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 32) {
		data = ['1.3i','40th anniversary','cooper','mini','one'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 33) {
		data = ['3000 gt','canter','carisma','colt','cordia','eclipse','fuso','galant','galant f','galant ii','grandis','l200','l300','l400','lancer','outlander','pajero','sapporo','sapporo ii','sigma','sigma wagon','space gear','space runner','space star','space wagon','starion','tredia'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 34) {
		data = ['100 nx','200 sx','280 zx','300 zx','350 z','almera','atleon','bluebird','cabstar','cherry','double cab','interstar','king cab','kubistar','laurel','maxima','micra','murano','navara','note','pathfinder','patrol','prairie','primastar','primera','quest','serena','silvia','single cab','skyline','stanza','sunny','terrano','trade','urvan','vanette','x-trail'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 35) {
		data = ['agila','ascona','astra','calibra','campo','combo','commodore','corsa','diplomat','frontera','gt','kadett','manta','meriva','monterey','monza','movano','omega','rekord','senator','signum','sintra','speedster','tigra','vectra','vivaro','zafira'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 36) {
		data = ['1007','104','106','107','205','206','207','305','306','307','309','405','406','407','504','505','604','605','607','806','807','boxer','camper','expert','j5','partner'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 37) {
		data = ['356','911','924','928','944','968','boxster','carrera','cayenne','cayman'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 38) {
		data = ['aliz\351','alpine a310','alpine a610','alpine v6','avantime','clio','coupe','espace','express','fuego','grand espace','grand sc\351nic','kangoo','laguna','mascott','master','m\351gane','messenger','modus','nevada','r11','r14','r18','r19','r20','r21','r25','r30','r4','r5','r9','safrane','sc\351nic','spider','super 5','trafic','twingo','vel satis'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 39) {
		data = ['cloud','corniche','flying spur','park ward turbo','phantom','silver dawn','silver seraph','silver shadow','silver spirit','silver spur','silver wraith','touring'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 40) {
		data = ['03-sep','05-sep','9-7x awd','90','900','9000','99'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 41) {
		data = ['alhambra','altea','arosa','cordoba','ibiza','inca','leon','malaga','marbella','ronda','terra','toledo'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 42) {
		data = ['105','120','130','135','136','fabia','favorit','felicia','forman','octavia','superb'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 43) {
		data = ['forfour','fortwo','roadster'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 44) {
		data = ['korando','kyron','musso','rexton','rodius'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 45) {
		data = ['1.8','1600','1800','700','e10','e12','forester','impreza','justy','legacy','outback','svx','vivio','xt'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 46) {
		data = ['1.3','alto','baleno','grand vitara','ignis','jimny','liana','lj 80','sa 310','samurai','sj 410','sj 413','super carry','swift','sx4','vitara','wagon r+','x-90'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 47) {
		data = ['4-runner','avensis','aygo','camry','carina','celica','celica supra','corolla','cressida','crown','dyna','fzj','hdj','hiace','hilux','hzj75','kzj','land cruiser','lite-ace','model-f','mr2','paseo','picnic','previa','prius','rav-4','rj','sienna','starlet','supra','tercel','yaris','yr'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 48) {
		data = ['240','244','245','340','360','440','460','480','740','744','760','764','780','850','855','940','944','945','960','965','c30','c70','polar','s40','s60','s70','s80','s90','v40','v50','v70','v90','xc70','xc90'];
		AutoComplete_Create('qck_model',data);
	}
	if (make == 49) {
		data = ['21','23','anfibio','bora','bus','caddy','caravelle','corrado','crafter','crosspolo','eos','fox','golf','jetta','k\344fer','lt','lupo','multivan','new beetle','passat','phaeton','polo','porsche','scirocco','sharan','t4','t5','taro','touareg','touran','typ ii','vento'];
		AutoComplete_Create('qck_model',data);
	}
}
