<!-- 

			function trim(inputString) {
			   // Removes leading and trailing spaces from the passed string. Also removes
			   // consecutive spaces and replaces it with one space. If something besides
			   // a string is passed in (null, custom object, etc.) then return the input.

				if (typeof inputString != "string") { 
			   		return inputString; 
				}
				
				var retValue = inputString;
				var ch = retValue.substring(0, 1);

				while (ch == " ") { // Check for spaces at the beginning of the string
					retValue = retValue.substring(1, retValue.length);
					ch = retValue.substring(0, 1);
				}
				
				ch = retValue.substring(retValue.length-1, retValue.length);

				while (ch == " ") { // Check for spaces at the end of the string
					retValue = retValue.substring(0, retValue.length-1);
					ch = retValue.substring(retValue.length-1, retValue.length);
				}

				while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
					retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
				}
				
				return retValue; // Return the trimmed string back to the user
			} // Ends the "trim" function

			

	function Obj(Azon, Tipus, Kod, Nev)		{
		this.Azon = Azon;
		this.Tipus= Tipus;
		this.Kod  = Kod;
		this.Nev  = Nev;
	}

	function fn_Restore(focsop, alcsop)
	{
		var selectCount  = document.frmFLT.mgy.length;

		for (var i = 0; i < selectCount; i++) {
   			if (document.frmFLT.mgy.options[i].value==focsop)
			{
				document.frmFLT.mgy.options[i].selected = true;
				fn_ListaUrito(document.frmFLT.cty);
				fn_ListaFeltolto(document.frmFLT.cty, document.frmFLT.mgy.options[document.frmFLT.mgy.selectedIndex].value);
				break;
			}
	    }
					
		selectCount  = document.frmFLT.cty.length;
					
		for (var i = 0; i < selectCount; i++) {
			if (document.frmFLT.cty.options[i].value==alcsop)
			{
				document.frmFLT.cty.options[i].selected = true;
				break;
			}
		}
	}

	function fn_Kezd()
	{
		document.frmFLT.mgy.focus();

		fn_ListaUrito(document.frmFLT.mgy);
		fn_ListaUrito(document.frmFLT.cty);
			
		fn_ListaFeltolto(document.frmFLT.mgy,0);
	
		if(document.frmFLT.mgy.options[0]!=null)		{
			fn_ListaFeltolto(document.frmFLT.cty, document.frmFLT.mgy.options[0].value);
		}
	}

	function fn_ListaUrito(Lista)
	{
		for (i = Lista.options.length; i != 0; i--) {
			Lista.options[i - 1] = null;
		}
	}


	function fn_ListaFeltolto(Lista, Szulo)
	{
		if(Lista.name=="mgy" || Lista.name=="cbMGY") 	{
			for (i = 0; i < Megye.length; i++) {
				eval("Lista.options[i] = new Option('" + Megye[i].Nev + "')");
				eval("Lista.options[i].value = '" + Megye[i].Kod + "'");
			}
		}

		if(Lista.name=="cty" || Lista.name=="cbCTY")	{
			j=0;

			if (Szulo!=0){
				eval("Lista.options[j] = new Option('" + Varos[0].Nev + "')");
				eval("Lista.options[j].value = ''");
				j=1;
			}
			for (i = 0; i < Varos.length; i++) {
				if(Varos[i].Tipus==Szulo){
					eval("Lista.options[j] = new Option('" + Varos[i].Nev + "')");
					eval("Lista.options[j].value = '" + Varos[i].Kod + "'");
					j++;
				}
			}
		}	
			
		Lista.selectedIndex=0;
	}

	function fn_Change(){
		fn_ListaUrito(document.frmFLT.cty);

		if(document.frmFLT.mgy.options[0]!=null)	{
			fn_ListaFeltolto(document.frmFLT.cty, document.frmFLT.mgy.value);
		}
	}



/***************************************************************************************************************************/


	function fn_RestoreS(focsop, alcsop)
	{
		var selectCount  = document.frmSRC.cbMGY.length;

		for (var i = 0; i < selectCount; i++) {
   			if (document.frmSRC.cbMGY.options[i].value==focsop)
			{
				document.frmSRC.cbMGY.options[i].selected = true;
				fn_ListaUrito(document.frmSRC.cbCTY);
				fn_ListaFeltolto(document.frmSRC.cbCTY, document.frmSRC.cbMGY.options[document.frmSRC.cbMGY.selectedIndex].value);
				break;
			}
	    }
					
		selectCount  = document.frmSRC.cbCTY.length;
					
		for (var i = 0; i < selectCount; i++) {
			if (document.frmSRC.cbCTY.options[i].value==alcsop)
			{
				document.frmSRC.cbCTY.options[i].selected = true;
				break;
			}
		}
	}


	function fn_KezdS()
	{
		document.frmSRC.cbMGY.focus();

		fn_ListaUrito(document.frmSRC.cbMGY);
		fn_ListaUrito(document.frmSRC.cbCTY);
			
		fn_ListaFeltolto(document.frmSRC.cbMGY,0);
	
		if(document.frmSRC.cbMGY.options[0]!=null)		{
			fn_ListaFeltolto(document.frmSRC.cbCTY, document.frmSRC.cbMGY.options[0].value);
		}
	}


	function fn_ChangeS(){
		fn_ListaUrito(document.frmSRC.cbCTY);

		if(document.frmSRC.cbMGY.options[0]!=null)	{
			fn_ListaFeltolto(document.frmSRC.cbCTY, document.frmSRC.cbMGY.value);
		}
	}

//	-->