/*
Support scripts for the AllOneWord site
Jon Ward 2011
*/

/* For Google Analytics */

var _gaq = _gaq || [];
	       _gaq.push(['_setAccount', 'UA-836757-5']);
	       _gaq.push(['_trackPageview']);
	       (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                })();

/* For JS Player */

$(document).ready(function(){
      $("#jquery_jplayer_1").jPlayer({
        ready: function () {
          $(this).jPlayer("setMedia", {
            mp3: "clips/montage.mp3",
            oga: "clips/montage.ogg"
          });
        },
        swfPath: "/httpdocs/alloneword/js",
        supplied: "mp3, oga"
      });
      /* Add a click handler for analytics */
      $('a.jp-play').click(function() {
      _gaq.push(['_trackEvent', 'Preview', 'Play', 'Track mix']);
      });
    });

