// JavaScript Document

var callback = 
	{
		CarregarTipo : function (result)
				       {
							if(result.length > 0)
							{
							   combo = document.getElementById(result[0]['PreencherQuem']);
							   combo.options.length = 0;
							   combo.options[combo.options.length] = new Option('','');
							   
							   for(i=0;i<result.length;i++)
							   {							  
									combo.options[combo.options.length] = new Option(result[i]['tipo'],result[i]['tipo']);
							   }
							}
				       },
					   
		CarregarLocalNome : function(result)			 
							{
								if(result.length > 0)
								{
									combo = document.getElementById(result[0]['PreencherQuem']);
									combo.options.length = 0;
									combo.options[combo.options.length] = new Option('','');
									
									for(i=0;i<result.length;i++)
									{
										combo.options[combo.options.length] = new Option(result[i]['nome'],result[i]['gid']);
									}
								}
							}
	}
	
	var local = new local(callback);
	
	function SetaMunicipioOrigem()
	{
		return document.getElementById('origin_city').value;
	}
	
	function SetaMunicipioDestino()
	{
		return document.getElementById('destination_city').value;
	}
	
	function LimparOrigem()
	{
		document.getElementById('tipo_local_origem').value 	 = null;
		document.getElementById('select_local_origem').value = null;
	}
	
	function LimparDestino()
	{
		document.getElementById('tipo_local_destino').value   = null;
		document.getElementById('select_local_destino').value = null;
	}