var changeCountry=function(){countryAbbr=$('.countries').val();if(countryAbbr=="--"){$.getJSON(url="/WAS/country_by_ip",data={},callback=function(json){if(json!=null&&g_map_info){var bounds=new OpenLayers.Bounds();var center=null;if(g_map_info.base_layer_type=="OSM"){bounds.extend(OpenLayers.Layer.SphericalMercator.forwardMercator(json.bounds.left,json.bounds.top));bounds.extend(OpenLayers.Layer.SphericalMercator.forwardMercator(json.bounds.right,json.bounds.bottom));}else{bounds.extend(new OpenLayers.LonLat(json.bounds.left,json.bounds.top));bounds.extend(new OpenLayers.LonLat(json.bounds.right,json.bounds.bottom));}
if(typeof(OverviewMap)=="function"&&typeof(OverviewMap.prototype)=="object")
g_overview_map.map.zoomToExtent(bounds,true);$('#country1').text(json.name);$('#country2').text(json.name);}});return;}
var country=($('.countries option:selected').text());if(countryAbbr=="IL"){document.location.href="http://www.waze.co.il";return;}
if(countryAbbr=="US"||countryAbbr=="CA"){document.location.href="http://www.waze.com/homepage";return;}
if(g_spanish_countries[countryAbbr]){document.location.href="http://es.waze.com/homepage?country="+countryAbbr;return;}
writeCountryCookie(countryAbbr);deleteMapCookie();$(".recent_reports").hide();$(".top_wazers").hide();$(".marketing_usa").hide();$(".marketing_inter").show();$(".metros").hide();$(".competition").hide();$("#country1").text(country);$("#country2").text(country);$(".blog").hide();$.getJSON(url='/WAS/country_map_info',data={country:countryAbbr},function(json){var bounds=new OpenLayers.Bounds();if(g_map_info.base_layer_type=="OSM"){bounds.extend(OpenLayers.Layer.SphericalMercator.forwardMercator(json.left,json.top));bounds.extend(OpenLayers.Layer.SphericalMercator.forwardMercator(json.right,json.bottom));}else{bounds.extend(new OpenLayers.LonLat(json.left,json.top));bounds.extend(new OpenLayers.LonLat(json.right,json.bottom));}
if(typeof(OverviewMap)=="function"&&typeof(OverviewMap.prototype)=="object")
g_overview_map.map.zoomToExtent(bounds,true);});}