/* alert("JS loaded"); */

$(document).ready(function() {

	$('#municipalities').cycle();
	
	$('#slideshow').cycle({
     fx:       'fadeZoom',
     timeout:   4000,
     after: function() {
       $('#caption').html(this.alt);
     }
  });
  
  // basic version is: $('div.news marquee').marquee() - but we're doing some sexy extras
  // http://remysharp.com/2008/09/10/the-silky-smooth-marquee/
        
  $('div.news marquee').marquee('pointer').mouseover(function () {
      $(this).trigger('stop');
  }).mouseout(function () {
      $(this).trigger('start');
  }).mousemove(function (event) {
      if ($(this).data('drag') == true) {
          this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
      }
  }).mousedown(function (event) {
      $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
  }).mouseup(function () {
      $(this).data('drag', false);
  });
    
});
