/* DropDown sorter
** A DropDownObj lehullomenu elemeit rendezi abc szerint novekvo sorrendbe. DropDownfirstoption az elso rendezendo elem, az elotte levoket figyelmen kivul hagyja.
*/

function DropDownSelectSort(DropDownObj,DropDownfirstoption){
	DropDownobj=DropDownObj;
	DropDownAry=new Array();
	for (DropDown0=DropDownfirstoption;DropDown0<DropDownobj.options.length;DropDown0++){
		DropDownAry[DropDown0-DropDownfirstoption]=DropDownobj.options[DropDown0];
	}
	DropDownAry=DropDownAry.sort(DropDownOptionSort);
	for (DropDown1=0;DropDown1<DropDownAry.length;DropDown1++){
		DropDownobj.options[DropDown1+DropDownfirstoption]=new Option(DropDownAry[DropDown1].text,DropDownAry[DropDown1].value,true,true);
	}
	DropDownobj.selectedIndex=0;
}

function DropDownOptionSort(DropDowna,DropDownb){
	DropDownA=DropDowna.text.toLowerCase();
	DropDownB=DropDownb.text.toLowerCase();
	if (DropDownA<DropDownB){ return -1; }
	if (DropDownA>DropDownB){ return 1; }
	return 0;
}

