/*
* jquery.tools 1.0.2 - The missing UI library
* 
* [tools.tabs-1.0.1, tools.tooltip-1.0.2]
* 
* Copyright (c) 2009 Tero Piirainen
* http://flowplayer.org/tools/
*
* Dual licensed under MIT and GPL 2+ licenses
* http://www.opensource.org/licenses
* 
* -----
* 
* Build: Fri Jun 12 17:12:52 GMT+00:00 2009
*/
(function(c) { c.tools = c.tools || { version: {} }; c.tools.version.tabs = "1.0.1"; c.tools.addTabEffect = function(d, e) { b[d] = e }; var b = { "default": function(d) { this.getPanes().hide().eq(d).show() }, fade: function(d) { this.getPanes().hide().eq(d).fadeIn(this.getConf().fadeInSpeed) }, slide: function(d) { this.getCurrentPane().slideUp("fast"); this.getPanes().eq(d).slideDown() }, horizontal: function(d) { if (!c._hW) { c._hW = this.getPanes().eq(0).width() } this.getCurrentPane().animate({ width: 0 }, function() { c(this).hide() }); this.getPanes().eq(d).animate({ width: c._hW }, function() { c(this).show() }) } }; function a(e, f, g) { var d = this; var h; function i(j, k) { c(d).bind(j, function(m, l) { if (k && k.call(this, l.index) === false && l) { l.proceed = false } }); return d } c.each(g, function(j, k) { if (c.isFunction(k)) { i(j, k) } }); c.extend(this, { click: function(k) { if (k === h) { return d } var m = d.getCurrentPane(); var l = e.eq(k); if (typeof k == "string") { l = e.filter("[href=" + k + "]"); k = e.index(l) } if (!l.length) { if (h >= 0) { return d } k = g.initialIndex; l = e.eq(k) } var j = { index: k, proceed: true }; c(d).triggerHandler("onBeforeClick", j); if (!j.proceed) { return d } l.addClass(g.current); b[g.effect].call(d, k); c(d).triggerHandler("onClick", j); e.removeClass(g.current); l.addClass(g.current); h = k; return d }, getConf: function() { return g }, getTabs: function() { return e }, getPanes: function() { return f }, getCurrentPane: function() { return f.eq(h) }, getCurrentTab: function() { return e.eq(h) }, getIndex: function() { return h }, next: function() { return d.click(h + 1) }, prev: function() { return d.click(h - 1) }, onBeforeClick: function(j) { return i("onBeforeClick", j) }, onClick: function(j) { return i("onClick", j) } }); e.each(function(j) { c(this).bind(g.event, function(k) { d.click(j); if (!g.history) { return k.preventDefault() } }) }); if (g.history) { e.history(function(j, k) { d.click(k || 0) }) } if (location.hash) { d.click(location.hash) } else { d.click(g.initialIndex) } f.find("a[href^=#]").click(function() { d.click(c(this).attr("href")) }) } c.fn.tabs = function(g, d) { var e = this.eq(typeof conf == "number" ? conf : 0).data("tabs"); if (e) { return e } var f = { tabs: "a", current: "current", onBeforeClick: null, onClick: null, effect: "default", history: false, initialIndex: 0, event: "click", api: false }; if (c.isFunction(d)) { d = { onBeforeClick: d} } c.extend(f, d); this.each(function() { var h = c(this).find(f.tabs); if (!h.length) { h = c(this).children() } var i = g.jquery ? g : c(g); e = new a(h, i, f); c(this).data("tabs", e) }); return f.api ? e : this } })(jQuery); (function(b) { var c, a; b.prototype.history = function(e) { var d = this; if (b.browser.msie) { if (!a) { a = b("<iframe />").hide().get(0); b("body").append(a); setInterval(function() { var f = a.contentWindow.document; var g = f.location.hash; if (c !== g) { b.event.trigger("hash", g); c = g } }, 100) } d.bind("click.hash", function(g) { var f = a.contentWindow.document; f.open().close(); f.location.hash = b(this).attr("href") }); d.eq(0).triggerHandler("click.hash") } else { setInterval(function() { var f = location.hash; if (d.filter("[href*=" + f + "]").length && f !== c) { c = f; b.event.trigger("hash", f) } }, 100) } b(window).bind("hash", e); return this } })(jQuery);
(function(c) { c.tools = c.tools || { version: {} }; c.tools.version.tooltip = "1.0.2"; var b = { toggle: [function() { this.getTip().show() }, function() { this.getTip().hide() } ], fade: [function() { this.getTip().fadeIn(this.getConf().fadeInSpeed) }, function() { this.getTip().fadeOut(this.getConf().fadeOutSpeed) } ] }; c.tools.addTipEffect = function(d, f, e) { b[d] = [f, e] }; c.tools.addTipEffect("slideup", function() { var d = this.getConf(); var e = d.slideOffset || 10; this.getTip().css({ opacity: 0 }).animate({ top: "-=" + e, opacity: d.opacity }, d.slideInSpeed || 200).show() }, function() { var d = this.getConf(); var e = d.slideOffset || 10; this.getTip().animate({ top: "-=" + e, opacity: 0 }, d.slideOutSpeed || 200, function() { c(this).hide().animate({ top: "+=" + (e * 2) }, 0) }) }); function a(f, e) { var d = this; var h = f.next(); if (e.tip) { if (e.tip.indexOf("#") != -1) { h = c(e.tip) } else { h = f.nextAll(e.tip).eq(0); if (!h.length) { h = f.parent().nextAll(e.tip).eq(0) } } } function j(k, l) { c(d).bind(k, function(n, m) { if (l && l.call(this) === false && m) { m.proceed = false } }); return d } c.each(e, function(k, l) { if (c.isFunction(l)) { j(k, l) } }); var g = f.is("input, textarea"); f.bind(g ? "focus" : "mouseover", function(k) { k.target = this; d.show(k); h.hover(function() { d.show() }, function() { d.hide() }) }); f.bind(g ? "blur" : "mouseout", function() { d.hide() }); h.css("opacity", e.opacity); var i = 0; c.extend(d, { show: function(q) { if (q) { f = c(q.target) } clearTimeout(i); if (h.is(":animated") || h.is(":visible")) { return d } var o = { proceed: true }; c(d).trigger("onBeforeShow", o); if (!o.proceed) { return d } var n = f.position().top - h.outerHeight(); var k = h.outerHeight() + f.outerHeight(); var r = e.position[0]; if (r == "center") { n += k / 2 } if (r == "bottom") { n += k } var l = f.outerWidth() + h.outerWidth(); var m = f.position().left + f.outerWidth(); r = e.position[1]; if (r == "center") { m -= l / 2 } if (r == "left") { m -= l } n += e.offset[0]; m += e.offset[1]; h.css({ position: "absolute", top: n, left: m }); b[e.effect][0].call(d); c(d).trigger("onShow"); return d }, hide: function() { clearTimeout(i); i = setTimeout(function() { if (!h.is(":visible")) { return d } var k = { proceed: true }; c(d).trigger("onBeforeHide", k); if (!k.proceed) { return d } b[e.effect][1].call(d); c(d).trigger("onHide") }, e.delay || 1); return d }, isShown: function() { return h.is(":visible, :animated") }, getConf: function() { return e }, getTip: function() { return h }, getTrigger: function() { return f }, onBeforeShow: function(k) { return j("onBeforeShow", k) }, onShow: function(k) { return j("onShow", k) }, onBeforeHide: function(k) { return j("onBeforeHide", k) }, onHide: function(k) { return j("onHide", k) } }) } c.prototype.tooltip = function(d) { var e = this.eq(typeof d == "number" ? d : 0).data("tooltip"); if (e) { return e } var f = { tip: null, effect: "slideup", delay: 30, opacity: 1, position: ["top", "center"], offset: [0, 0], api: false }; if (c.isFunction(d)) { d = { onBeforeShow: d} } c.extend(f, d); this.each(function() { e = new a(c(this), f); c(this).data("tooltip", e) }); return f.api ? e : this } })(jQuery);
$(function() {
    var rotateDelay = 8000; //milliseconds 
    var rotateTabs = true;
    var $tabItems = $('#feature ul li a').click(function() { //clicking a tab should cancel the rotate 
        rotateTabs = false;
    });
    var tabs = $("#feature ul.tabs").tabs('#feature div.panels > div', { api: true, effect: 'fade' }); //create the tabs and return the api 
    function doRotateTabs() { //recursive function 
        if (rotateTabs) {
            setTimeout(function() {
                if (!rotateTabs) return;
                if (tabs.getIndex() == $tabItems.length - 1) { //last tab. restart on first tab 
                    tabs.click(0);
                }
                else {
                    tabs.next();
                }
                doRotateTabs();
            }, rotateDelay);
        }
    }
    doRotateTabs();
});
