$(function()
  {
		$("input#fullAdress").focus();
  });

function showSearch_inputs(show,hide)
{
 $(".dpzMapEngine_" + show).show();
 $(".dpzMapEngine_" + hide).hide();
 $(".what_title .dpzengine_error_msg").css("visibility", "hidden");
 $(".dest_tip")[show == "route"? "show": "hide"]();
 $(".dpzMapEngine_" + show).find("input:first").focus();
	
}
function hideLevels()
{
 $(".levelSel:not(#Traffic)").each(
  function ()
  {
   $("#" + this.id).click();
  });
}
function checkMapSearchEngine(defaultFromVal,defaultToVal)
{
	if(hasReqestedVersion==true)
	{
		var searchType = $(".engine_dpz input:radio:checked").val();
		if (($("#fullAdress").val() == "" && searchType == "address") ||
		    (($("#fromAddress").val() == "" || $("#toAddress").val() == "") &&
		     searchType == "route"))
		{
		 $(".what_title .dpzengine_error_msg .error_address," +
		   ".what_title .dpzengine_error_msg .error_route").hide();
		 $(".what_title .dpzengine_error_msg .error_" + searchType).show();
		 $(".what_title .dpzengine_error_msg").css("visibility", "visible");
		 return false;
		}
		overlayStates.closeTab("results");
		overlayStates.closeTab("junction");
		map_assist.remove_all_points();
		clear_circle();
		set_default_point();

		searchAddressPoints.x=0;
		searchAddressPoints.y=0;
		hideLevels();
		showErrorMessage("loadingProgresMaps","טוען נתונים");
		isRouteShown=false;
		if (searchType == "address")
		{	
			map_assist.find_address($("#fullAdress").val());
		}
		else
		{	
			map_assist.find_route($("#fromAddress").val(),$("#toAddress").val());
		}
	}
	return true;
}


