var Highwire = {
    slides: undefined,
    slideWidth: undefined,

    init: function() {
        this.carouselInit();
        this.testimonialInit();
        this.themeInit();
        this.tooltipInit();
        this.signupInit();
    },

    carouselInit: function() {
        var $carousel = $('.screen-carousel');

        if ($carousel.length) {
            this.slides = $carousel.find('ul');

            var $slide = this.slides.find('li');
            var slides = $slide.length;

            $slide.each(function(k, v) {
                $(this).attr('data-id', k + 1);
            });

            this.slideWidth = $slide.outerWidth();
            this.slides.css({
                'width': this.slideWidth * slides,
                'left': '281px'
            });

            $carousel.find('.page').click(function(e) {
                e.preventDefault();
                Highwire.carouselPage($(this));
            });

            this.changeSlide($carousel.find('li.current').data('id'));
        }
    },

    carouselPage: function($p) {
        var currentSlide = parseInt(this.slides.find('li.current').data('id'));
        var maxSlide = parseInt(this.slides.find('li').length)
        var nextSlide;

        if ($p.hasClass('next')) {
            nextSlide = (currentSlide == maxSlide ? 1 : currentSlide + 1);
        }
        else {
            nextSlide = (currentSlide == 1 ? maxSlide : currentSlide - 1);
        }

        this.changeSlide(nextSlide);
    },

    changeSlide: function(page) {
        var indent = -(this.slideWidth * (page - 1)) + 281;

        this.slides.animate({ 'left': indent }, 500, null);
        this.slides.find('li').removeClass('current');
        this.slides.find('li:nth-child(' + page + ')').addClass('current');
    },

    testimonialInit: function() {
        var $testimonials = $('.testimonial-list');

        if ($testimonials.length) {
            var $list = $testimonials.find('.list li');
            var $pages = $('<ol class="pages"></ol>');

            $list.each(function(k, v) {
                $(this).attr('id', 'testimonial' + (k + 1));
                $pages.append('<li><a href="#testimonial' + (k + 1) + '"></a></li>');
            });

            $pages.find('li:first-child').addClass('current');

            $pages.find('a').click(function(e) {
                e.preventDefault();

                $list.filter('li.current').removeClass('current');
                $list.filter('li' + $(this).attr('href')).addClass('current');

                $pages.find('li.current').removeClass('current');
                $(this).parent().addClass('current');
            });

            $testimonials.append($pages);
        }
    },

    themeInit: function() {
        var $theme = $('.themes .theme');

        if ($theme.length) {
            var $zoom = $theme.find('.zoom, .zoom_thumb');
            var $thumbs = $theme.find('.thumbs');

            $zoom.find('a').fancybox({
                overlayColor: '#000',
                overlayOpacity: 0.8,
                transitionIn: 'elastic',
                transitionOut: 'elastic',
                padding: 0
            });

            $thumbs.find('a').click(function(e) {
                e.preventDefault();

                $zoom.find('a').attr('href', $(this).attr('href'));
                $zoom.find('img').attr('src', $(this).data('thumb'));
            });
        }
    },


    tooltipInit: function() {
        $('a.help[title]').qtip({
            style: { classes: 'ui-tooltip-dark ui-tooltip-rounded' }
        }).click(function(e) {
            e.preventDefault();
        });
    },

    signupInit: function() {
        $('a.signup-popup').fancybox({
            overlayColor: '#000',
            overlayOpacity: 0.8,
            padding: 0,
            type: 'iframe',
            width: 720,
            height: 660,
            autoScale: false,
            scrolling: 'no',
            'onComplete': function() {
                $('#fancybox-bg-nw').show();
                $('#fancybox-bg-ne').show();
                $('#fancybox-bg-sw').show();
                $('#fancybox-bg-se').show();
            }

        });
    }

};

$(document).ready(function() {
	Highwire.init();
});
var clicky = { init: function(site_id) { clicky.pageview_fired = 0; if (document.location.protocol == "https:") { clicky.domain = "https://static.getclicky.com"; clicky.secure = 1; } else { clicky.domain = "http://static.getclicky.com"; clicky.secure = 0; } clicky.img = new Image(); clicky.img2 = new Image(); clicky.img_base = clicky.domain + "/in.php?site_id=" + site_id + "&res=" + screen.width + "x" + screen.height + "&lang=" + (navigator.language || navigator.browserLanguage).substr(0, 2) + "&secure=" + clicky.secure; if (clicky_custom.session) { for (var i in clicky_custom.session) { clicky.img_base += "&custom[" + clicky.enc(i) + "]=" + clicky.enc(clicky_custom.session[i]); } } if (clicky_custom.goal) { for (var i in clicky_custom.goal) { clicky.img_base += "&goal[" + clicky.enc(i) + "]=" + clicky.enc(clicky_custom.goal[i]); } } clicky.ref = RegExp("^https?://[^/]*" + location.host.replace(/^www\./i, "") + "/", "i").test(document.referrer) ? "" : clicky.enc(document.referrer); if (!clicky_custom.pageview_disable) { if (typeof clicky_custom.delay == "undefined") { clicky.add_event(window, 'load', clicky.pageview); setTimeout(clicky.pageview, 2000); } else { var d = clicky_custom.delay; if (d == "onload") { clicky.add_event(window, 'load', clicky.pageview); } else if (parseInt(d) == d) { setTimeout(clicky.pageview, parseInt(d)); } else clicky.pageview(); } } clicky.add_event(window, 'load', clicky.advanced); }, pageview: function() { if (clicky.pageview_fired) return; clicky.pageview_fired = 1; clicky.img.src = clicky.img_base + "&href=" + clicky.enc(clicky_custom.href || location.pathname + location.search) + "&title=" + clicky.enc(clicky_custom.title || document.title) + "&ref=" + clicky.ref + "&x=" + Math.random(); clicky.ref = ""; }, isset: function(e) { return (typeof (window[e]) != "undefined"); }, enc: function(e) { return window.encodeURIComponent ? encodeURIComponent(e) : escape(e); }, log: function(href, title, type) { type = type || "click"; if (type == "pageview") href = href.replace(/^https?:\/\/([^\/]+)/i, ""); clicky.img2.src = clicky.img_base + "&type=" + type + "&title=" + clicky.enc(title) + "&href=" + clicky.enc(href) + "&ref=" + clicky.ref + "&x=" + Math.random(); clicky.ref = ""; if (type == "download" || type == "outbound") clicky.pause(); }, pause: function(x) { var now = new Date(); var stop = now.getTime() + (x || clicky_custom.timer || 500); while (now.getTime() < stop) var now = new Date(); }, goal: function(id, revenue) { clicky.img2.src = clicky.img_base + "&type=goal&goal[id]=" + id + "&goal[revenue]=" + revenue + "&x=" + Math.random(); }, add_event: function(e, type, func) { if (e.addEventListener) { e.addEventListener(type, func, false); } else if (e.attachEvent) { e.attachEvent("on" + type, func); } }, download: function(e) { clicky.img_src(e, "download"); }, outbound: function(e) { clicky.img_src(e, "outbound"); }, click: function(e) { clicky.img_src(e, "click"); }, img_src: function(e, type) { obj = clicky.get_target(e); clicky.log(clicky.get_href(obj), clicky.get_text(obj), type); }, get_text: function(e) { do { var txt = e.text ? e.text : e.innerText; if (txt) return txt; if (e.alt) return e.alt; if (e.title) return e.title; if (e.src) return e.src; e = clicky.get_parent(e); } while (e); return ""; }, get_href: function(e) { do { if (e.href && !e.src) return e.href; e = clicky.get_parent(e); } while (e); return ""; }, get_parent: function(e) { return e.parentElement || e.parentNode; }, get_target: function(e) { if (!e) var e = window.event; var t = e.target ? e.target : e.srcElement; if (t.nodeType && t.nodeType == 3) t = t.parentNode; return t; }, advanced: function() { if (clicky_custom.advanced_disable) return; var is_download = new RegExp("\\.(7z|aac|avi|cab|csv|dmg|doc(x|m)?|exe|flv|gif|gz|jpe?g|js|m4a|mp(3|4|e?g)|mov|msi|ods|pdf|phps|png|ppt(x|m)?|rar|rtf|sea|sit|tar|torrent|txt|wma|wmv|xls(x|m)?|xml|zip)$", "i"); var is_link = new RegExp("^(https?|ftp|telnet|mailto):", "i"); var is_link_internal = new RegExp("^https?:\/\/(.*)" + location.host.replace(/^www\./i, ""), "i"); var a = document.getElementsByTagName("a"); for (var i = 0; i < a.length; i++) { if (a[i].className.match(/clicky_log/i)) { if (a[i].className.match(/clicky_log_download/i)) { clicky.add_event(a[i], "mousedown", clicky.download); } else if (a[i].className.match(/clicky_log_outbound/i)) { clicky.add_event(a[i], "mousedown", clicky.outbound); } else { clicky.add_event(a[i], "mousedown", clicky.click); } } else { if (is_link.test(a[i].href) && !a[i].className.match(/clicky_ignore/i)) { if (is_download.test(a[i].href)) { clicky.add_event(a[i], "mousedown", clicky.download); } else if (!is_link_internal.test(a[i].href)) { clicky.add_event(a[i], "mousedown", clicky.outbound); } } } } } }; if (!clicky.isset("clicky_custom")) clicky_custom = {}; if (clicky.isset("clicky_page_title")) clicky_custom.title = clicky_page_title; if (clicky.isset("clicky_advanced_disable")) clicky_custom.advanced_disable = 1; if (clicky.isset("clicky_pause_timer")) clicky_custom.timer = clicky_pause_timer; if (clicky.isset("clicky_custom_session")) clicky_custom.session = clicky_custom_session; if (clicky.isset("clicky_goal")) clicky_custom.goal = clicky_goal; function statsgoyes(site_id) { clicky.init(site_id); } statsgoyes(191385);
