﻿$(document).ready(function() {
    $("#youtube a").click(function() {
        $.fancybox({
            'overlayShow': false,
            'padding': 0,
            'autoScale': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic',
            'speedIn': 600,
            'speedOut': 200,
            'title': this.title,
            'width': 680,
            'height': 495,
            'href': this.href + '&autoplay=1',
            'type': 'swf',
            'swf': {
                'wmode': 'transparent',
                'allowfullscreen': 'true'
            }
        });

        return false;
    });
    $('#news .news_item dl dt a.goto').each(function() {
        $(this).qtip({
            content: $(this).parent().next("dd").html(), // Use the tooltip attribute of the element for the content
            style: {
                border: {
                    width: 5,
                    radius: 10
                },
                padding: 10,
                textAlign: 'center',
                tip: true, // Give it a speech bubble tip with automatic corner detection
                name: 'light' // Style it according to the preset 'cream' style
            },
            position: {
                corner: {
                    target: 'rightMiddle',
                    tooltip: 'leftMiddle'

                }
            }

        });
    });

    $("#flickr .item").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 600,
        'speedOut': 200,
        'overlayShow': false
    });

    $("#logo").click(function() {
        window.location = "http://www.need4motors.com";
    });

});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-843025-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);
})();

