$(document).ready(function(){$("#location").text("Call us today!");function supports_geolocation(){return!!navigator.geolocation;}
if(supports_geolocation()){findLocation();}else{$("#location").text("Call us today!");}});function findLocation(){navigator.geolocation.getCurrentPosition(foundLocation,noLocation);}
function foundLocation(position)
{var lat=position.coords.latitude;var long=position.coords.longitude;$.ajax({url:"/images/RimGuardXtreme/site/template/search.asp",data:"lat="+lat+"&long="+long,cache:"false",success:function(closestLocation){String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"");}
var closest=closestLocation.split("|");$('#location').html(closest[0]);var number=closest[1].trim();if(parseInt(number)<60){$("#nationwide").text("Local Mobile Rim Repair Serving NC and SC");$('<style type="text/css">#shipping-box { background:url(/images/RimGuardXtreme/site/contact/truck.jpg) no-repeat; width:292px; height:182px; }</style>').appendTo("head");}else{$('#nationwide').html("FREE Shipping Both<br>ways... Nationwide");$("#location").text("Call us today!");}}});}
function noLocation(err)
{$("#location").text("Call us today!");} 
