//(c) 2009-2010 veloroutes.org
// support for upload page
function validateFile() {
 var i = document.getElementById("file");
 if(i.value == "" || !i.value) { alert("Please select a file from your local system."); return false; }
 if(i.value.length > 255 || !i.value.match(/\.(tcx|gpx|kml|csv)$/i)) { alert("Please select a valid file from your local system."); return false; }
 i = document.getElementById("feedbackBar");
 i.innerHTML="<b>uploading...</b>";
 try {
  i.setAttribute("class","loading");
  i.setAttribute("className","loading"); 
 } catch(e){}

 return true;
}
function load() {
  var saveR = document.getElementById("saveRoute");
  if(saveR) {saveR.disabled = false;}
}
function doSave() {
 if(!this.route) { alert("Could not find route."); return}
 var dist = this.route.distance;
 if(dist <= 0) {
  alert("Invalid route distance, cannot save.");
 }
 saveRoute(this._route);
}
