code: function ringIsClockwise(ringToTest) {
      var total = 0,
        i = 0,
        rLength = ringToTest.length,
        pt1 = ringToTest[i],
        pt2;
      for (i; i < rLength - 1; i++) {
        pt2 = ringToTest[i + 1];
        total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
        pt1 = pt2;
      }
      return (total >= 0);
    }
docs: /*determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
  or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
  points-are-in-clockwise-order
  this code taken from http://esri.github.com/geojson-utils/src/jsonConverters.js by James Cardona (MIT lisense)