  function getDistance(coord,cornx){  
    var dist = Math.abs(coord-cornx) ;  
    return dist;  
  }  