TTS={sURL:""};TTS.init=function(){if((document.location.href.indexOf("://localhost")>0)){TTS.sURL="http://localhost"}if((document.location.href.indexOf(".local")>0)){TTS.sURL="http://top10speed.local"}if(document.location.href.indexOf(".com")>0){TTS.sURL="http://www.top10speed.com"}if(document.location.href.indexOf("dev.top10speed")>0){TTS.sURL="http://dev.top10speed.com"}$(".emevomre").remove();if(($("ul.errors").length>0)&&($(".error_container").length>0)){TTS.rewriteCommentErrors("ul.errors")}if($("ul#menu").length>0){TTS.initMenu("ul#menu")}if($("#top10speedbreadCrumb").length>0){$("#top10speedbreadCrumb").jBreadCrumb()}if($(".captcha_row input").length>0){$(".captcha_row input#captcha-input").attr("value","Captcha Code")}if($("ul.details").length>0){$("ul.details li:first a").lightBox()}if($("#map_canvas").length>0){TTS.map_initialize(true)}$("input[type=text], textarea").focus(function(){this.select()});if((jQuery.browser.msie)&&((parseInt(jQuery.browser.version)==6)||(parseInt(jQuery.browser.version)==7))){$(".socials li.tweetmeme").remove()}TTS.initRating();$(".rating-cancel").remove();if($(".slide-block .terms p").length>0){TTS.writeTerms(".slide-block .terms p")}if($("ul.details .imprint").length>0){TTS.writeImprint("ul.details .imprint")}if($("ul.upload_form").length>0){TTS.checkUploadForm()}TTS.rewriteSpeedEntryLinks();TTS.rewriteTweetsLinks();TTS.initHelp();TTS.initSpeedEntryGM()};TTS.initSpeedEntryGM=function(){try{if(_gm){TTS.map_initialize(false);var b=new GLatLng(lats,lons);var a=new GLatLng(late,lone);gdir.load("from: "+b.lat()+","+b.lng()+" to: "+a.lat()+","+a.lng(),{locale:"en_US"})}}catch(c){}};TTS.initHelp=function(){if($(".slide-block-rating").length>0){if($(".help-rating").length>0){$(".help-rating").remove()}$(".slide-block-rating").append("<div class='help-rating'>Click on a star to rate!</div>");$(".help-rating").mouseenter(function(){$(this).fadeOut()})}};TTS.checkUploadForm=function(){$("input#trackEnd,input#trackStart").keypress(function(a){if(a.which==13){$(this).trigger("click")}});$("a.calc_google_maps").click(function(){if($("div.trackstart input").attr("value")==""){$("li.u_track_end").find(".input_state").attr("class","input_state state_incomplete");$("li.u_track_end").find(".input_state").html("Incomplete");$("div.trackstart input").attr("value","You can't leave Track-Start empty.")}if($("div.trackend input").attr("value")==""){$("li.u_track_end").find(".input_state").attr("class","input_state state_incomplete");$("li.u_track_end").find(".input_state").html("Incomplete");$("div.trackend input").attr("value","You can't leave Track-End empty.")}if(($("div.trackstart input").attr("value")!="")&&($("div.trackend input").attr("value")!="")){if((String($("input#trackDescription").attr("value")).indexOf(" - ")>-1)||($("input#trackDescription").attr("value")=="")){$("input#trackDescription").attr("value",$("div.trackstart input").attr("value")+" - "+$("div.trackend input").attr("value"));$("input#trackDescription").trigger("keyup")}TTS.setDirections($("div.trackstart input").attr("value"),$("div.trackend input").attr("value"),"en_US")}});$("li.u_topspeed .physical_value br").replaceWith("&nbsp;&nbsp;");$("input#agree").bind("click",function(){if($(this).attr("checked")){$("li.u_terms").find(".input_state").attr("class","input_state state_ok");$("li.u_terms").find(".input_state").html("Completed")}else{$("li.u_terms").find(".input_state").attr("class","input_state state_incomplete");$("li.u_terms").find(".input_state").html("Incomplete")}});$("li.simple_input").each(function(a,b){$(this).find("input").bind("keyup",function(){if($(this).attr("value")!=""){$(b).find(".input_state").attr("class","input_state state_ok");$(b).find(".input_state").html("Completed")}else{$(b).find(".input_state").attr("class","input_state state_incomplete");$(b).find(".input_state").html("Incomplete")}})});$("input#top10SpeedImage").bind("change",function(){if($(this).attr("value")!=""){$("li.u_topspeedimg").find(".input_state").attr("class","input_state state_ok");$("li.u_topspeedimg").find(".input_state").html("Completed")}else{$("li.u_topspeedimg").find(".input_state").attr("class","input_state state_incomplete");$("li.u_topspeedimg").find(".input_state").html("Incomplete")}});$("li.list_input").each(function(a,b){$(this).find("select").change(function(){if($(this).attr("value")=="0"){$(b).find(".input_state").attr("class","input_state state_incomplete");$(b).find(".input_state").html("Incomplete")}else{$(b).find(".input_state").attr("class","input_state state_ok");$(b).find(".input_state").html("Completed")}})});$("li.u_carbrand select").change(function(){if($(this).attr("value")!="0"){$.ajax({type:"GET",async:false,url:TTS.sURL+"/upload/model/manufacturerId/"+$(this).attr("value"),success:function(b){b=b.split("{").join("");b=b.split("}").join("");aTmp=b.split(",");new_options="";for(var a=0;a<aTmp.length;a++){details=aTmp[a].split(":");details[0]=details[0].split('"').join("").split(",").join("");details[1]=details[1].split('"').join("").split(",").join("");if(a==0){details[1]="Please select your model"}new_options+='<option value="'+details[0]+'" label="'+details[1]+'">'+details[1]+"</option>"}$("li.u_model select").html(new_options)}})}});$("div.btn-upload-submit").bind("click",function(){if($(".state_incomplete").length>0){alert('Please fill out the fields marked as "Incomplete".');return false}$("form").submit();return true});if($("ul.errors").length>0){$("input").trigger("keyup");$("a.calc_google_maps").trigger("click");$("select").trigger("change")}};TTS.rewriteTweetsLinks=function(){$("span.ttstweet").each(function(){$(this).html(TTS.formatTwitString($(this).html()))})};TTS.rewriteSpeedEntryLinks=function(){$("a.main_link").each(function(){$("a."+$(this).attr("id")).attr("href",$(this).attr("href"))})};TTS.writeTerms=function(a){$(a).html("<strong>Terms of usage: </strong>Top10Speed.com reserve the right to ban/modify/delete any image which they deem illegal/improper/incorrect in any form at any time, as maybe decided by Top10Speed.com. Rights of assessment, evaluation and decision are entirely with Top10Speed.com. Users of Top10Speed.com must agree to comply with all laws which apply to their location, including copyright and trademark laws. Images and information that violate copyrights or trademarks are not allowed. If there is a dispute between participants on this site, Top10Speed.com is under no obligation to become involved. As a user of Top10Speed.com you agree that Top10Speed.com is not liable for your images or any lost business due to the unavailability or loss of the website. Top10Speed.com makes no claims of future reliability in hosting or storing your images. Hence no such claims shall be entertained. Top10Speed.com shall not be held responsible for the content and images uploaded by members. All files uploaded are &copy; to their respective owners. Top10Speed.com reserves the right to modify the Terms and Rules of it's service at any time it considers necessary and without prior notice to its users. Any loss/damage of any sort experienced by users due to such changes is entirely the user's responsibility and no claims regarding the same shall be entertained. It is binding on all users to read the terms and disclaimer before using any of our services and to agree with the same. Any mistake/fault on part of the user for not doing the same shall not be the responsibility of Top10Speed.com. The jursidiction of all disputes will be at Munich, Germany. All the images and information on this site are uploaded by the site users. If you own the copyright of any of the images and information and dont want it to be here then please email us on webmaster AT Top10Speed.com and we shall remove the copyrighted images or information, immediately and also will verify the claimant genuiness.")};TTS.writeImprint=function(a){$(a).html("<p>Top10Speed.com</p><p>Flashback-Studios GbR</p><p>Innstrasse 22, D<br />83022 Rosenheim</p><p>Telefon: +49 (0)89 / 21 580 702<br />Telefax: +49 (0)89 / 21 580 701</p></p>E-Mail: webmaster@top10speed.com</p>")};TTS.rewriteCommentErrors=function(a){$(a).each(function(){$(".error_container ul").append($(this).html());$(this).remove()});$(".error_container").fadeIn()};TTS.initRating=function(c){var b=0,a=0;$("input.rating").rating("select");$(".tts_detail_star").rating({callback:function(e,d){a=$(".slide-block-rating .dbvalue").html();$(".slide-block-rating .dbvalue").html("Calculating...");$(".star-rating-control").hide();$(".rating").html("Thank you! You rated "+e+" Stars");$.get(TTS.sURL+"/rating/save/speedEntryId/"+rating_speedEntryId+"?points="+e,function(f){if(f.substr(0,3)!=""){$(".slide-block-rating .dbvalue").html(f.substr(0,3))}else{$(".slide-block-rating .dbvalue").html(a)}})}})};TTS.initMenu=function(a){$(a+" li.top10s").bind("mouseenter",function(){$("#top10s").slideDown(350)});$(a+" li.top10s").bind("click",function(){$("#top10s").slideDown(150)});$("#top10s").bind("mouseleave",function(){$("#top10s").slideUp(350)})};TTS.formatTwitString=function(a){a=" "+a;a=a.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'<a href="$1" target="_blank">$1</a>');a=a.replace(/([^\w])\@([\w\-]+)/gm,'$1@<a href="http://twitter.com/$2" target="_blank">$2</a>');a=a.replace(/([^\w])\#([\w\-]+)/gm,'$1<a href="http://twitter.com/search?q=%23$2" target="_blank">#$2</a>');return a};var map;var gdir;var geocoder=null;var addressMarker;TTS.map_initialize=function(a){try{if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_canvas"));gdir=new GDirections(map,document.getElementById("directions"));geocoder=new GClientGeocoder();GEvent.addListener(gdir,"load",onGDirectionsLoad);GEvent.addListener(gdir,"error",handleErrors);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());if(a){var c=new GLatLng(50.335819,6.947308);map.setCenter(new GLatLng(50.335819,6.947308),1)}}}catch(b){}};TTS.mapCheckState=function(){var a=false;if(($("input#latitudeStart").attr("value")!="")&&($("input#longitudeStart").attr("value")!="")&&($("input#latitudeEnd").attr("value")!="")&&($("input#longitudeEnd").attr("value")!="")){a=true}if(a){$("li.u_track_end").find(".input_state").attr("class","input_state state_ok");$("li.u_track_end").find(".input_state").html("Completed")}else{$("li.u_track_end").find(".input_state").attr("class","input_state state_incomplete");$("li.u_track_end").find(".input_state").html("Incomplete")}};TTS.setDirections=function(b,d,a){try{gdir.load("from: "+b+" to: "+d,{locale:a});geocoder.getLatLng(b,function(e){if(!e){alert("Sorry, "+b+" not found!");$("input#latitudeStart").attr("value","");$("input#longitudeStart").attr("value","");TTS.mapCheckState("")}else{var f=String(e);f=f.replace(/\(|\)/g,"");var g=f.split(",");$("input#latitudeStart").attr("value",g[0].split(" ").join(""));$("input#longitudeStart").attr("value",g[1].split(" ").join(""));TTS.mapCheckState("")}});geocoder.getLatLng(d,function(e){if(!e){alert("Sorry, "+d+" not found!");$("input#latitudeEnd").attr("value","");$("input#longitudeEnd").attr("value","");TTS.mapCheckState("")}else{var f=String(e);f=f.replace(/\(|\)/g,"");var g=f.split(",");$("input#latitudeEnd").attr("value",g[0].split(" ").join(""));$("input#longitudeEnd").attr("value",g[1].split(" ").join(""));TTS.mapCheckState("")}})}catch(c){}};function handleErrors(){try{if($("ul.upload_form").length>0){if(gdir.getStatus().code==G_GEO_UNKNOWN_ADDRESS){alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: "+gdir.getStatus().code)}else{if(gdir.getStatus().code==G_GEO_SERVER_ERROR){alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: "+gdir.getStatus().code)}else{if(gdir.getStatus().code==G_GEO_MISSING_QUERY){alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: "+gdir.getStatus().code)}else{if(gdir.getStatus().code==G_GEO_BAD_KEY){alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: "+gdir.getStatus().code)}else{if(gdir.getStatus().code==G_GEO_BAD_REQUEST){alert("A directions request could not be successfully parsed.\n Error code: "+gdir.getStatus().code)}else{alert("An unknown error occurred.")}}}}}}}catch(a){}}function onGDirectionsLoad(){try{gdir.getStatus().code}catch(a){}};