
function FillLists(SelectValue)
{
	var Lst = document.getElementById("Drp1");
	for(var i=0; i<MainArrayData.length; i++)
	{
		Lst.options[Lst.options.length] = new Option(MainArrayData[i][1], MainArrayData[i][0]);
	}
	if(SelectValue)
	{
		SelectValue = SelectValue.toString().toLowerCase();
		for(var i=0; i<Lst.options.length; i++)
		{			
			if(Lst.options[i].value.toString().toLowerCase() == SelectValue)
			{
				Lst.options[i].selected = true;
				break;
			}
		}
	}
}

function FillList(ModelID, SelectValue)
{	

	var ManLst = document.getElementById("Drp1");
	var ManID = ManLst.options[ManLst.selectedIndex].value;
	var Lst = document.getElementById(ModelID);
	var ModelArray;	
	eval("ModelArray = SubArray_" + ManID)	
	for(var i=Lst.options.length-1; i>-1; i--)
	{
		Lst.options[i] = null;
	}
	for(var i=0; i<ModelArray.length; i++)
	{		
		Lst.options[Lst.options.length] = new Option(ModelArray[i][1], ModelArray[i][0]);
	}	
	if(SelectValue)
	{
		SelectValue = SelectValue.toString().toLowerCase();
		for(var i=0; i<Lst.options.length; i++)
		{			
			if(Lst.options[i].value.toString().toLowerCase() == SelectValue)
			{
				Lst.options[i].selected = true;
				break;
			}
		}
	}	
}

function GetManufacturerName(ManID)
{
	if(ManID)
	{
		ManID = ManID.toString();
		for(var i=0; i<MainArrayData.length; i++)
		{
			if(MainArrayData[i][0].toString() == ManID){return MainArrayData[i][1];}
		}
		MainArrayData[0][1];
	}
	else{return MainArrayData[0][1];}
}