/*
* built to be used with jQuery library
* http://jquery.com
* 
* update: May 30th 2010
* 
*/

/* 
* flowplayer.js 3.2.0. The Flowplayer API
* 
* Copyright 2009 Flowplayer Oy
* 
* This file is part of Flowplayer.
* 
* Flowplayer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* Flowplayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
* 
* Date: 2010-05-03 20:23:59 +0000 (Mon, 03 May 2010)
* Revision: 468 
*/
(function () { function g(o) { console.log("$f.fireEvent", [].slice.call(o)) } function k(q) { if (!q || typeof q != "object") { return q } var o = new q.constructor(); for (var p in q) { if (q.hasOwnProperty(p)) { o[p] = k(q[p]) } } return o } function m(t, q) { if (!t) { return } var o, p = 0, r = t.length; if (r === undefined) { for (o in t) { if (q.call(t[o], o, t[o]) === false) { break } } } else { for (var s = t[0]; p < r && q.call(s, p, s) !== false; s = t[++p]) { } } return t } function c(o) { return document.getElementById(o) } function i(q, p, o) { if (typeof p != "object") { return q } if (q && p) { m(p, function (r, s) { if (!o || typeof s != "function") { q[r] = s } }) } return q } function n(s) { var q = s.indexOf("."); if (q != -1) { var p = s.slice(0, q) || "*"; var o = s.slice(q + 1, s.length); var r = []; m(document.getElementsByTagName(p), function () { if (this.className && this.className.indexOf(o) != -1) { r.push(this) } }); return r } } function f(o) { o = o || window.event; if (o.preventDefault) { o.stopPropagation(); o.preventDefault() } else { o.returnValue = false; o.cancelBubble = true } return false } function j(q, o, p) { q[o] = q[o] || []; q[o].push(p) } function e() { return "_" + ("" + Math.random()).slice(2, 10) } var h = function (t, r, s) { var q = this, p = {}, u = {}; q.index = r; if (typeof t == "string") { t = { url: t} } i(this, t, true); m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","), function () { var v = "on" + this; if (v.indexOf("*") != -1) { v = v.slice(0, v.length - 1); var w = "onBefore" + v.slice(2); q[w] = function (x) { j(u, w, x); return q } } q[v] = function (x) { j(u, v, x); return q }; if (r == -1) { if (q[w]) { s[w] = q[w] } if (q[v]) { s[v] = q[v] } } }); i(this, { onCuepoint: function (x, w) { if (arguments.length == 1) { p.embedded = [null, x]; return q } if (typeof x == "number") { x = [x] } var v = e(); p[v] = [x, w]; if (s.isLoaded()) { s._api().fp_addCuepoints(x, r, v) } return q }, update: function (w) { i(q, w); if (s.isLoaded()) { s._api().fp_updateClip(w, r) } var v = s.getConfig(); var x = (r == -1) ? v.clip : v.playlist[r]; i(x, w, true) }, _fireEvent: function (v, y, w, A) { if (v == "onLoad") { m(p, function (B, C) { if (C[0]) { s._api().fp_addCuepoints(C[0], r, B) } }); return false } A = A || q; if (v == "onCuepoint") { var z = p[y]; if (z) { return z[1].call(s, A, w) } } if (y && "onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v) != -1) { i(A, y); if (y.metaData) { if (!A.duration) { A.duration = y.metaData.duration } else { A.fullDuration = y.metaData.duration } } } var x = true; m(u[v], function () { x = this.call(s, A, y, w) }); return x } }); if (t.onCuepoint) { var o = t.onCuepoint; q.onCuepoint.apply(q, typeof o == "function" ? [o] : o); delete t.onCuepoint } m(t, function (v, w) { if (typeof w == "function") { j(u, v, w); delete t[v] } }); if (r == -1) { s.onCuepoint = this.onCuepoint } }; var l = function (p, r, q, t) { var o = this, s = {}, u = false; if (t) { i(s, t) } m(r, function (v, w) { if (typeof w == "function") { s[v] = w; delete r[v] } }); i(this, { animate: function (y, z, x) { if (!y) { return o } if (typeof z == "function") { x = z; z = 500 } if (typeof y == "string") { var w = y; y = {}; y[w] = z; z = 500 } if (x) { var v = e(); s[v] = x } if (z === undefined) { z = 500 } r = q._api().fp_animate(p, y, z, v); return o }, css: function (w, x) { if (x !== undefined) { var v = {}; v[w] = x; w = v } r = q._api().fp_css(p, w); i(o, r); return o }, show: function () { this.display = "block"; q._api().fp_showPlugin(p); return o }, hide: function () { this.display = "none"; q._api().fp_hidePlugin(p); return o }, toggle: function () { this.display = q._api().fp_togglePlugin(p); return o }, fadeTo: function (y, x, w) { if (typeof x == "function") { w = x; x = 500 } if (w) { var v = e(); s[v] = w } this.display = q._api().fp_fadeTo(p, y, x, v); this.opacity = y; return o }, fadeIn: function (w, v) { return o.fadeTo(1, w, v) }, fadeOut: function (w, v) { return o.fadeTo(0, w, v) }, getName: function () { return p }, getPlayer: function () { return q }, _fireEvent: function (w, v, x) { if (w == "onUpdate") { var y = q._api().fp_getPlugin(p); if (!y) { return } i(o, y); delete o.methods; if (!u) { m(y.methods, function () { var A = "" + this; o[A] = function () { var B = [].slice.call(arguments); var C = q._api().fp_invoke(p, A, B); return C === "undefined" || C === undefined ? o : C } }); u = true } } var z = s[w]; if (z) { z.apply(o, v); if (w.slice(0, 1) == "_") { delete s[w] } } return o } }) }; function b(q, G, t) { var w = this, v = null, D = false, u, s, F = [], y = {}, x = {}, E, r, p, C, o, A; i(w, { id: function () { return E }, isLoaded: function () { return (v !== null && !D) }, getParent: function () { return q }, hide: function (H) { if (H) { q.style.height = "0px" } if (w.isLoaded()) { v.style.height = "0px" } return w }, show: function () { q.style.height = A + "px"; if (w.isLoaded()) { v.style.height = o + "px" } return w }, isHidden: function () { return w.isLoaded() && parseInt(v.style.height, 10) === 0 }, load: function (J) { if (!w.isLoaded() && w._fireEvent("onBeforeLoad") !== false) { var H = function () { u = q.innerHTML; if (u && !flashembed.isSupported(G.version)) { q.innerHTML = "" } flashembed(q, G, { config: t }); if (J) { J.cached = true; j(x, "onLoad", J) } }; var I = 0; m(a, function () { this.unload(function (K) { if (++I == a.length) { H() } }) }) } return w }, unload: function (J) { if (this.isFullscreen() && /WebKit/i.test(navigator.userAgent)) { if (J) { J(false) } return w } if (u.replace(/\s/g, "") !== "") { if (w._fireEvent("onBeforeUnload") === false) { if (J) { J(false) } return w } D = true; try { if (v) { v.fp_close(); w._fireEvent("onUnload") } } catch (H) { } var I = function () { v = null; q.innerHTML = u; D = false; if (J) { J(true) } }; setTimeout(I, 50) } else { if (J) { J(false) } } return w }, getClip: function (H) { if (H === undefined) { H = C } return F[H] }, getCommonClip: function () { return s }, getPlaylist: function () { return F }, getPlugin: function (H) { var J = y[H]; if (!J && w.isLoaded()) { var I = w._api().fp_getPlugin(H); if (I) { J = new l(H, I, w); y[H] = J } } return J }, getScreen: function () { return w.getPlugin("screen") }, getControls: function () { return w.getPlugin("controls")._fireEvent("onUpdate") }, getLogo: function () { try { return w.getPlugin("logo")._fireEvent("onUpdate") } catch (H) { } }, getPlay: function () { return w.getPlugin("play")._fireEvent("onUpdate") }, getConfig: function (H) { return H ? k(t) : t }, getFlashParams: function () { return G }, loadPlugin: function (K, J, M, L) { if (typeof M == "function") { L = M; M = {} } var I = L ? e() : "_"; w._api().fp_loadPlugin(K, J, M, I); var H = {}; H[I] = L; var N = new l(K, null, w, H); y[K] = N; return N }, getState: function () { return w.isLoaded() ? v.fp_getState() : -1 }, play: function (I, H) { var J = function () { if (I !== undefined) { w._api().fp_play(I, H) } else { w._api().fp_play() } }; if (w.isLoaded()) { J() } else { if (D) { setTimeout(function () { w.play(I, H) }, 50) } else { w.load(function () { J() }) } } return w }, getVersion: function () { var I = "flowplayer.js 3.2.0"; if (w.isLoaded()) { var H = v.fp_getVersion(); H.push(I); return H } return I }, _api: function () { if (!w.isLoaded()) { throw "Flowplayer " + w.id() + " not loaded when calling an API method" } return v }, setClip: function (H) { w.setPlaylist([H]); return w }, getIndex: function () { return p } }); m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","), function () { var H = "on" + this; if (H.indexOf("*") != -1) { H = H.slice(0, H.length - 1); var I = "onBefore" + H.slice(2); w[I] = function (J) { j(x, I, J); return w } } w[H] = function (J) { j(x, H, J); return w } }); m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","), function () { var H = this; w[H] = function (J, I) { if (!w.isLoaded()) { return w } var K = null; if (J !== undefined && I !== undefined) { K = v["fp_" + H](J, I) } else { K = (J === undefined) ? v["fp_" + H]() : v["fp_" + H](J) } return K === "undefined" || K === undefined ? w : K } }); w._fireEvent = function (Q) { if (typeof Q == "string") { Q = [Q] } var R = Q[0], O = Q[1], M = Q[2], L = Q[3], K = 0; if (t.debug) { g(Q) } if (!w.isLoaded() && R == "onLoad" && O == "player") { v = v || c(r); o = v.clientHeight; m(F, function () { this._fireEvent("onLoad") }); m(y, function (S, T) { T._fireEvent("onUpdate") }); s._fireEvent("onLoad") } if (R == "onLoad" && O != "player") { return } if (R == "onError") { if (typeof O == "string" || (typeof O == "number" && typeof M == "number")) { O = M; M = L } } if (R == "onContextMenu") { m(t.contextMenu[O], function (S, T) { T.call(w) }); return } if (R == "onPluginEvent") { var H = O.name || O; var I = y[H]; if (I) { I._fireEvent("onUpdate", O); I._fireEvent(M, Q.slice(3)) } return } if (R == "onPlaylistReplace") { F = []; var N = 0; m(O, function () { F.push(new h(this, N++, w)) }) } if (R == "onClipAdd") { if (O.isInStream) { return } O = new h(O, M, w); F.splice(M, 0, O); for (K = M + 1; K < F.length; K++) { F[K].index++ } } var P = true; if (typeof O == "number" && O < F.length) { C = O; var J = F[O]; if (J) { P = J._fireEvent(R, M, L) } if (!J || P !== false) { P = s._fireEvent(R, M, L, J) } } m(x[R], function () { P = this.call(w, O, M); if (this.cached) { x[R].splice(K, 1) } if (P === false) { return false } K++ }); return P }; function B() { if ($f(q)) { $f(q).getParent().innerHTML = ""; p = $f(q).getIndex(); a[p] = w } else { a.push(w); p = a.length - 1 } A = parseInt(q.style.height, 10) || q.clientHeight; E = q.id || "fp" + e(); r = G.id || E + "_api"; G.id = r; t.playerId = E; if (typeof t == "string") { t = { clip: { url: t}} } if (typeof t.clip == "string") { t.clip = { url: t.clip} } t.clip = t.clip || {}; if (q.getAttribute("href", 2) && !t.clip.url) { t.clip.url = q.getAttribute("href", 2) } s = new h(t.clip, -1, w); t.playlist = t.playlist || [t.clip]; var H = 0; m(t.playlist, function () { var J = this; if (typeof J == "object" && J.length) { J = { url: "" + J} } m(t.clip, function (K, L) { if (L !== undefined && J[K] === undefined && typeof L != "function") { J[K] = L } }); t.playlist[H] = J; J = new h(J, H, w); F.push(J); H++ }); m(t, function (J, K) { if (typeof K == "function") { if (s[J]) { s[J](K) } else { j(x, J, K) } delete t[J] } }); m(t.plugins, function (J, K) { if (K) { y[J] = new l(J, K, w) } }); if (!t.plugins || t.plugins.controls === undefined) { y.controls = new l("controls", null, w) } y.canvas = new l("canvas", null, w); function I(J) { if (!w.isLoaded() && w._fireEvent("onBeforeClick") !== false) { w.load() } return f(J) } u = q.innerHTML; if (u.replace(/\s/g, "") !== "") { if (q.addEventListener) { q.addEventListener("click", I, false) } else { if (q.attachEvent) { q.attachEvent("onclick", I) } } } else { if (q.addEventListener) { q.addEventListener("click", f, false) } w.load() } } if (typeof q == "string") { var z = c(q); if (!z) { throw "Flowplayer cannot access element: " + q } else { q = z; B() } } else { B() } } var a = []; function d(o) { this.length = o.length; this.each = function (p) { m(o, p) }; this.size = function () { return o.length } } window.flowplayer = window.$f = function () { var p = null; var o = arguments[0]; if (!arguments.length) { m(a, function () { if (this.isLoaded()) { p = this; return false } }); return p || a[0] } if (arguments.length == 1) { if (typeof o == "number") { return a[o] } else { if (o == "*") { return new d(a) } m(a, function () { if (this.id() == o.id || this.id() == o || this.getParent() == o) { p = this; return false } }); return p } } if (arguments.length > 1) { var t = arguments[1], q = (arguments.length == 3) ? arguments[2] : {}; if (typeof t == "string") { t = { src: t} } t = i({ bgcolor: "#000000", version: [9, 0], expressInstall: "http://static.flowplayer.org/swf/expressinstall.swf", cachebusting: true }, t); if (typeof o == "string") { if (o.indexOf(".") != -1) { var s = []; m(n(o), function () { s.push(new b(this, k(t), k(q))) }); return new d(s) } else { var r = c(o); return new b(r !== null ? r : o, t, q) } } else { if (o) { return new b(o, t, q) } } } return null }; i(window.$f, { fireEvent: function () { var o = [].slice.call(arguments); var q = $f(o[0]); return q ? q._fireEvent(o.slice(1)) : null }, addPlugin: function (o, p) { b.prototype[o] = p; return $f }, each: m, extend: i }); if (typeof jQuery == "function") { jQuery.fn.flowplayer = function (q, p) { if (!arguments.length || typeof arguments[0] == "number") { var o = []; this.each(function () { var r = $f(this); if (r) { o.push(r) } }); return arguments.length ? o[arguments[0]] : new d(o) } return this.each(function () { $f(this, k(q), p ? k(p) : {}) }) } } })(); (function () { var h = document.all, j = "http://www.adobe.com/go/getflashplayer", c = typeof jQuery == "function", e = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/, b = { width: "100%", height: "100%", id: "_" + ("" + Math.random()).slice(9), allowfullscreen: true, allowscriptaccess: "always", quality: "high", version: [3, 0], onFail: null, expressInstall: null, w3c: false, cachebusting: false }; if (window.attachEvent) { window.attachEvent("onbeforeunload", function () { __flash_unloadHandler = function () { }; __flash_savedUnloadHandler = function () { } }) } function i(l, f) { if (f) { for (key in f) { if (f.hasOwnProperty(key)) { l[key] = f[key] } } } return l } function a(f, n) { var m = []; for (var l in f) { if (f.hasOwnProperty(l)) { m[l] = n(f[l]) } } return m } window.flashembed = function (f, m, l) { if (typeof f == "string") { f = document.getElementById(f.replace("#", "")) } if (!f) { return } if (typeof m == "string") { m = { src: m} } return new d(f, i(i({}, b), m), l) }; var g = i(window.flashembed, { conf: b, getVersion: function () { var f; try { f = navigator.plugins["Shockwave Flash"].description.slice(16) } catch (n) { try { var l = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); f = l && l.GetVariable("$version") } catch (m) { } } f = e.exec(f); return [f[1], f[3]] }, asString: function (l) { if (l === null || l === undefined) { return null } var f = typeof l; if (f == "object" && l.push) { f = "array" } switch (f) { case "string": l = l.replace(new RegExp('(["\\\\])', "g"), "\\$1"); l = l.replace(/^\s?(\d+\.?\d+)%/, "$1pct"); return '"' + l + '"'; case "array": return "[" + a(l, function (o) { return g.asString(o) }).join(",") + "]"; case "function": return '"function()"'; case "object": var m = []; for (var n in l) { if (l.hasOwnProperty(n)) { m.push('"' + n + '":' + g.asString(l[n])) } } return "{" + m.join(",") + "}" } return String(l).replace(/\s/g, " ").replace(/\'/g, '"') }, getHTML: function (o, l) { o = i({}, o); var n = '<object width="' + o.width + '" height="' + o.height + '" id="' + o.id + '"" name="' + o.id + '"'; if (o.cachebusting) { o.src += ((o.src.indexOf("?") != -1 ? "&" : "?") + Math.random()) } if (o.w3c || !h) { n += ' data="' + o.src + '" type="application/x-shockwave-flash"' } else { n += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' } n += ">"; if (o.w3c || h) { n += '<param name="movie" value="' + o.src + '" />' } o.width = o.height = o.id = o.w3c = o.src = null; o.onFail = o.version = o.expressInstall = null; for (var m in o) { if (o[m]) { n += '<param name="' + m + '" value="' + o[m] + '" />' } } var p = ""; if (l) { for (var f in l) { if (l[f]) { var q = l[f]; p += f + "=" + (/function|object/.test(typeof q) ? g.asString(q) : q) + "&" } } p = p.slice(0, -1); n += '<param name="flashvars" value=\'' + p + "' />" } n += "</object>"; return n }, isSupported: function (f) { return k[0] > f[0] || k[0] == f[0] && k[1] >= f[1] } }); var k = g.getVersion(); function d(f, n, m) { if (g.isSupported(n.version)) { f.innerHTML = g.getHTML(n, m) } else { if (n.expressInstall && g.isSupported([6, 65])) { f.innerHTML = g.getHTML(i(n, { src: n.expressInstall }), { MMredirectURL: location.href, MMplayerType: "PlugIn", MMdoctitle: document.title }) } else { if (!f.innerHTML.replace(/\s/g, "")) { f.innerHTML = "<h2>Flash version " + n.version + " or greater is required</h2><h3>" + (k[0] > 0 ? "Your version is " + k : "You have no flash plugin installed") + "</h3>" + (f.tagName == "A" ? "<p>Click here to download latest version</p>" : "<p>Download latest version from <a href='" + j + "'>here</a></p>"); if (f.tagName == "A") { f.onclick = function () { location.href = j } } } if (n.onFail) { var l = n.onFail.call(this); if (typeof l == "string") { f.innerHTML = l } } } } if (h) { window[n.id] = document.getElementById(n.id) } i(this, { getRoot: function () { return f }, getOptions: function () { return n }, getConf: function () { return m }, getApi: function () { return f.firstChild } }) } if (c) { jQuery.tools = jQuery.tools || { version: "3.2.0" }; jQuery.tools.flashembed = { conf: b }; jQuery.fn.flashembed = function (l, f) { return this.each(function () { $(this).data("flashembed", flashembed(this, l, f)) }) } } })();

(function($) {
    $.utility = {
        navigation: function(options) {
            var defaults = {
                selector: '#nav li',
                className: 'over'
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function() {
                $(this).hover(function() {
                    $('ul:first', this).fadeIn(100);
                    $(this).addClass(options.className)
                },
                function() {
                    $('ul', this).hide();
                    $(this).removeClass(options.className)
                })
            })
        },
        tooltip: function(options) {
            var defaults = {
                selector: '.tooltip',
                xOffset: 10,
                yOffset: -25,
                clickRemove: false,
                id: 'easy_tooltip',
                content: '',
                useElement: ''
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            var content;
            return $(options.selector).each(function() {
                var title = $(this).attr('title');
                $(this).hover(function(e) {
                    content = (options.content != '') ? options.content: title;
                    content = (options.useElement != '') ? $('#' + options.useElement).html() : content;
                    $(this).attr('title', '');
                    if (content != '' && content != undefined) {
                        $('body').append('<div id="' + options.id + '">' + content + '</div>');
                        $('#' + options.id).css({
                            'position': 'absolute',
                            'display': 'none'
                        }).css('top', (e.pageY - options.yOffset) + 'px').css('left', (e.pageX + options.xOffset) + 'px').fadeIn('fast')
                    }
                },
                function() {
                    $('#' + options.id).remove();
                    $(this).attr('title', title)
                });
                $(this).mousemove(function(e) {
                    var x = ((e.pageX + options.xOffset + $(this).width()) < $(window).width()) ? (e.pageX + options.xOffset) : (e.pageX - options.xOffset - $(this).width() - 16);
                    $('#' + options.id).css('top', (e.pageY - options.yOffset) + 'px').css('left', (x + 'px'))
                });
                if (options.clickRemove) {
                    $(this).mousedown(function(e) {
                        $('#' + options.id).remove();
                        $(this).attr('title', title)
                    })
                }
            })
        },
        popup: function(options) {
            var defaults = {
                selector: '.popup',
                popupId: 'easy_popup',
                preloadText: 'Yükleniyor...',
                errorText: 'There has been a problem with your request, please click outside this window to close it.',
                closeText: 'Kapat',
                prevText: '&laquo; Önceki',
                nextText: 'Sonraki &raquo;'
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function(i) {
                if ($(this).hasClass('gallery')) {
                    var classNames = $(this).attr('class');
                    classNames = classNames.split(' ').join('');
                    $.data(this, 'gallery', classNames);
                    eval('if((typeof ' + classNames + '_arr == "undefined")) ' + classNames + '_arr= new Array()');
                    eval(classNames + '_arr').push($(this));
                    $.data(this, 'index', eval(classNames + '_arr').length - 1)
                };
                $(this).bind('click',
                function(e) {
                    e.preventDefault();
                    if ($.browser.opera) $.support.opacity = true;
                    var ie6 = $.browser.msie && $.browser.version.substr(0, 1) < 7;
                    var opera95 = $.browser.opera && $.browser.version <= 9.5;
                    var w = $(window).width();
                    var h = $(document).height();
                    var w2 = $(window).width() / 2;
                    var h2 = $(window).height() / 2;
                    show = function() {
                        $('#' + options.popupId + 'preloader').remove();
                        if (cw != 0) $('#' + options.popupId + 'content').css('width', cw + 'px');
                        if (ch != 0) $('#' + options.popupId + 'content').css('height', ch + 'px');
                        set($('#' + options.popupId + 'content'));
                        $('#' + options.popupId + 'content').css('visibility', 'visible')
                    };
                    set = function(obj) {
                        $(obj).css({
                            'padding': '10px',
                            'background': '#fff',
                            'color': '#333',
                            'text-align': 'left',
                            'float': 'left',
                            'position': 'fixed',
                            'z-index': '10001',
                            'visible': 'hidden'
                        });
                        var left = w2 - $(obj).width() / 2 - 10;
                        var top = h2 - $(obj).height() / 2;
                        $(obj).css({
                            'left': left,
                            'top': top,
                            'display': 'none'
                        }).fadeIn('1000');
                        if (ie6) $(obj).css({
                            'position': 'absolute',
                            'top': (top + $(window).scrollTop()) + 'px'
                        });
                        if (opera95) $(obj).css({
                            'position': 'absolute',
                            'top': (document.body['clientHeight'] / 2 - $(obj).height() / 2 + $(window).scrollTop()) + 'px'
                        });
                        $('.caption', obj).css({
                            'width': $(obj).width() + 'px',
                            'display': 'block'
                        })
                    };
                    if (ie6) $('embed, object, select').css('visibility', 'hidden');
                    error = function() {
                        $('#' + options.popupId + 'content').text(options.errorText);
                        show()
                    };
                    remove = function() {
                        $('#' + options.popupId).remove();
                        $('#' + options.popupId + 'content').remove();
                        $('#' + options.popupId + 'preloader').remove();
                        if (ie6) $('embed, object, select').css('visibility', 'visible')
                    };
                    if ($('#' + options.popupId).length == 0) {
                        $('<div id="' + options.popupId + '"></div>').appendTo('body').css({
                            'width': w,
                            'height': h,
                            'background': '#000',
                            'position': 'absolute',
                            'top': '0',
                            'left': '0',
                            'z-index': '10000',
                            'opacity': .7
                        }).click(function() {
                            remove()
                        })
                    };
                    var href = $(this).attr('href');
                    var extension = href.substr(href.lastIndexOf('.')).toLowerCase();
                    var content;
                    var cw = 0;
                    var ch = 0;
                    var showOk = false;
                    $('<div id="' + options.popupId + 'preloader">' + options.preloadText + '</div>').appendTo('body');
                    set($('#' + options.popupId + 'preloader'));
                    $('<div id="' + options.popupId + 'content"></div>').appendTo('body');
                    $('#' + options.popupId + 'content').css({
                        'visibility': 'hidden',
                        'position': 'absolute',
                        'top': '-10000px',
                        'left': '-10000px'
                    });
                    if ($(this).hasClass('flash')) {
                        var flash = '<object width="100%" height="100%"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="' + href + '" /><embed src="' + href + '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%"></embed></object>';
                        $(flash).appendTo('#' + options.popupId + 'content');
                        cw = 600;
                        ch = 400;
                        showOk = true
                    } else {
                        if (extension == '.jpg' || extension == '.jpeg' || extension == '.gif' || extension == '.png' || extension == '.bmp') {
                            var img = new Image();
                            $(img).error(function() {
                                error()
                            }).appendTo('#' + options.popupId + 'content');
                            img.onload = function() {
                                show();
                                img.onload = function() {}
                            };
                            img.src = href + '?' + (new Date()).getTime() + ' =' + (new Date()).getTime()
                        } else if (href.charAt(0) == '#') {
                            $(href).clone().removeClass('hidden').appendTo('#' + options.popupId + 'content').show();
                            $.easy.forms('#' + options.popupId + 'content form');
                            showOk = true
                        } else {
                            $('<iframe frameborder="0" scrolling="auto" style="width:100%;height:100%" src="' + href + '" />').appendTo('#' + options.popupId + 'content');
                            cw = 960;
                            ch = 500;
                            showOk = true
                        }
                    };
                    var rel = $(this).attr('rel').split(';');
                    $.each(rel,
                    function(i) {
                        if (rel[i].indexOf('width') != -1) cw = rel[i].split(':')[1];
                        if (rel[i].indexOf('height') != -1) ch = rel[i].split(':')[1]
                    });
                    if ($(this).attr('title') != '') {
                        $('<span class="caption">' + $(this).attr('title') + '</span>').appendTo('#' + options.popupId + 'content').css({
                            'display': 'none',
                            'padding': '10px 0 0 0'
                        })
                    };
                    if (showOk) show();
                    $('<small>' + options.closeText + '</small>').appendTo('#' + options.popupId + 'content').css({
                        'position': 'absolute',
                        'float': 'left',
                        'right': '0',
                        'top': '-24px',
                        'color': '#fff',
                        'cursor': 'pointer'
                    }).click(function() {
                        remove()
                    });
                    if ($(this).hasClass('gallery')) {
                        var arr = $.data(this, 'gallery');
                        arr = eval(arr + '_arr');
                        var index = $.data(this, 'index');
                        if (arr.length > 1) {
                            $('<small>' + (index + 1) + '/' + arr.length + '</small>').appendTo('#' + options.popupId + 'content').css({
                                'position': 'absolute',
                                'float': 'right',
                                'right': '0',
                                'bottom': '-24px',
                                'color': '#fff',
                                'cursor': 'pointer'
                            });
                            $('<small id="' + options.popupId + 'gallery"></small>').appendTo('#' + options.popupId + 'content').css({
                                'position': 'absolute',
                                'float': 'left',
                                'left': '0',
                                'bottom': '-24px',
                                'color': '#fff',
                                'cursor': 'pointer'
                            });
                            if (index != 0) {
                                $('<span>' + options.prevText + '</span>').css('margin-right', '5px').appendTo('#' + options.popupId + 'gallery').click(function() {
                                    $('#' + options.popupId + 'content').remove();
                                    var obj = arr[index - 1];
                                    $(obj).trigger('click')
                                })
                            }
                            if (index < arr.length - 1) {
                                $('<span>' + options.nextText + '</span>').appendTo('#' + options.popupId + 'gallery').click(function() {
                                    $('#' + options.popupId + 'content').remove();
                                    var obj = arr[index + 1];
                                    $(obj).trigger('click')
                                })
                            }
                        }
                    }
                })
            })
        },
        external: function(options) {
            var defaults = {
                selector: 'a'
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            var hostname = window.location.hostname;
            hostname = hostname.replace('www.', '').toLowerCase();
            return $(options.selector).each(function() {
                var href = $(this).attr('href').toLowerCase();
                if (href.indexOf('http://') != -1 && href.indexOf(hostname) == -1) {
                    $(this).attr('target', '_blank');
                    $(this).addClass('external')
                }
            })
        },
        rotate: function(options) {
            var defaults = {
                selector: '.rotate',
                initPause: 0,
                pause: 5000,
                randomize: false
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function() {
                var obj = $(this);
                var length = $(obj).children().length;
                var temp = 0;
                function getRan() {
                    var ran = Math.floor(Math.random() * length) + 1;
                    return ran
                };
                function show() {
                    if (options.randomize) {
                        var ran = getRan();
                        while (ran == temp) {
                            ran = getRan()
                        };
                        temp = ran
                    } else {
                        temp = (temp == length) ? 1 : temp + 1
                    };
                    $(obj).children().hide();
                    $(':nth-child(' + temp + ')', obj).fadeIn('slow')
                };
                function init() {
                    show();
                    setInterval(show, options.pause)
                };
                setTimeout(init, options.initPause)
            })
        },
        cycle: function(options) {
            var defaults = {
                selector: '.cycle',
                effect: 'fade',
                initPause: 0,
                pause: 5000
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function() {
                var obj = $(this);
                var length = $(obj).children().length;
                var temp = 0;
                var prev = -1;
                var z = 1;
                var h = $(':nth-child(1)', obj).height();
                $(obj).css('position', 'relative').height(h);
                $(obj).children().hide().css({
                    'position': 'absolute',
                    'top': '0',
                    'left': '0'
                });
                function show() {
                    temp = (temp == length) ? 1 : temp + 1;
                    prev = (temp == 1) ? length: temp - 1;
                    $(':nth-child(' + temp + ')', obj).css('z-index', z).fadeIn('slow',
                    function() {
                        $(':nth-child(' + prev + ')', obj).fadeOut('slow')
                    });
                    z++
                };
                function init() {
                    show();
                    setInterval(show, options.pause)
                };
                setTimeout(init, options.initPause)
            })
        },
        jump: function(options) {
            var defaults = {
                selector: 'a.jump',
                speed: 1000
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).click(function() {
                var target = $($(this).attr('href'));
                var offset = $(target).offset().top;
                $('html,body').animate({
                    scrollTop: offset
                },
                1000, 'linear')
            })
        },
        showhide: function(options) {
            var defaults = {
                selector: '.toggle'
            };
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function() {
                var target;
                if ($(this).hasClass('prev')) {
                    target = $(this).prev().hide()
                } else if ($(this).hasClass('id')) {
                    target = $(this).attr('href');
                    target = $(target).hide()
                } else {
                    target = $(this).next().hide()
                };
                $(this).css('cursor', 'pointer');
                $(this).toggle(function() {
                    $(this).addClass('expanded');
                    $(target).slideDown()
                },
                function() {
                    $(target).slideUp();
                    $(this).removeClass('expanded')
                })
            })
        },
        forms: function(options) {
            var defaults = {
                selector: 'form',
                err: 'This is required',
                errEmail: 'Valid email address is required',
                errUrl: 'URL is required',
                errPhone: 'Phone number is required',
                notValidClass: 'notvalid'
            };
            function check(obj) {
                if ($(obj).val() == '' || checkLabel(obj)) {
                    var errormsg = ($(obj).attr('title') != '') ? $(obj).attr('title') : options.err;
                    error(obj, errormsg)
                }
            };
            function checkRegEx(obj, type) {
                var regEx, err;
                switch (type) {
                case 'url':
                    regEx = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
                    err = options.errUrl;
                    break;
                case 'phone':
                    var regEx = /[\d\s_-]/;
                    err = options.errPhone;
                    break;
                default:
                    regEx = /^[^@]+@[^@]+.[a-z]{2,}$/;
                    err = options.errEmail
                };
                var val = $(obj).val();
                if (val.search(regEx) == -1 || checkLabel(obj)) {
                    var errormsg = ($(obj).attr('title') != '') ? $(obj).attr('title') : err;
                    error(obj, errormsg)
                }
            };
            function checkLabel(obj) {
                var text = $('label[for=' + $(obj).attr('id') + ']').text();
                return (text == $(obj).val())
            };
            function error(obj, errormsg) {
                var parent = $(obj).parent();
                parent.append('<span class="error">' + errormsg + '</span>');
                $('span.error', parent).hide().fadeIn('fast');
                $(obj).addClass(options.notValidClass);
                valid = false
            };
            $('input.label,textarea.label').each(function() {
                var text = $('label[for=' + $(this).attr('id') + ']').text();
                $('label[for=' + $(this).attr('id') + ']').css('display', 'none');
                $(this).val(text);
                $(this).focus(function() {
                    if ($(this).val() == text) $(this).val('')
                });
                $(this).blur(function() {
                    if ($(this).val() == '') $(this).val(text)
                })
            });
            if (typeof options == 'string') defaults.selector = options;
            var options = $.extend(defaults, options);
            return $(options.selector).each(function() {
                $(this).submit(function() {
                    $('.error', this).remove();
                    $('.' + options.notValidClass, this).removeClass(options.notValidClass);
                    valid = true;
                    $(':text.required', this).each(function() {
                        if ($(this).hasClass('email')) {
                            checkRegEx(this, 'email')
                        } else if ($(this).hasClass('url')) {
                            checkRegEx(this, 'url')
                        } else if ($(this).hasClass('phone')) {
                            checkRegEx(this, 'phone')
                        } else {
                            check(this)
                        }
                    });
                    $(':password.required', this).each(function() {
                        check(this)
                    });
                    $('textarea.required', this).each(function() {
                        check(this)
                    });
                    $(':checkbox.required', this).each(function() {
                        if (!$(this).attr('checked')) {
                            var errormsg = ($(this).attr('title') != '') ? $(this).attr('title') : options.err;
                            error(this, errormsg)
                        }
                    });
                    return valid
                })
            })
        }
    }
})(jQuery);

/*
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
*
* Uses the built In easIng capabilities added In jQuery 1.1
* to offer multiple easIng options
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
*   http://www.opensource.org/licenses/mit-license.php
*/

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend(jQuery.easing,
{
    easeInQuad: function (x, t, b, c, d) {
        return c * (t /= d) * t + b;
    },
    easeOutQuad: function (x, t, b, c, d) {
        return -c * (t /= d) * (t - 2) + b;
    },
    easeInOutQuad: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t + b;
        return -c / 2 * ((--t) * (t - 2) - 1) + b;
    },
    easeInCubic: function (x, t, b, c, d) {
        return c * (t /= d) * t * t + b;
    },
    easeOutCubic: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t + 1) + b;
    },
    easeInOutCubic: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t + 2) + b;
    },
    easeInQuart: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t + b;
    },
    easeOutQuart: function (x, t, b, c, d) {
        return -c * ((t = t / d - 1) * t * t * t - 1) + b;
    },
    easeInOutQuart: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
    },
    easeInQuint: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t * t + b;
    },
    easeOutQuint: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
    },
    easeInOutQuint: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
    },
    easeInSine: function (x, t, b, c, d) {
        return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
    },
    easeOutSine: function (x, t, b, c, d) {
        return c * Math.sin(t / d * (Math.PI / 2)) + b;
    },
    easeInOutSine: function (x, t, b, c, d) {
        return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
    },
    easeInExpo: function (x, t, b, c, d) {
        return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
    },
    easeOutExpo: function (x, t, b, c, d) {
        return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
    },
    easeInOutExpo: function (x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
    },
    easeInCirc: function (x, t, b, c, d) {
        return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
    },
    easeOutCirc: function (x, t, b, c, d) {
        return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
    },
    easeInOutCirc: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
        return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
    },
    easeInElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    },
    easeOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    },
    easeInOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    },
    easeInBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    },
    easeOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    },
    easeInOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    },
    easeInBounce: function (x, t, b, c, d) {
        return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;
    },
    easeOutBounce: function (x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b;
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
        }
    },
    easeInOutBounce: function (x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    }
});

/*
anythingSlider v1.2
    
By Chris Coyier: http://css-tricks.com
with major improvements by Doug Neiner: http://pixelgraphics.us/
based on work by Remy Sharp: http://jqueryfordesigners.com/


To use the navigationFormatter function, you must have a function that
accepts two paramaters, and returns a string of HTML text.
	
index = integer index (1 based);
panel = jQuery wrapped LI item this tab references
@return = Must return a string of HTML/Text
	
navigationFormatter: function(index, panel){
return index + " Panel"; // This would have each tab with the text 'X Panel' where X = index
}
*/

(function ($) {

    $.anythingSlider = function (el, options) {
        // To avoid scope issues, use 'base' instead of 'this'
        // to reference this class from internal events and functions.
        var base = this;

        // Access to jQuery and DOM versions of element
        base.$el = $(el);
        base.el = el;

        // Set up a few defaults
        base.currentPage = 1;
        base.timer = null;
        base.playing = false;

        // Add a reverse reference to the DOM object
        base.$el.data("AnythingSlider", base);

        base.init = function () {
            base.options = $.extend({}, $.anythingSlider.defaults, options);

            // Cache existing DOM elements for later 
            base.$wrapper = base.$el.find('> div').css('overflow', 'hidden');
            base.$slider = base.$wrapper.find('> ul');
            base.$items = base.$slider.find('> li');
            base.$single = base.$items.filter(':first');

            // Build the navigation if needed
            if (base.options.buildNavigation) base.buildNavigation();

            // Get the details
            base.singleWidth = base.$single.outerWidth();
            base.pages = base.$items.length;

            // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
            // This supports the "infinite" scrolling
            base.$items.filter(':first').before(base.$items.filter(':last').clone().addClass('cloned'));
            base.$items.filter(':last').after(base.$items.filter(':first').clone().addClass('cloned'));

            // We just added two items, time to re-cache the list
            base.$items = base.$slider.find('> li'); // reselect

            // Setup our forward/backward navigation
            base.buildNextBackButtons();

            // If autoPlay functionality is included, then initialize the settings
            if (base.options.autoPlay) {
                base.playing = !base.options.startStopped; // Sets the playing variable to false if startStopped is true
                base.buildAutoPlay();
            };

            // If pauseOnHover then add hover effects
            if (base.options.pauseOnHover) {
                base.$el.hover(function () {
                    base.clearTimer();
                }, function () {
                    base.startStop(base.playing);
                });
            }

            // If a hash can not be used to trigger the plugin, then go to page 1
            if ((base.options.hashTags == true && !base.gotoHash()) || base.options.hashTags == false) {
                base.setCurrentPage(1);
            };
        };

        base.gotoPage = function (page, autoplay) {
            // When autoplay isn't passed, we stop the timer
            if (autoplay !== true) autoplay = false;
            if (!autoplay) base.startStop(false);

            if (typeof (page) == "undefined" || page == null) {
                page = 1;
                base.setCurrentPage(1);
            };

            // Just check for bounds
            if (page > base.pages + 1) page = base.pages;
            if (page < 0) page = 1;

            var dir = page < base.currentPage ? -1 : 1,
                n = Math.abs(base.currentPage - page),
                left = base.singleWidth * dir * n;

            base.$wrapper.filter(':not(:animated)').animate({
                scrollLeft: '+=' + left
            }, base.options.animationTime, base.options.easing, function () {
                if (page == 0) {
                    base.$wrapper.scrollLeft(base.singleWidth * base.pages);
                    page = base.pages;
                } else if (page > base.pages) {
                    base.$wrapper.scrollLeft(base.singleWidth);
                    // reset back to start position
                    page = 1;
                };
                base.setCurrentPage(page);

            });
        };

        base.setCurrentPage = function (page, move) {
            // Set visual
            if (base.options.buildNavigation) {
                base.$nav.find('.cur').removeClass('cur');
                $(base.$navLinks[page - 1]).addClass('cur');
            };

            // Only change left if move does not equal false
            if (move !== false) base.$wrapper.scrollLeft(base.singleWidth * page);

            // Update local variable
            base.currentPage = page;
        };

        base.goForward = function (autoplay) {
            if (autoplay !== true) autoplay = false;
            base.gotoPage(base.currentPage + 1, autoplay);
        };

        base.goBack = function () {
            base.gotoPage(base.currentPage - 1);
        };

        // This method tries to find a hash that matches panel-X
        // If found, it tries to find a matching item
        // If that is found as well, then that item starts visible
        base.gotoHash = function () {
            if (/^#?panel-\d+$/.test(window.location.hash)) {
                var index = parseInt(window.location.hash.substr(7));
                var $item = base.$items.filter(':eq(' + index + ')');
                if ($item.length != 0) {
                    base.setCurrentPage(index);
                    return true;
                };
            };
            return false; // A item wasn't found;
        };

        // Creates the numbered navigation links
        base.buildNavigation = function () {
            base.$nav = $("<div id='thumbNav'></div>").appendTo(base.$el);
            base.$items.each(function (i, el) {
                var index = i + 1;
                var $a = $("<a href='#'></a>");

                // If a formatter function is present, use it
                if (typeof (base.options.navigationFormatter) == "function") {
                    $a.html(base.options.navigationFormatter(index, $(this)));
                } else {
                    $a.text(index);
                }
                $a.click(function (e) {
                    base.gotoPage(index);

                    if (base.options.hashTags)
                        base.setHash('panel-' + index);

                    e.preventDefault();
                });
                base.$nav.append($a);
            });
            base.$navLinks = base.$nav.find('> a');
        };


        // Creates the Forward/Backward buttons
        base.buildNextBackButtons = function () {
            var $forward = $('<a class="arrow forward">&gt;</a>'),
				$back = $('<a class="arrow back">&lt;</a>');

            // Bind to the forward and back buttons
            $back.click(function (e) {
                base.goBack();
                e.preventDefault();
            });

            $forward.click(function (e) {
                base.goForward();
                e.preventDefault();
            });

            // Append elements to page
            base.$wrapper.after($back).after($forward);
        };

        // Creates the Start/Stop button
        base.buildAutoPlay = function () {

            base.$startStop = $("<a href='#' id='start-stop'></a>").html(base.playing ? base.options.stopText : base.options.startText);
            base.$el.append(base.$startStop);
            base.$startStop.click(function (e) {
                base.startStop(!base.playing);
                e.preventDefault();
            });

            // Use the same setting, but trigger the start;
            base.startStop(base.playing);
        };

        // Handles stopping and playing the slideshow
        // Pass startStop(false) to stop and startStop(true) to play
        base.startStop = function (playing) {
            if (playing !== true) playing = false; // Default if not supplied is false

            // Update variable
            base.playing = playing;

            // Toggle playing and text
            if (base.options.autoPlay) base.$startStop.toggleClass("playing", playing).html(playing ? base.options.stopText : base.options.startText);

            if (playing) {
                base.clearTimer(); // Just in case this was triggered twice in a row
                base.timer = window.setInterval(function () {
                    base.goForward(true);
                }, base.options.delay);
            } else {
                base.clearTimer();
            };
        };

        base.clearTimer = function () {
            // Clear the timer only if it is set
            if (base.timer) window.clearInterval(base.timer);
        };

        // Taken from AJAXY jquery.history Plugin
        base.setHash = function (hash) {
            // Write hash
            if (typeof window.location.hash !== 'undefined') {
                if (window.location.hash !== hash) {
                    window.location.hash = hash;
                };
            } else if (location.hash !== hash) {
                location.hash = hash;
            };

            // Done
            return hash;
        };
        // <-- End AJAXY code


        // Trigger the initialization
        base.init();
    };


    $.anythingSlider.defaults = {
        easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        startText: "Start",             // Start text
        stopText: "Stop",               // Stop text
        navigationFormatter: null       // Details at the top of the file on this use (advanced use)
    };


    $.fn.anythingSlider = function (options) {
        if (typeof (options) == "object") {
            return this.each(function (i) {
                (new $.anythingSlider(this, options));

                // This plugin supports multiple instances, but only one can support hash-tag support
                // This disables hash-tags on all items but the first one
                options.hashTags = false;
            });
        } else if (typeof (options) == "number") {

            return this.each(function (i) {
                var anySlide = $(this).data('AnythingSlider');
                if (anySlide) {
                    anySlide.gotoPage(options);
                }
            });
        }
    };


})(jQuery);

/**
* Equal Heights Plugin
* Equalize the heights of elements. Great for columns or any elements
* that need to be the same size (floats, etc).
* 
* Version 1.0
* Updated 12/109/2008
*
* Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
*
* Usage: $(object).equalHeights([minHeight], [maxHeight]);
* 
* Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
* Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
* Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
* than 300 pixels tall. Elements with too much content will gain a scrollbar.
* 
*/

(function ($) {
    $.fn.equalHeights = function (minHeight, maxHeight) {
        tallest = (minHeight) ? minHeight : 0;
        this.each(function () {
            if ($(this).height() > tallest) {
                tallest = $(this).height();
            }
        });
        if ((maxHeight) && tallest > maxHeight) tallest = maxHeight;
        return this.each(function () {
            $(this).height(tallest).css("overflow", "auto");
        });
    }
})(jQuery);
