$(document).ready(function(){var root='http://'+window.location.hostname+'/';$("#phone").autocomplete(root+"suggest/",{width:573,max:100,highlight:false,scroll:true,scrollHeight:405,formatItem:function(data,i,n,value){val=value;val=val.replace('#','');val=val.replace('#','');return val},formatResult:function(data,value){val=value.split("#")[1];return val}});$("#phone").result(function(event,data,formatted){$("#phone").css('color','white');var href=$(data+' div.hoverd').find('span.ref').html();window.location=href});$("#phone").focus(function(){if($(this).val()=='Enter your phone make/model, eg. iphone 3gs'){$(this).val('').css('color','#4E4E50')}});$("#phone").blur(function(){if($(this).val()==''||$(this).val()==' '){$(this).val('Enter your phone make/model, eg. iphone 3gs').css('color','#D2D2D2')}})});function trim(str,chars){return ltrim(rtrim(str,chars),chars)}function ltrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"")}function rtrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"")}
