﻿



/*Activate Hover Animation for pdf-buttons*/
$(document).ready(function() {

$("ul.thumb li").hover(function() {
    $(this).css({ 'z-index': '9999' }); /*Add a higher z-index value so this image stays on top*/
    $(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
		    marginTop: '-100px', /* The next 4 lines will vertically align this image */
		    marginLeft: '-105px',
		    top: '50%',
		    left: '50%',
		    width: '190px', /* Set new width */
		    height: '190px', /* Set new height */
		    padding: '0px'
		}, 250); /* this value of "200" is the speed of how fast/slow this hover animates */

}, function() {
    $(this).css({ 'z-index': '0' }); /* Set z-index back to 0 */
    $(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
		    marginTop: '0', /* Set alignment back to default */
		    marginLeft: '0',
		    top: '0',
		    left: '0',
		    width: '158px', /* Set width back to default */
		    height: '158px', /* Set height back to default */
		    padding: '0px'
		}, 250);
});


});

/*Google Analytics*/
$(document).ready(function() {

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    var var1 = "called";
    //use jQuery to call the Google Analytics JavaScript
    $.getScript(gaJsHost + "google-analytics.com/ga.js", function() {

        //tell Analytics about the current page load using standard _trackPageview method
        try {
            var pageTracker = _gat._getTracker("UA-11094551-1");
            pageTracker._trackPageview();
        } catch (err) { }

        //loop though each anchor element
        $('a').each(function() {

            var href = $(this).attr('href');
            var filetypes = /\.(zip|exe|pdf|vcs|txt|rtf|doc*|xls*|ppt*|mp3)$/i;

            //check for links starting with http or https, making sure that links to our own domain are excluded
            if ((href.match(/^https?\:/i)) && (!href.match(document.domain))) {
                $(this).click(function() {
                    var extLink = href.replace(/^https?\:\/\//i, '');
                    pageTracker._trackEvent('External', 'Click', extLink);
                });
            }
            //check for links starting with mailto:
            else if (href.match(/^mailto\:/i)) {
                $(this).click(function() {
                    var mailLink = href.replace(/^mailto\:/i, '');
                    pageTracker._trackEvent('Email', 'Click', mailLink);
                });
            }
            //check for links with file extension that match the filetypes regular expression:
            else if (href.match(filetypes)) {
                $(this).click(function() {
                    var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined;
                    var filePath = href.replace(/^https?\:\/\/(www.)dancelifeunite\.com\.au\//i, '');
                    pageTracker._trackEvent('Download', 'Click - ' + extension, filePath);
                });
            }

        });

    });

});


