// JavaScript Document

function updateInfo(mid) {
	
	if (ajax) {
		
		ajax.open('get','dropMenu.php?cid=' + encodeURIComponent(mid));
		
		ajax.onreadystatechange = handle_info;
		
		ajax.send(null);
		
		return false;
	
	} else {
		
		return true;
	
	}	
}
function updateInfo2(mid) {
	
	if (ajax) {
		
		ajax.open('get','dropMenu.php?lid=' + encodeURIComponent(mid));
		
		ajax.onreadystatechange = handle_info2;
		
		ajax.send(null);
		
		return false;
	
	} else {
		
		return true;
	
	}	
}

function handle_info() {
	
	if ((ajax.readyState == 4) && (ajax.status == 200)) {
		
		if (ajax.responseText.length > 10) {
			
			display_info(eval('(' + ajax.responseText + ')'));
			
		}
	}
}
function handle_info2() {
	
	if ((ajax.readyState == 4) && (ajax.status == 200)) {
		
		if (ajax.responseText.length > 10) {
			
			display_info2(eval('(' + ajax.responseText + ')'));
			
		}
	}
}

function display_info(info) {
	
	document.search1.langID.options.length = 0;
	
	document.search1.langID.options[0] = new Option("Select a Language",0);
	
	for (var i = 0; i < info.length; i++) {
		
		
		document.search1.langID.options[i+1] = new Option(info[i].modeldesc,info[i].modelid);
		
		
	}
	
}
function display_info2(info) {
	
	document.search2.country2.options.length = 0;
	
	document.search2.country2.options[0] = new Option("Select a Country",0);
	
	for (var i = 0; i < info.length; i++) {
		
		
		document.search2.country2.options[i+1] = new Option(info[i].modeldesc,info[i].modelid);
		
		
	}
	
}

