window.log = function () {
    log.history = log.history || [];
    log.history.push(arguments);
    arguments.callee = arguments.callee.caller;
    if (this.console) console.log(Array.prototype.slice.call(arguments));
};
(function (b) {
    function c() {}
    for (var d = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","), a; a = d.pop();) b[a] = b[a] || c
})(window.console = window.console || {});


/**
 * --------------------------------------------------------------------
 * jQuery-Plugin SuperBGimage - Scaling Fullscreen Backgrounds and Slideshow using jQuery
 * Version: 1.0, 29.08.2009
 *
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://dev.andreaseberhard.de/projects/superbgimage/
 *
 * Copyright (c) 2009 Andreas Eberhard
 * licensed under a Creative Commons Attribution 3.0
 *
 *  Inspired by 
 *	  Supersized - Fullscreen Slideshow jQuery Plugin
 *    http://buildinternet.com/project/supersized/
 *	  By Sam Dunn (www.buildinternet.com // www.onemightyroar.com)
 * --------------------------------------------------------------------
 * License:
 * http://creativecommons.org/licenses/by/3.0/
 * http://creativecommons.org/licenses/by/3.0/deed.de
 *
 * You are free:
 *       * to Share - to copy, distribute and transmit the work
 *       * to Remix - to adapt the work
 *
 * Under the following conditions:
 *       * Attribution. You must attribute the work in the manner specified
 *         by the author or licensor (but not in any way that suggests that
 *         they endorse you or your use of the work).
 * --------------------------------------------------------------------
 * Changelog:
 *    29.08.2009 initial Version 1.0
 * --------------------------------------------------------------------
 */
(function ($) {
    jQuery.fn.superbgimage = function (loadingoptions) {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options, loadingoptions);
        $.superbg_inAnimation = false;
        $.superbg_slideshowActive = false;
        $.superbg_imgIndex = 1;
        $.superbg_imgActual = 1;
        $.superbg_imgLast = -1;
        $.superbg_imgSlide = 0;
        $.superbg_interval = 0;
        $.superbg_preload = 0;
        $.superbg_direction = 0;
        $.superbg_max_randomtrans = 7;
        $.superbg_lasttrans = -1;
        $.superbg_isIE6 = false;
        $.superbg_firstLoaded = false;
        $.superbg_saveId = $(this).attr('id');
        if ($('#' + options.id).length === 0) {
            $('body').prepend('<div id="' + options.id + '" style="display:none;"></div>');
        } else {
            $('body').prepend($('#' + options.id));
        }
        $('#' + options.id).css('display', 'none').css('overflow', 'hidden').css('z-index', options.z_index);
        if (options.inlineMode === 0) {
            $('#' + options.id).css('position', 'fixed').css('width', '100%').css('height', '100%').css('top', 0).css('left', 0);
        }
        if (options.reload) {
            $('#' + options.id + ' img').remove();
        }
        $('#' + options.id + ' img').hide().css('position', 'absolute');
        $('#' + options.id).children('img').each(function () {
            $(this).attr('rel', $.superbg_imgIndex++);
            if (!options.showtitle) {
                $(this).attr('title', '');
            }
        });
        $(this).children('a').each(function () {
            var indexCounter = $.superbg_imgIndex++;
			$(this).attr('rel', indexCounter).click(function () {
				return false;
			});
			$(this).attr('rel', indexCounter).mouseover(function () {
                $(this).superbgShowImage();
                return false;
            }).addClass('preload');
        });
        $.superbg_imgIndex--;
        $(window).bind('load', function () {
            $(this).superbgLoad();
        });
        $(window).bind('resize', function () {
            $(this).superbgResize();
        });
        $.superbg_isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
        if ($.superbg_isIE6 && (options.inlineMode === 0)) {
            $('#' + options.id).css('position', 'absolute').width($(window).width()).height($(window).height());
            $(window).bind('scroll', function () {
                $(this).superbgScrollIE6();
            });
        }
        if (options.reload) {
            $(this).superbgLoad();
        }
        return this;
    };
    jQuery.fn.superbgScrollIE6 = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        $('#' + options.id).css('top', document.documentElement.scrollTop + 'px');
    };
    jQuery.fn.superbgLoad = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        if (($('#' + options.id).children('img').length > 0) || ($('#' + $.superbg_saveId).children('a').length > 0)) {
            $('#' + options.id).show();
        }
        if ((typeof options.showimage != 'undefined') && (options.showimage >= 0)) {
            $.superbg_imgActual = options.showimage;
        }
        if (options.randomimage === 1) {
            $.superbg_imgActual = (1 + parseInt(Math.random() * ($.superbg_imgIndex - 1 + 1), 10));
        }
        $(this).superbgShowImage($.superbg_imgActual);
    };
    jQuery.fn.superbgimagePreload = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        clearInterval($.superbg_preload);
        if (!$.superbg_firstLoaded && ($('#' + $.superbg_saveId).children('a').length > 0)) {
            $.superbg_preload = setInterval("$(this).superbgimagePreload()", 111);
            return;
        }
        $('#' + $.superbg_saveId).children('a.preload:first').each(function () {
            var imgrel = $(this).attr('rel');
            var imgtitle = $(this).attr('title');
            var img = new Image();
            $(img).load(function () {
                $(this).css('position', 'absolute').hide();
                if ($('#' + options.id).children('img' + "[rel='" + imgrel + "']").length === 0) {
                    $(this).attr('rel', imgrel);
                    if (options.showtitle === 1) {
                        $(this).attr('title', imgtitle);
                    }
                    $('#' + options.id).prepend(this);
                }
                img.onload = function () {};
            }).error(function () {
                img.onerror = function () {};
            }).attr('src', $(this).attr('href'));
            $.superbg_preload = setInterval("$(this).superbgimagePreload()", 111);
        }).removeClass('preload');
    };
    jQuery.fn.startSlideShow = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        $.superbg_imgSlide = $.superbg_imgActual;
        if ($.superbg_interval !== 0) {
            clearInterval($.superbg_interval);
        }
        $.superbg_interval = setInterval("$(this).nextSlide()", options.slide_interval);
        $.superbg_slideshowActive = true;
		$('.logo').fadeOut(300);
        return false;
    };
    jQuery.fn.stopSlideShow = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        clearInterval($.superbg_interval);
        $.superbg_slideshowActive = false;
		$('.logo').fadeIn(300);
        return false;
    };
    jQuery.fn.nextSlide = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        if ($.superbg_inAnimation) return false;
        if ($.superbg_slideshowActive) {
            clearInterval($.superbg_preload);
        }
        $.superbg_direction = 0;
        $.superbg_imgSlide++;
        if ($.superbg_imgSlide > $.superbg_imgIndex) {
            $.superbg_imgSlide = 1;
        }
        if (options.randomimage === 1) {
            $.superbg_imgSlide = (1 + parseInt(Math.random() * ($.superbg_imgIndex - 1 + 1), 10));
            while ($.superbg_imgSlide === $.superbg_imgLast) {
                $.superbg_imgSlide = (1 + parseInt(Math.random() * ($.superbg_imgIndex - 1 + 1), 10));
            }
        }
        $.superbg_imgActual = $.superbg_imgSlide;
        return $(this).superbgShowImage($.superbg_imgActual);
    };
    jQuery.fn.prevSlide = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        if ($.superbg_inAnimation) return false;
        $.superbg_direction = 1;
        $.superbg_imgSlide--;
        if ($.superbg_imgSlide < 1) {
            $.superbg_imgSlide = $.superbg_imgIndex;
        }
        if (options.randomimage === 1) {
            $.superbg_imgSlide = (1 + parseInt(Math.random() * ($.superbg_imgIndex - 1 + 1), 10));
            while ($.superbg_imgSlide === $.superbg_imgLast) {
                $.superbg_imgSlide = (1 + parseInt(Math.random() * ($.superbg_imgIndex - 1 + 1), 10));
            }
        }
        $.superbg_imgActual = $.superbg_imgSlide;
        return $(this).superbgShowImage($.superbg_imgActual);
    };
    jQuery.fn.superbgResize = function () {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        var thisimg = $('#' + options.id + ' img.activeslide');
        var dimensions = $(this).superbgCalcSize($(thisimg).width(), $(thisimg).height());
        var newwidth = dimensions[0];
        var newheight = dimensions[1];
        var newleft = dimensions[2];
        var newtop = dimensions[3];
        $(thisimg).css('width', newwidth + 'px');
        $(thisimg).css('height', newheight + 'px');
        if ($.superbg_isIE6 && (options.inlineMode === 0)) {
            $('#' + options.id).width(newwidth).height(newheight);
            $(thisimg).width(newwidth);
            $(thisimg).height(newheight);
        }
        $(thisimg).css('left', newleft + 'px');
        if (options.vertical_center === 1) {
            $(thisimg).css('top', newtop + 'px');
        } else {
            $(thisimg).css('top', '0px');
        }
    };
    jQuery.fn.superbgCalcSize = function (imgw, imgh) {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        var browserwidth = $(window).width();
        var browserheight = $(window).height();
        if (options.inlineMode === 1) {
            browserwidth = $('#' + options.id).width();
            browserheight = $('#' + options.id).height();
        }
        var ratio = imgh / imgw;
        var newheight = 0;
        var newwidth = 0;
        if ((browserheight / browserwidth) > ratio) {
            newheight = browserheight;
            newwidth = Math.round(browserheight / ratio);
        } else {
            newheight = Math.round(browserwidth * ratio);
            newwidth = browserwidth;
        }
        var newleft = Math.round((browserwidth - newwidth) / 2);
        var newtop = Math.round((browserheight - newheight) / 2);
        var rcarr = [newwidth, newheight, newleft, newtop];
        return rcarr;
    };
    jQuery.fn.superbgShowImage = function (img) {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        $.superbg_imgActual = $(this).attr('rel');
        if (typeof img !== 'undefined') {
            $.superbg_imgActual = img;
        }
        if ($('#' + options.id + ' img.activeslide').attr('rel') === $.superbg_imgActual) {
            return false;
        }
        if ($.superbg_inAnimation) {
            return false;
        } else {
            $.superbg_inAnimation = true;
        }
        var imgsrc = '';
        var imgtitle = '';
        if ($('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']").length === 0) {
            imgsrc = $('#' + $.superbg_saveId + ' a' + "[rel='" + $.superbg_imgActual + "']").attr('href');
            imgtitle = $('#' + $.superbg_saveId + ' a' + "[rel='" + $.superbg_imgActual + "']").attr('title');
        } else {
            imgsrc = $('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']").attr('src');
        }
        if ((typeof options.onHide === 'function') && (options.onHide !== null) && ($.superbg_imgLast >= 0)) {
            options.onHide($.superbg_imgLast);
        }
        $('#' + options.id + ' img.activeslide').superbgLoadImage(imgsrc, imgtitle);
        $('#' + $.superbg_saveId + ' a').removeClass('activeslide');
        $('#' + $.superbg_saveId).children('a' + "[rel='" + $.superbg_imgActual + "']").addClass('activeslide');
        $.superbg_imgSlide = $.superbg_imgActual;
        $.superbg_imgLast = $.superbg_imgActual;
        return false;
    };
    jQuery.fn.superbgLoadImage = function (imgsrc, imgtitle) {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        if ($('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']").length === 0) {
            var img = new Image();
            $(img).load(function () {
                $(this).css('position', 'absolute').hide();
                if ($('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']").length === 0) {
                    $(this).attr('rel', $.superbg_imgActual);
                    if (options.showtitle === 1) {
                        $(this).attr('title', imgtitle);
                    }
                    $('#' + options.id).prepend(this);
                }
                var thisimg = $('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']");
                var dimensions = $(this).superbgCalcSize(img.width, img.height);
                $(this).superbgTransition(thisimg, dimensions);
                if (!$.superbg_firstLoaded) {
                    if (options.slideshow === 1) {
                        $(this).startSlideShow();
                    }
                    if ((options.preload === 1) && ($('#' + $.superbg_saveId).children('a').length > 0)) {
                        $.superbg_preload = setInterval("$(this).superbgimagePreload()", 250);
                    }
                }
                $.superbg_firstLoaded = true;
                img.onload = function () {};
            }).error(function () {
                $.superbg_inAnimation = false;
                img.onerror = function () {};
            }).attr('src', imgsrc);
        } else {
            var thisimg = $('#' + options.id).children('img' + "[rel='" + $.superbg_imgActual + "']");
            var dimensions = $(this).superbgCalcSize($(thisimg).width(), $(thisimg).height());
            $(this).superbgTransition(thisimg, dimensions);
            if (!$.superbg_firstLoaded) {
                if (options.slideshow === 1) {
                    $(this).startSlideShow();
                }
                if ((options.preload === 1) && ($('#' + $.superbg_saveId).children('a').length > 0)) {
                    $.superbg_preload = setInterval("$(this).superbgimagePreload()", 250);
                }
                $.superbg_firstLoaded = true;
            }
        }
    };
    jQuery.fn.superbgTransition = function (thisimg, dimensions) {
        var options = $.extend($.fn.superbgimage.defaults, $.fn.superbgimage.options);
        var newwidth = dimensions[0];
        var newheight = dimensions[1];
        var newleft = dimensions[2];
        var newtop = dimensions[3];
        $(thisimg).css('width', newwidth + 'px').css('height', newheight + 'px').css('left', newleft + 'px');
        if ((typeof options.onClick === 'function') && (options.onClick !== null)) {
            $(thisimg).unbind('click').click(function () {
                options.onClick($.superbg_imgActual);
            });
        }
        if ((typeof options.onMouseenter === 'function') && (options.onMouseenter !== null)) {
            $(thisimg).unbind('mouseenter').mouseenter(function () {
                options.onMouseenter($.superbg_imgActual);
            });
        }
        if ((typeof options.onMouseleave === 'function') && (options.onMouseleave !== null)) {
            $(thisimg).unbind('mouseleave').mouseleave(function () {
                options.onMouseleave($.superbg_imgActual);
            });
        }
        if ((typeof options.onMousemove === 'function') && (options.onMousemove !== null)) {
            $(thisimg).unbind('mousemove').mousemove(function (e) {
                options.onMousemove($.superbg_imgActual, e);
            });
        }
        if (options.randomtransition === 1) {
            var randomtrans = (0 + parseInt(Math.random() * ($.superbg_max_randomtrans - 0 + 1), 10));
            while (randomtrans === $.superbg_lasttrans) {
                randomtrans = (0 + parseInt(Math.random() * ($.superbg_max_randomtrans - 0 + 1), 10));
            }
            options.transition = randomtrans;
        }
        if (options.vertical_center === 1) {
            $(thisimg).css('top', newtop + 'px');
        } else {
            $(thisimg).css('top', '0px');
        }
        var akt_transitionout = options.transitionout;
        if ((options.transition === 6) || (options.transition === 7)) {
            akt_transitionout = 0;
        }
        if (akt_transitionout === 1) {
            $('#' + options.id + ' img.activeslide').removeClass('activeslide').addClass('lastslide').css('z-index', 0);
        } else {
            $('#' + options.id + ' img.activeslide').removeClass('activeslide').addClass('lastslideno').css('z-index', 0);
        }
        $(thisimg).css('z-index', 1);
        options.transition = parseInt(options.transition, 10);
        $.superbg_lasttrans = options.transition;
        var theEffect = '';
        var theDir = '';
        if (options.transition === 0) {
            $(thisimg).show(1, function () {
                if ((typeof options.onShow === 'function') && (options.onShow !== null)) options.onShow($.superbg_imgActual);
                $.superbg_inAnimation = false;
                if ($.superbg_slideshowActive) {
                    $('#' + options.id).startSlideShow();
                }
            }).addClass('activeslide');
        } else if (options.transition === 1) {
            $(thisimg).fadeIn(options.speed, function () {
                if ((typeof options.onShow === 'function') && (options.onShow !== null)) options.onShow($.superbg_imgActual);
                $('#' + options.id + ' img.lastslideno').hide(1, null).removeClass('lastslideno');
                $.superbg_inAnimation = false;
                if ($.superbg_slideshowActive) {
                    $('#' + options.id).startSlideShow();
                }
            }).addClass('activeslide');
        } else {
            if (options.transition === 2) {
                theEffect = 'slide';
                theDir = 'up';
            }
            if (options.transition === 3) {
                theEffect = 'slide';
                theDir = 'right';
            }
            if (options.transition === 4) {
                theEffect = 'slide';
                theDir = 'down';
            }
            if (options.transition === 5) {
                theEffect = 'slide';
                theDir = 'left';
            }
            if (options.transition === 6) {
                theEffect = 'blind';
                theDir = 'horizontal';
            }
            if (options.transition === 7) {
                theEffect = 'blind';
                theDir = 'vertical';
            }
            if (options.transition === 90) {
                theEffect = 'slide';
                theDir = 'left';
                if ($.superbg_direction === 1) {
                    theDir = 'right';
                }
            }
            if (options.transition === 91) {
                theEffect = 'slide';
                theDir = 'down';
                if ($.superbg_direction === 1) {
                    theDir = 'up';
                }
            }
            $(thisimg).show(theEffect, {
                direction: theDir
            }, options.speed, function () {
                if ((typeof options.onShow === 'function') && (options.onShow !== null)) options.onShow($.superbg_imgActual);
                $('#' + options.id + ' img.lastslideno').hide(1, null).removeClass('lastslideno');
                $.superbg_inAnimation = false;
                if ($.superbg_slideshowActive) {
                    $('#' + options.id).startSlideShow();
                }
            }).addClass('activeslide');
        }
        if (akt_transitionout === 1) {
            var outspeed = options.speed;
            if (options.speed == 'slow') {
                outspeed = 600 + 200;
            } else if (options.speed == 'normal') {
                outspeed = 400 + 200;
            } else if (options.speed == 'fast') {
                outspeed = 400 + 200;
            } else {
                outspeed = options.speed + 200;
            }
            if (options.transition === 0) {
                $('#' + options.id + ' img.lastslide').hide(1, null).removeClass('lastslide');
            } else if (options.transition == 1) {
                $('#' + options.id + ' img.lastslide').fadeOut(outspeed).removeClass('lastslide');
            } else {
                if (options.transition === 2) {
                    theEffect = 'slide';
                    theDir = 'down';
                }
                if (options.transition === 3) {
                    theEffect = 'slide';
                    theDir = 'left';
                }
                if (options.transition === 4) {
                    theEffect = 'slide';
                    theDir = 'up';
                }
                if (options.transition === 5) {
                    theEffect = 'slide';
                    theDir = 'right';
                }
                if (options.transition === 6) {
                    theEffect = '';
                    theDir = '';
                }
                if (options.transition === 7) {
                    theEffect = '';
                    theDir = '';
                }
                if (options.transition === 90) {
                    theEffect = 'slide';
                    theDir = 'right';
                    if ($.superbg_direction === 1) {
                        theDir = 'left';
                    }
                }
                if (options.transition === 91) {
                    theEffect = 'slide';
                    theDir = 'up';
                    if ($.superbg_direction === 1) {
                        theDir = 'down';
                    }
                }
                $('#' + options.id + ' img.lastslide').hide(theEffect, {
                    direction: theDir
                }, outspeed).removeClass('lastslide');
            }
        } else {
            $('#' + options.id + ' img.lastslide').hide(1, null).removeClass('lastslide');
        }
    };
    jQuery.fn.superbgimage.defaults = {
        id: 'superbgimage',
        z_index: 0,
        inlineMode: 0,
        showimage: 1,
        vertical_center: 1,
        transition: 1,
        transitionout: 1,
        randomtransition: 0,
        showtitle: 0,
        slideshow: 0,
        slide_interval: 5000,
        randomimage: 0,
        speed: 'slow',
        preload: 1,
        onShow: null,
        onClick: null,
        onHide: null,
        onMouseenter: null,
        onMouseleave: null,
        onMousemove: null
    };
})(jQuery);


/*!
 * projekktor zwei V 0.9.01 (r59) 
 * http://www.projekktor.com
 * Copyright 2010, 2011, Sascha Kluger, Spinning Airwhale Media, http://www.spinningairwhale.com
 * under GNU General Public License
 * http://www.projekktor.com/license/
 *
 * You can use, modify and distribute the software, but do so in the spirit of Open Source.
 * You need to leave the copyright notices intact.
 * You need to be able to share any modifications you make to the Projekktor source (not the software Projekktor is integrated to).
 * Give credit where credit is due, spread the word, link to us if you can.
 */
var projekktorConfig = function () {};
projekktorConfig.prototype = {
    _cookieName: "prkktr",
    _cookieExpiry: 356,
    _plugins: ["Display", "Controlbar"],
    _addplugins: [],
    _version: "0.9.00",
    _reelParser: function (a) {
        return a
    },
    _cssClassPrefix: "pp",
    _platformPriority: ["native", "flash"],
    _bypassFlashFFFix: false,
    _sandBox: false,
    _loop: false,
    _autoplay: false,
    _continuous: true,
    _allowPlaybackFrom: [],
    _dynamicTypeExtensions: false,
    _FilePosterSeparator: ";",
    _playlist: [],
    _theme: false,
    _themeRepo: "http://themes.projekktorxl.com/",
    _messages: {
        0: "An error occurred.",
        1: "You aborted the media playback. ",
        2: "A network error caused the media download to fail part-way. ",
        3: "The media playback was aborted due to a corruption problem. ",
        4: "The media (%{src}) could not be loaded because the server or network failed.",
        5: "Sorry, your browser does not support the media format of the requested file (%{type}).",
        6: "Your client is in lack of the Flash Plugin V%{flashver} or higher.",
        7: "No media scheduled.",
        8: "! Invalid media model configured !",
        9: "File (%{src}) not found.",
        97: "No media scheduled.",
        98: "Invalid or malformed playlist data!",
        99: "Click display to proceed. ",
        500: "This Youtube video has been removed or set to private",
        501: "The Youtube user owning this video disabled embedding.",
        502: "Invalid Youtube Video-Id specified.",
        1000: "Copy this text and send it to your webmaster:"
    },
    _debug: false,
    _width: 0,
    _height: 0,
    _minHeight: 160,
    _minWidth: 160,
    ID: 0,
    title: "",
    poster: false,
    controls: false,
    start: false,
    stop: false,
    volume: 0.5,
    cover: "",
    disablePause: false,
    disallowSkip: false,
    fixedVolume: false,
    imageScaling: "aspectratio",
    videoScaling: "aspectratio",
    playerFlashMP4: "jarisplayer.swf",
    playerFlashMP3: "jarisplayer.swf",
    flashStreamType: "file",
    flashRTMPServer: "",
    flashVars: null,
    useYTIframeAPI: false,
    enableFlashFallback: true,
    enableNativePlayback: true,
    enableKeyboard: true,
    enableFullscreen: true,
    enableTestcard: true,
    duration: 0
};
jQuery(function ($) {
    if ($.browser.msie) {
        (function () {
            if (! /*@cc_on!@*/
            0) {
                return
            }
            var e = "div,audio,video,source".split(",");
            for (var i = 0; i < e.length; i++) {
                document.createElement(e[i])
            }
        })();
        if (!Array.prototype.indexOf) {
            Array.prototype.indexOf = function (obj, start) {
                for (var i = (start || 0), j = this.length; i < j; i++) {
                    if (this[i] == obj) {
                        return i
                    }
                }
                return -1
            }
        }
    }
    var projekktors = [];

    function Iterator(arr) {
        this.length = arr.length;
        this.each = function (fn) {
            $.each(arr, fn)
        };
        this.size = function () {
            return arr.length
        }
    }
    if ($.prop == undefined || $().jquery < "1.6") {
        $.fn.prop = function (arga, argb) {
            return $(this).attr(arga, argb)
        }
    }
    projekktor = $p = function () {
        var arg = arguments[0],
            instances = [];
        if (!arguments.length) {
            return projekktors[0] || null
        }
        if (typeof arg == "number") {
            return projekktors[arg]
        }
        if (typeof arg == "string") {
            if (arg == "*") {
                return new Iterator(projekktors)
            }
            for (var i = 0; i < projekktors.length; i++) {
                try {
                    if (projekktors[i].getId() == arg.id) {
                        instances.push(projekktors[i]);
                        continue
                    }
                } catch (e) {}
                try {
                    for (var j = 0; j < $(arg).length; j++) {
                        if (projekktors[i].env.playerDom.get(0) == $(arg).get(j)) {
                            instances.push(projekktors[i]);
                            continue
                        }
                    }
                } catch (e) {}
                try {
                    if (projekktors[i].getParent() == arg) {
                        instances.push(projekktors[i]);
                        continue
                    }
                } catch (e) {}
                try {
                    if (projekktors[i].getId() == arg) {
                        instances.push(projekktors[i]);
                        continue
                    }
                } catch (e) {}
            }
            if (instances.length > 0) {
                return (instances.length == 1) ? instances[0] : new Iterator(instances)
            }
        }
        if (instances.length == 0) {
            var cfg = arguments[1] || {};
            var callback = arguments[2] || {};
            if (typeof arg == "string") {
                var count = 0;
                var playerA;
                $.each($(arg), function () {
                    playerA = new PPlayer($(this), cfg, callback);
                    projekktors.push(playerA);
                    count++
                });
                return (count > 1) ? new Iterator(projekktors) : playerA
            } else {
                if (arg) {
                    projekktors.push(new PPlayer(arg, cfg, callback));
                    return new Iterator(projekktors)
                }
            }
        }
        return null;

        function PPlayer(srcNode, cfg, onReady) {
            this.config = new projekktorConfig();
            this._persCfg = ["volume", "enableNativePlayback", "enableFlashFallback"];
            this._queue = [];
            this.env = {
                inFullscreen: false,
                playerStyle: null,
                scrollTop: null,
                scrollLeft: null,
                bodyOverflow: null,
                playerDom: null,
                mediaContainer: null,
                agent: "standard",
                mouseIsOver: false,
                loading: false,
                autoSize: false
            };
            this.media = [null];
            this._plugins = [];
            this.listeners = [];
            this.mediaGrid = {};
            this.playerModel = {};
            this._isReady = false;
            this._currentItem = 0;
            this._playlistServer = "";
            this._id = "";
            this._reelUpdate = function (obj) {
                this.env.loading = true;
                switch (typeof obj) {
                default:
                    obj = [{
                        file: "",
                        type: "",
                        errorCode: 98
                    }];
                    break;
                case "object":
                    if (obj.length == 0) {
                        obj = [{
                            file: "",
                            type: "",
                            errorCode: 97
                        }]
                    }
                    break;
                case "undefined":
                    obj = [{
                        file: "",
                        type: "",
                        errorCode: 97
                    }];
                    break
                }
                var ref = this,
                    data = obj;
                this.media = [];
                try {
                    var changes = false;
                    for (var props in data.config) {
                        if (typeof data.config[props].indexOf("objectfunction") > -1) {
                            continue
                        }
                        this.config[props] = this._cleanValue(data.config[props]);

                        changes = true
                    }
                    delete(data.config);
                    if (changes === true) {
                        this._debug("Updated config var: " + props + " to " + this.config[props]);
                        this._bubbleEvent("configModified")
                    }
                } catch (e) {}
                var files = data.playlist || data;
                for (var item in files) {
                    if (typeof files[item] == "function") {
                        continue
                    }
                    if (typeof files[item] == undefined) {
                        continue
                    }
                    if (files[item]) {
                        this._addItem(this._prepareMedia({
                            file: files[item],
                            config: files[item].config || {},
                            errorCode: files[item].errorCode
                        }))
                    }
                }
                this.env.loading = false;
                this._bubbleEvent("scheduled", this.getItemCount());
                this._syncPlugins(function () {
                    ref.setActiveItem(0)
                })
            };
            this._addItem = function (data, idx, replace) {
                var resultIdx = 0;
                if (this.media.length === 1 && this.media[0].mediaModel == "NA") {
                    this._detachplayerModel();
                    this.media = []
                }
                if (idx === undefined || idx < 0 || idx > this.media.length - 1) {
                    this.media.push(data);
                    resultIdx = this.media.length - 1
                } else {
                    this.media.splice(idx, (replace === true) ? 1 : 0, data);
                    resultIdx = idx
                }
                if (this.env.loading === false) {
                    this._bubbleEvent("scheduleModified", this.getItemCount())
                }
                return resultIdx
            };
            this._removeItem = function (idx) {
                var resultIdx = 0;
                if (this.media.length === 1) {
                    if (this.media[0].mediaModel == "NA") {
                        return 0
                    } else {
                        this.media[0] = this._prepareMedia({
                            file: ""
                        });
                        return 0
                    }
                }
                if (idx === undefined || idx < 0 || idx > this.media.length - 1) {
                    this.media.pop();
                    resultIdx = this.media.length
                } else {
                    this.media.splice(idx, 1);
                    resultIdx = idx
                }
                if (this.env.loading === false) {
                    this._bubbleEvent("scheduleModified", this.getItemCount())
                }
                return resultIdx
            };
            this._prepareMedia = function (data) {
                var mediaFile = "",
                    indexChoosen = 0,
                    mediaType = "",
                    mediaModel = "NA",
                    fileExt = "",
                    extTypes = {},
                    typesModels = {},
                    errorCode = data.errorCode || 7,
                    lastLevel = 100;
                var extRegEx = [];
                for (var i in $p.mmap) {
                    extRegEx.push("." + $p.mmap[i].ext);
                    extTypes[$p.mmap[i].ext] = $p.mmap[i];
                    typesModels[$p.mmap[i].type] = $p.mmap[i]
                }
                extRegEx = "^.*.(" + extRegEx.join("|") + ")$";
                if (typeof data.file == "string") {
                    data.file = [{
                        src: data.file
                    }];
                    if (typeof data.type == "string") {
                        data.file = [{
                            src: data.file,
                            type: data.type
                        }]
                    }
                }
                if (data.file === false) {
                    data.file = [{
                        src: ""
                    }]
                }
                try {
                    var dynConf = this.config._dynamicTypeExtensions;
                    var tagsUsed, tag, filename;
                    if (dynConf) {
                        filename = data.file[0].src + "";
                        if (data.file.length == 1) {
                            for (var j in dynConf) {
                                if (filename.match("{*}")) {
                                    if (!data.file[j]) {
                                        data.file[j] = {}
                                    }
                                    data.file[j].src = filename.replace("{*}", dynConf[j].ext);
                                    for (var k in dynConf[j]) {
                                        if (k == "ext") {
                                            continue
                                        }
                                        data.file[j][k] = dynConf[j][k]
                                    }
                                }
                            }
                        }
                    }
                    for (var i in data.file) {
                        tagsUsed = data.file[0][i].src.match(/\{[a-z\*]*\}/gi);
                        tag = "";
                        if (tagsUsed) {
                            for (var i = 0; i < tagsUsed.length; i++) {
                                tag = tagsUsed[i].replace("{", "").replace("}", "");
                                if (this.getConfig(tag) !== false) {
                                    data.file[0][i].src = data.file[0][i].src.replace("{" + tag + "}", this.getConfig(tag))
                                } else {
                                    data.file[0][i].src = data.file[0][i].src.replace("{" + tag + "}", "")
                                }
                            }
                        }
                    }
                } catch (e) {}
                var sourceObj = {};
                for (var index in data.file) {
                    if (index == "config") {
                        continue
                    }
                    sourceObj = data.file[index];
                    if (typeof sourceObj == "string") {
                        sourceObj = {
                            src: sourceObj
                        }
                    }
                    if (sourceObj.src == undefined) {
                        continue
                    }
                    try {
                        fileExt = sourceObj.src.match(new RegExp(extRegEx))[1];
                        fileExt = (!fileExt) ? "NaN" : fileExt.replace(".", "")
                    } catch (e) {
                        fileExt = "NaN"
                    }
                    if (sourceObj.type === undefined || sourceObj.type === "") {
                        if (extTypes[fileExt]) {
                            $.extend(sourceObj, extTypes[fileExt])
                        }
                    } else {
                        try {
                            var codecMatch = sourceObj.type.split(" ").join("").split(/[\;]codecs=.([a-zA-Z0-9\,]*)[\'|\"]/i);
                            if (codecMatch[1] !== undefined) {
                                sourceObj.codec = codecMatch[1];
                                sourceObj.type = codecMatch[0]
                            }
                        } catch (e) {}
                        if (typesModels[sourceObj.type]) {
                            $.extend(sourceObj, typesModels[sourceObj.type])
                        }
                    }
                    if (lastLevel === 100) {
                        mediaFile = sourceObj.src
                    }
                    if (lastLevel > this.config._platformPriority.indexOf(sourceObj.platform) && this.mediaGrid[sourceObj.type] != "NA") {
                        lastLevel = this.config._platformPriority.indexOf(sourceObj.platform);
                        try {
                            mediaModel = this.mediaGrid[sourceObj.type].toUpperCase()
                        } catch (e) {
                            mediaModel = "NA"
                        }
                        mediaFile = sourceObj.src;
                        mediaType = sourceObj.type;
                        indexChoosen = index
                    }
                    if (index === "src") {
                        break
                    }
                }
                try {
                    if (typeof eval("playerModel" + mediaModel) !== "function") {
                        mediaModel = "NA";
                        errorCode = 0
                    } else {
                        if (data.config.flashStreamType == "rtmp" && mediaModel.indexOf("FLASH") == -1) {
                            mediaModel += "FLASH"
                        }
                    }
                } catch (e) {}
                var block = 0;
                if (this.config._allowPlaybackFrom.length > 0) {
                    for (var i = 0; i < this.config._allowPlaybackFrom.length; i++) {
                        if (mediaFile.indexOf(this.config._allowPlaybackFrom[i]) > -1) {
                            block++
                        }
                    }
                    if (block == 0) {
                        mediaFile = ""
                    }
                }
                data._originalConfig = data.file;
                data.fileConfig = data.file[indexChoosen];
                if (data.config.flashStreamType != "rtmp") {
                    data.file = this.toAbsoluteURL(mediaFile)
                } else {
                    data.file = mediaFile
                }
                data.mediaModel = mediaModel;
                data.mediaType = mediaType;
                data.errorCode = errorCode;
                data.ID = this.randomId(8);
                data._VALIDATED = true;
                data.config = data.config || {};
                this._debug("Set item of type: " + mediaType + " Model: " + data.mediaModel + " File:" + data.file + " Priority: " + lastLevel);
                return data
            };
            this._modelUpdateListener = function (type, value) {
                var ref = this;
                if (!this.playerModel.init) {
                    return
                }
                if (type != "time" && type != "progress") {
                    this._debug("Received model Update: '" + type + "' (" + value + ") while handling '" + this.playerModel.getFile() + "' using '" + this.playerModel.getModelName() + "'")
                }
                switch (type) {
                case "state":
                    this._bubbleEvent("state", value);
                    switch (value) {
                    case "IDLE":
                        break;
                    case "AWAKENING":
                        break;
                    case "BUFFERING":
                        break;
                    case "ERROR":
                        this._bubbleEvent("error", {});
                        break;
                    case "PLAYING":
                        break;
                    case "STOPPED":
                        this._bubbleEvent("stopped", {});
                        break;
                    case "PAUSED":
                        if (this.getConfig("disablePause") === true) {
                            this.playerModel.applyCommand("play", 0)
                        }
                        break;
                    case "COMPLETED":
                        if (this._currentItem + 1 >= this.media.length) {
                            if (this.getInFullscreen() === true) {
                                this.setFullscreen(false)
                            }
                            this._bubbleEvent("done", {})
                        }
                        this.setActiveItem("next");
                        break
                    }
                    break;
                case "buffer":
                    this._bubbleEvent("buffer", value);
                    this._bubbleEvent("time", value);
                    break;
                case "modelReady":
                    this._bubbleEvent("item", ref._currentItem);
                    break;
                case "displayReady":
                    this._bubbleEvent("displayReady", true);
                    this._addGUIListeners();
                    this._syncPlugins();
                    break;
                case "FFreinit":
                    break;
                case "seek":
                    this._bubbleEvent("seek", {
                        dest: value
                    });
                    break;
                case "volume":
                    this.setConfig({
                        volume: value
                    });
                    this._bubbleEvent("volume", value);
                    break;
                case "progress":
                    this._bubbleEvent("progress", value);
                    break;
                case "time":
                    this._bubbleEvent("time", value);
                    break;
                case "fullscreen":
                    this._bubbleEvent("fullscreen", value);
                    break;
                case "resize":
                    this._bubbleEvent("resize", value);
                    break;
                case "playlist":
                    this.setFile(value, true);
                    break;
                case "config":
                    this.setConfig(value);
                    break;
                case "scaled":
                    if (this.env.autoSize === true) {
                        this.env.playerDom.css({
                            height: value.realHeight + "px",
                            width: value.realWidth + "px"
                        });
                        this._bubbleEvent("resize", value);
                        this.env.autoSize = false;
                        break
                    }
                    this._bubbleEvent("scaled", value);
                    break
                }
            };
            this._syncPlugins = function (callback) {
                var ref = this;
                this.env.loading = true;
                (function () {
                    try {
                        if (ref._plugins.length > 0) {
                            for (var i = 0; i < ref._plugins.length; i++) {
                                if (ref._plugins[i].pluginReady !== true) {
                                    setTimeout(arguments.callee, 50);
                                    return
                                }
                            }
                        }
                        ref.env.loading = false;
                        ref._bubbleEvent("pluginsReady", {});
                        if (ref._isReady === true) {
                            ref._bubbleEvent("ready", {})
                        }
                        try {
                            callback()
                        } catch (e) {}
                    } catch (e) {}
                })()
            };
            this._addGUIListeners = function () {
                var ref = this;
                this.env.playerDom.unbind();
                this.env.playerDom.mousemove(function (event) {
                    ref._displayMousemoveListener(event)
                });
                this.env.playerDom.mouseenter(function (event) {
                    ref._displayMouseEnterListener(event)
                });
                this.env.playerDom.mouseleave(function (event) {
                    ref._displayMouseLeaveListener(event)
                });
                $(window).bind("resize.projekktor" + this.getId(), function () {
                    ref.playerModel.applyCommand("resize")
                });
                if (this.config.enableKeyboard === true) {
                    if (!$.browser.mozilla) {
                        $(document.documentElement).unbind("keydown.pp" + this._id);
                        $(document.documentElement).bind("keydown.pp" + this._id, function (evt) {
                            ref._keyListener(evt)
                        })
                    } else {
                        $(document.documentElement).unbind("keypress.pp" + this._id);
                        $(document.documentElement).bind("keypress.pp" + this._id, function (evt) {
                            ref._keyListener(evt)
                        })
                    }
                }
            };
            this._removeGUIListeners = function () {
                $("#" + this.getId()).unbind();
                this.env.playerDom.unbind();
                $(window).unbind("resize.projekktor" + this.getId())
            };
            this._registerPlugins = function () {
                var plugins = $.merge(this.config._plugins, this.config._addplugins);
                if (this._plugins.length > 0) {
                    return
                }
                if (plugins == 0) {
                    return
                }
                for (var i = 0; i < plugins.length; i++) {
                    var pluginName = "projekktor" + plugins[i];
                    try {
                        typeof eval(pluginName)
                    } catch (e) {
                        continue
                    }
                    var pluginObj = $.extend(true, {}, new projekktorPluginInterface(), eval(pluginName).prototype);
                    pluginObj.name = plugins[i].toLowerCase();
                    pluginObj.pp = this;
                    pluginObj.playerDom = this.env.playerDom;
                    pluginObj._init(this.config["plugin_" + plugins[i].toLowerCase()] || {});
                    this._plugins.push(pluginObj)
                }
            };
            this.removePlugin = function (rmvPl) {
                if (this._plugins.length == 0) {
                    return
                }
                var pluginsToRemove = rmvPl || this.config._plugins,
                    pluginsRegistered = this._plugins.length;
                for (var j = 0; j < pluginsToRemove.length; j++) {
                    for (var k = 0; k < pluginsRegistered; k++) {
                        if (this._plugins[k] != undefined) {
                            if (this._plugins[k].name == pluginsToRemove[j].toLowerCase()) {
                                this._plugins[k].deconstruct();
                                this._plugins.splice(k, 1)
                            }
                        }
                    }
                }
            };
            this._bubbleEvent = function (evt, value) {
                var event = evt,
                    pluginData = {};
                if (typeof event == "object") {
                    if (!event._plugin) {
                        return
                    }
                    value.PLUGIN = event._plugin + "";
                    value.EVENT = event._event + "";
                    event = "pluginevent"
                }
                if (event != "time" && event != "progress" && event != "mousemove") {
                    this._debug("Fireing :" + event)
                }
                if (this._plugins.length > 0) {
                    for (var i in this._plugins) {
                        try {
                            this._plugins[i][event + "Handler"](value, this)
                        } catch (e) {}
                    }
                }
                if (this.listeners.length > 0) {
                    for (var i in this.listeners) {
                        try {
                            if (this.listeners[i]["event"] == event || this.listeners[i]["event"] == "*") {
                                this.listeners[i]["callback"](value, this)
                            }
                        } catch (e) {}
                    }
                }
            };
            this._detachplayerModel = function () {
                this._removeGUIListeners();
                try {
                    this.playerModel.destroy()
                } catch (e) {}
                this._bubbleEvent("detach", {})
            };
            this._displayMousemoveListener = function (evt) {
                this._bubbleEvent("mousemove", {})
            };
            this._displayMouseEnterListener = function (evt) {
                this._bubbleEvent("mouseenter", {});
                this.env.mouseIsOver = true;
                if ($.browser.msie) {
                    evt.cancelBubble = true
                } else {
                    evt.stopPropagation()
                }
            };
            this._displayMouseLeaveListener = function (evt) {
                this._bubbleEvent("mouseleave", {});
                this.env.mouseIsOver = false;
                if ($.browser.msie) {
                    evt.cancelBubble = true
                } else {
                    evt.stopPropagation()
                }
            };
            this._keyListener = function (evt) {
                if (this.env.mouseIsOver !== true) {
                    return false
                }
                if ($.browser.msie) {
                    evt.cancelBubble = true
                } else {
                    evt.stopPropagation()
                }
                evt.preventDefault();
                this._debug("Keypress: " + evt.keyCode);
                this._bubbleEvent("key", evt.keyCode);
                switch (evt.keyCode) {
                case 27:
                    this.setFullscreen(false);
                    break;
                case 13:
                    this.setFullscreen(true);
                    break;
                case 39:
                    this.setActiveItem("next");
                    break;
                case 37:
                    this.setActiveItem("previous");
                    break;
                case 0:
                    this.setPlayPause();
                    break
                }
                return false
            };
            this._enterFullViewport = function () {
                if (this.env.inFullscreen === true) {
                    return
                }
                this.env.scrollTop = $(window).scrollTop();
                this.env.scrollLeft = $(window).scrollLeft();
                this.env.playerStyle = this.env.playerDom.attr("style");
                this.env.bodyOverflow = $("body").css("overflow");
                $(window).scrollTop(0);
                $(window).scrollLeft(0);
                $("body").css("overflow", "hidden");
                this.env.playerDom.css({
                    position: "fixed",
                    display: "block",
                    top: 0,
                    left: 0,
                    width: "100%",
                    height: "100%",
                    zIndex: 99997
                });
                this.env.inFullscreen = true
            };
            this._exitFullViewport = function () {
                if (this.env.inFullscreen === false) {
                    return
                }
                this.env.playerDom.attr("style", this.env.playerStyle);
                $("body").css("overflow", this.env.bodyOverflow);
                $(window).scrollTop(this.env.scrollTop);
                $(window).scrollLeft(this.env.scrollLef);
                this.env.inFullscreen = false
            };
            this._enterSandboxFullViewport = function () {
                if (this.env.inFullscreen === true) {
                    return
                }
                var win = this.getSandboxWindow();
                var iframe = this.getSandboxIframe();
                if (!win || !iframe) {
                    return
                }
                this.env.scrollTop = win.scrollTop();
                this.env.scrollLeft = win.scrollLeft();
                this.env.playerStyle = iframe.attr("style");
                this.env.sandBoxWidth = iframe.attr("width");
                this.env.sandBoxHeight = iframe.attr("height");
                this.env.bodyOverflow = $(win[0].document.body).css("overflow");
                win.scrollTop(0);
                win.scrollLeft(0);
                $(win[0].document.body).css("overflow", "hidden");
                iframe.css({
                    position: "fixed",
                    display: "block",
                    top: 0,
                    left: 0,
                    width: "100%",
                    height: "100%",
                    zIndex: 9999
                });
                this.env.inFullscreen = true
            };
            this._exitSandboxFullViewport = function () {
                if (this.env.inFullscreen === false) {
                    return
                }
                var win = this.getSandboxWindow();
                var iframe = this.getSandboxIframe();
                if (!win || !iframe) {
                    return
                }
                win.scrollTop(this.env.scrollTop);
                win.scrollLeft(this.env.scrollLef);
                $(win[0].document.body).css("overflow", this.env.bodyOverflow);
                iframe.attr("width", this.env.sandBoxWidth + "px");
                iframe.attr("height", this.env.sandBoxHeight + "px");
                iframe.attr("style", (this.env.playerStyle == undefined) ? "" : this.env.playerStyle);
                this.env.inFullscreen = false
            };
            this.getItemConfig = function (name, itemIdx) {
                return this.getConfig(name, itemIdx)
            };
            this.getConfig = function (name, itemIdx) {
                var idx = itemIdx || this._currentItem,
                    result = undefined,
                    playerCfg = (this.config["_" + name]) ? this.config["_" + name] : this.config[name];
                if (playerCfg !== undefined) {
                    result = playerCfg;
                    if ($.inArray(name, this._persCfg) > -1) {
                        if (this._cookie(name) !== null) {
                            result = this._cookie(name)
                        }
                    }
                    if (this.config["_" + name] == undefined) {
                        try {
                            if (this.media[idx]["config"][name] !== undefined) {
                                result = this.media[idx]["config"][name]
                            }
                        } catch (e) {}
                    }
                } else {
                    if (name.indexOf("plugin_") > -1) {
                        try {
                            if (this.media[idx]["config"][name]) {
                                result = this.media[idx]["config"][name]
                            }
                        } catch (e) {}
                    }
                }
                return result
            };
            this.getItemCount = function () {
                return this.media.length
            };
            this.getDC = function () {
                return this.env.playerDom
            };
            this.getState = function () {
                try {
                    return this.playerModel.getState()
                } catch (e) {
                    return "IDLE"
                }
            };
            this.getLoadProgress = function () {
                try {
                    return this.playerModel.getLoadProgress()
                } catch (e) {
                    return 0
                }
            };
            this.getKbPerSec = function () {
                try {
                    return this.playerModel.getKbPerSec()
                } catch (e) {
                    return 0
                }
            };
            this.getItemId = function (idx) {
                if (idx == undefined) {
                    return this.media[this._currentItem].ID
                }
                return this.media[idx].ID
            };
            this.getItemIdx = function () {
                return this._currentItem
            };
            this.getItem = function () {
                arg = arguments[0] || "current";
                switch (arg) {
                case "next":
                    return $.extend(true, [], this.media[this._currentItem + 1]);
                case "prev":
                    return $.extend(true, [], this.media[this._currentItem - 1]);
                case "current":
                    return $.extend(true, [], this.media[this._currentItem]);
                case "*":
                    return $.extend(true, [], this.media);
                default:
                    return $.extend(true, [], this.media[arg])
                }
            };
            this.getVolume = function () {
                return (this.getConfig("fixedVolume") === true) ? this.config.volume : this.getConfig("volume")
            };
            this.getTrackId = function () {
                if (this.getConfig("trackId")) {
                    return this.config.trackId
                }
                if (this._playlistServer != null) {
                    return "pl" + this._currentItem
                }
                return null
            };
            this.getLoadPlaybackProgress = function () {
                try {
                    return this.playerModel.getLoadPlaybackProgress()
                } catch (e) {
                    return 0
                }
            };
            this.getDuration = function () {
                try {
                    return this.playerModel.getDuration()
                } catch (e) {
                    return 0
                }
            };
            this.getPosition = function () {
                try {
                    return this.playerModel.getPosition() || 0
                } catch (e) {
                    return 0
                }
            };
            this.getTimeLeft = function () {
                try {
                    return this.playerModel.getDuration() - this.playerModel.getPosition()
                } catch (e) {
                    return this.media[this._currentItem].duration
                }
            };
            this.getInFullscreen = function () {
                return this.env.inFullscreen
            };
            this.getMediaContainer = function () {
                if (this.env.mediaContainer == null) {
                    this.env.mediaContainer = $("#" + this.getMediaId())
                }
                if (this.env.mediaContainer.length == 0) {
                    if (this.env.playerDom.find("." + this.config._cssClassPrefix + "display").length > 0) {
                        this.env.mediaContainer = $(document.createElement("div")).attr({
                            id: this.getId() + "_media"
                        }).css({
                            position: "absolute",
                            overflow: "hidden",
                            height: "100%",
                            width: "100%",
                            top: 0,
                            left: 0,
                            padding: 0,
                            margin: 0,
                            display: "block"
                        }).appendTo(this.env.playerDom.find("." + this.config._cssClassPrefix + "display"))
                    } else {
                        this.env.mediaContainer = $(document.createElement("div")).attr({
                            id: this.getMediaId()
                        }).css({
                            width: "1px",
                            height: "1px"
                        }).appendTo($(document.body))
                    }
                }
                return this.env.mediaContainer
            };
            this.getMediaId = function () {
                return this.getId() + "_media"
            };
            this.getMediaType = function () {
                return this.media[this._currentItem].mediaType
            };
            this.getUsesFlash = function () {
                return (this.playerModel.requiresFlash !== false)
            };
            this.getModel = function () {
                try {
                    return this.media[this._currentItem].mediaModel
                } catch (e) {
                    return "NA"
                }
            };
            this.getSandboxWindow = function () {
                try {
                    return $(parent.window)
                } catch (e) {
                    return false
                }
            };
            this.getSandboxIframe = function () {
                try {
                    return window.$(frameElement)
                } catch (e) {
                    return false
                }
            };
            this.getPlaylist = function () {
                return this.getItem("*")
            };
            this.getFlashVersion = function () {
                try {
                    try {
                        var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                        try {
                            axo.AllowScriptAccess = "always"
                        } catch (e) {
                            return "6,0,0"
                        }
                    } catch (e) {}
                    return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]
                } catch (e) {
                    try {
                        if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
                            return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]
                        }
                    } catch (e) {}
                }
                return "0,0,0".match(/\d+/g)[0]
            };
            this.getCanPlayNatively = function (type) {
                var checkFor = [];
                compTable = this._testMediaSupport(true);
                if (typeof type == "string") {
                    checkFor.push(type)
                }
                if (typeof type == "array") {
                    checkFor = type
                }
                for (var i in this.mediaGrid) {
                    if (compTable[i] == "video" || compTable[i] == "audio") {
                        if (arguments.length === 0) {
                            return true
                        } else {
                            if ($.inArray(i, checkFor) > -1) {
                                return true
                            }
                        }
                    }
                }
                return false
            };
            this.getId = function () {
                return this._id
            };
            this.getHasGUI = function () {
                try {
                    return this.playerModel.getHasGUI()
                } catch (e) {
                    return false
                }
            };
            this.getCssPrefix = function () {
                return this.config._cssClassPrefix
            };
            this.getPlayerDimensions = function () {
                return {
                    width: this.config._width,
                    height: this.config._height
                }
            };
            this.getMediaDimensions = function () {
                return {
                    width: this.config._width,
                    height: this.config._height
                }
            };
            this.getFromUrl = function (url, dest, callback, customParser, dataType) {
                var data = null,
                    ref = this;
                if (dest == ref && callback == "_reelUpdate") {
                    this._bubbleEvent("scheduleLoading", 1 + this.getItemCount())
                }
                this["_jsonp" + callback] = function (data) {
                    dest[callback](data)
                };
                if (dataType) {
                    if ($.parseJSON == undefined && dataType.indexOf("json") > -1) {
                        this._raiseError("Projekktor requires jQuery 1.4.2 in order to handle JSON playlists.");
                        return this
                    }
                    dataType = (dataType.indexOf("/") > -1) ? dataType.split("/")[1] : dataType
                }
                $.ajax({
                    url: url,
                    complete: function (xhr, status) {
                        if (dataType == undefined) {
                            try {
                                if (xhr.getResponseHeader("Content-Type").indexOf("xml") > -1) {
                                    dataType = "xml"
                                }
                                if (xhr.getResponseHeader("Content-Type").indexOf("json") > -1) {
                                    dataType = "json"
                                }
                            } catch (e) {}
                        }
                        switch (dataType) {
                        case "xml":
                            if (window.DOMParser) {
                                data = new DOMParser();
                                data = data.parseFromString(xhr.responseText, "text/xml")
                            } else {
                                data = new ActiveXObject("Microsoft.XMLDOM");
                                data.async = "false";
                                data.loadXML(xhr.responseText)
                            }
                            break;
                        case "json":
                            data = xhr.responseText;
                            if (typeof data == "string") {
                                data = $.parseJSON(data)
                            }
                            break;
                        case "jsonp":
                            break;
                        default:
                            data = xhr.responseText;
                            break
                        }
                        if (dest === ref) {
                            try {
                                data = customParser(data, xhr.responseText)
                            } catch (e) {}
                        }
                        if (status != "error" && dataType != "jsonp") {
                            dest[callback](data)
                        }
                    },
                    error: function (data) {
                        if (dataType != "jsonp") {
                            dest[callback](false)
                        }
                    },
                    cache: true,
                    dataType: dataType,
                    jsonpCallback: "projekktor('" + this.getId() + "')._jsonp" + callback,
                    jsonp: "callback"
                });
                return this
            };
            this.setActiveItem = function (mixedData) {
                var newItem = 0;
                var lastItem = this._currentItem;
                if (this.env.loading === true) {
                    return this
                }
                if (typeof mixedData == "string") {
                    switch (mixedData) {
                    case "previous":
                        if (this.getConfig("disallowSkip") == true && this.getState() !== "COMPLETED") {
                            return this
                        }
                        newItem = this._currentItem - 1;
                        break;
                    case "next":
                        if (this.getConfig("disallowSkip") == true && this.getState() !== "COMPLETED") {
                            return this
                        }
                        newItem = this._currentItem + 1;
                        break;
                    default:
                    case "poster":
                        result = 0;
                        break
                    }
                } else {
                    if (typeof mixedData == "number") {
                        newItem = parseInt(mixedData)
                    } else {
                        newItem = 0
                    }
                }
                if (newItem != this._currentItem) {
                    if (this.getConfig("disallowSkip") == true && this.getState() !== "COMPLETED") {
                        return this
                    }
                    this._detachplayerModel()
                }
                var ap = false;
                if (newItem === 0 && lastItem == 0 && this.config._autoplay === true) {
                    ap = true
                } else {
                    if (this.getItemCount() > 1 && newItem != lastItem && this.config._continuous === true && newItem < this.getItemCount()) {
                        ap = true
                    }
                }
                if (newItem >= this.getItemCount() || newItem < 0) {
                    ap = this.config._loop;
                    newItem = 0
                }
                this._currentItem = newItem;
                var newModel = this.media[this._currentItem].mediaModel.toUpperCase();
                if (!$p.models[newModel]) {
                    newModel = "NA";
                    this.media[this._currentItem].mediaModel = newModel;
                    this.media[this._currentItem].errorCode = 8
                }
                this.playerModel = new playerModel();
                $.extend(this.playerModel, $p.models[newModel].prototype);
                this.playerModel._init({
                    media: $.extend(true, {}, this.media[this._currentItem]),
                    model: newModel,
                    pp: this,
                    environment: $.extend(true, {}, this.env),
                    autoplay: ap
                });
                return this
            };
            this._enqueue = function (command, params, delay) {
                this._queue.push({
                    command: command,
                    params: params,
                    delay: delay
                });
                this._processQueue()
            };
            this._clearqueue = function (command, params) {
                if (this._isReady !== true) {
                    return
                }
                this._queue = []
            };
            this._processQueue = function () {
                var ref = this,
                    modelReady = false;
                if (this._processing === true) {
                    return
                }
                if (this.env.loading === true) {
                    return
                }
                this._processing = true;
                (function () {
                    modelReady = false;
                    try {
                        modelReady = ref.playerModel.getIsReady()
                    } catch (e) {}
                    if (ref.env.loading !== true && modelReady) {
                        var msg = ref._queue.shift();
                        if (!msg) {
                            ref._processing = false;
                            if (ref._isReady === false) {
                                ref._bubbleEvent("ready", true);
                                ref._isReady = true
                            }
                            return
                        }
                        if (typeof msg.command == "string") {
                            if (msg.delay > 0) {
                                setTimeout(function () {
                                    ref.playerModel.applyCommand(msg.command, msg.params)
                                }, msg.delay)
                            } else {
                                ref.playerModel.applyCommand(msg.command, msg.params)
                            }
                        } else {
                            msg.command(ref)
                        }
                        arguments.callee();
                        return
                    }
                    setTimeout(arguments.callee, 100)
                })()
            };
            this.getIsLastItem = function () {
                return ((this._currentItem == this.media.length - 1) && this.config._loop !== true)
            };
            this.getIsFirstItem = function () {
                return ((this._currentItem == 0) && this.config._loop !== true)
            };
            this.getIsMobileClient = function () {
                var uagent = navigator.userAgent.toLowerCase();
                var mobileAgents = ["android", "windows ce", "blackberry", "palm", "mobile"];
                for (var i = 0; i < mobileAgents.length; i++) {
                    if (uagent.indexOf(mobileAgents[i]) > -1) {
                        return true
                    }
                }
                return false
            };
            this.setPlay = function () {
                this._enqueue("play", false);
                return this
            };
            this.setPause = function () {
                this._enqueue("pause", false);
                return this
            };
            this.setStop = function (toZero) {
                var ref = this;
                this._enqueue("stop", false);
                if (toZero) {
                    this._enqueue(function () {
                        ref._currentItem = 0;
                        ref.setActiveItem(0)
                    })
                }
                return this
            };
            this.setPlayPause = function () {
                if (this.getState() !== "PLAYING") {
                    this.setPlay()
                } else {
                    this.setPause()
                }
                return this
            };
            this.setVolume = function (vol, fadeDelay) {
                if (this.getConfig("fixedVolume") == true) {
                    return this
                }
                var initalVolume = this.getVolume();
                if (typeof vol == "string") {
                    var dir = vol.substr(0, 1);
                    vol = parseFloat(vol.substr(1));
                    vol = (vol > 1) ? vol / 100 : vol;
                    if (dir == "+") {
                        vol = this.getVolume() + vol
                    } else {
                        if (dir == "-") {
                            vol = this.getVolume() - vol
                        } else {
                            vol = this.getVolume()
                        }
                    }
                }
                if (typeof vol == "number") {
                    vol = (vol > 1) ? 1 : vol;
                    vol = (vol < 0) ? 0 : vol
                } else {
                    return this
                }
                if (vol > initalVolume && fadeDelay) {
                    if (vol - initalVolume > 0.03) {
                        for (var i = initalVolume; i <= vol; i = i + 0.03) {
                            this._enqueue("volume", i, fadeDelay)
                        }
                        this._enqueue("volume", vol, fadeDelay);
                        return this
                    }
                } else {
                    if (vol < initalVolume && fadeDelay) {
                        if (initalVolume - vol > 0.03) {
                            for (var i = initalVolume; i >= vol; i = i - 0.03) {
                                this._enqueue("volume", i, fadeDelay)
                            }
                            this._enqueue("volume", vol, fadeDelay);
                            return this
                        }
                    }
                }
                this._enqueue("volume", vol);
                return this
            };
            this.setPlayhead = function (position) {
                if (this.getConfig("disallowSkip") == true) {
                    return this
                }
                if (typeof position == "string") {
                    var dir = position.substr(0, 1);
                    position = parseFloat(position.substr(1));
                    if (dir == "+") {
                        position = this.getPosition() + position
                    } else {
                        if (dir == "-") {
                            position = this.getPosition() - position
                        } else {
                            position = this.getPosition()
                        }
                    }
                }
                if (typeof position == "number") {
                    this._enqueue("seek", position)
                }
                return this
            };
            this.setPlayerPoster = function (url) {
                var ref = this;
                this._enqueue(function () {
                    ref.setConfig({
                        poster: url
                    }, 0)
                });
                return this
            };
            this.setItemConfig = function () {
                var ref = this,
                    args = arguments;
                this._enqueue(function () {
                    ref._setConfig(args[0] || null, args[1] || null)
                });
                return this
            };
            this.setConfig = function () {
                var ref = this,
                    args = arguments;
                this._enqueue(function () {
                    ref._setConfig(args[0] || null, args[1] || null)
                });
                return this
            };
            this._setConfig = function () {
                if (!arguments.length) {
                    return result
                }
                var confObj = arguments[0],
                    dest = "*",
                    value = false;
                if (typeof confObj != "object") {
                    return this
                }
                if (arguments[1] == "string" || arguments[1] == "number") {
                    dest = arguments[1]
                } else {
                    dest = this._currentItem
                }
                for (var i in confObj) {
                    if ($.inArray(i, this._persCfg) > -1) {
                        this._cookie(i, this._cleanValue(confObj[i]))
                    }
                    if (this.config["_" + i] != undefined) {
                        continue
                    }
                    value = this._cleanValue(confObj[i]);
                    if (dest == "*") {
                        $.each(this.media, function () {
                            if (this.config == undefined) {
                                this.config = {}
                            }
                            this.config[i] = value
                        });
                        continue
                    }
                    if (this.media[dest] == undefined) {
                        return this
                    }
                    if (this.media[dest]["config"] == undefined) {
                        this.media[dest]["config"] = {}
                    }
                    this.media[dest]["config"][i] = value
                }
                return this
            };
            this.setFullscreen = function (full) {
                full = full || !this.getInFullscreen();
                if (full == this.getInFullscreen() || !this.config.enableFullscreen || this.getIsMobileClient()) {
                    return this
                }
                switch (full) {
                case true:
                    if (this.config._sandBox !== false) {
                        this._enterSandboxFullViewport()
                    } else {
                        this._enterFullViewport()
                    }
                    break;
                case false:
                    if (this.config._sandBox !== false) {
                        this._exitSandboxFullViewport()
                    } else {
                        this._exitFullViewport()
                    }
                    break
                }
                this.playerModel.applyCommand("fullscreen", full);
                return this
            };
            this.setResize = function () {
                this._modelUpdateListener("resize");
                return this
            };
            this.addListener = function (evt, callback) {
                var ref = this;
                this._enqueue(function () {
                    ref._addListener(evt, callback)
                })
            };
            this._addListener = function (evt, callback) {
                var listenerObj = {
                    event: evt,
                    callback: callback
                };
                this.listeners.push(listenerObj);
                return this
            };
            this.removeListener = function (evt, callback) {
                var len = this.listeners.length;
                for (var i = 0; i < len; i++) {
                    if (this.listeners[i] == undefined) {
                        continue
                    }
                    if (this.listeners[i].event != evt && evt !== "*") {
                        continue
                    }
                    if (this.listeners[i].callback != callback && callback !== undefined) {
                        continue
                    }
                    this.listeners.splice(i, 1)
                }
                return this
            };
            this.setItem = function () {
                var itemData = arguments[0];
                var affectedIdx = 0;
                this._clearqueue();
                if (this.env.loading === true) {
                    return this
                }
                if (itemData == null) {
                    affectedIdx = this._removeItem(arguments[1]);
                    if (affectedIdx === this._currentItem) {
                        this.setActiveItem("previous")
                    }
                } else {
                    affectedIdx = this._addItem(this._prepareMedia({
                        file: itemData,
                        config: itemData.config || {}
                    }), arguments[1], arguments[2]);
                    if (affectedIdx === this._currentItem) {
                        this.setActiveItem(this._currentItem)
                    }
                }
                return this
            };
            this.setFile = function (arg, ext, dataType) {
                var data = arg || {},
                    result = {},
                    externalData = ext || false;
                this._clearqueue();
                if (this.env.loading === true) {
                    return this
                }
                if (typeof data == "object" && data.length == 0) {
                    return false
                }
                this.env.loading = true;
                this._detachplayerModel();
                if (typeof data == "object") {
                    if (data.length == 0) {
                        this._reelUpdate({});
                        return false
                    }
                    this._debug("Applying incoming JS Object", data);
                    this._reelUpdate(data);
                    return this
                }
                if (typeof data == "string") {
                    var splt = [];
                    splt[0] = data;
                    if (data.indexOf(this.config._FilePosterSeparator) > -1) {
                        splt = data.split(this.config._FilePosterSeparator);
                        data.config = {
                            poster: splt[1]
                        }
                    } else {
                        result[0] = {};
                        result[0].file = data
                    }
                    if (externalData === false) {
                        this._debug("Applying incoming single file:" + result[0]["file"], data);
                        this._reelUpdate(result)
                    } else {
                        this._debug("Loading external data from " + splt[0] + " supposed to be " + dataType);
                        this._playlistServer = splt[0];
                        this.getFromUrl(splt[0], this, "_reelUpdate", this.config._reelParser, dataType)
                    }
                }
                return this
            };
            this.openUrl = function (cfg) {
                cfg = cfg || {
                    url: "",
                    target: "",
                    pause: false
                };
                window.open(cfg.url, cfg.target).focus();
                if (cfg.pause === true) {
                    this.setPause()
                }
                return this
            };
            this.selfDestruct = function () {
                var ref = this;
                this._enqueue(function () {
                    ref._selfDestruct()
                });
                return this
            }, this._selfDestruct = function () {
                var ref = this;
                $(this).unbind();
                this.removePlugin();
                this._removeGUIListeners();
                $($("<div></div>").html($(this.env.srcNode).clone()));
                this.env.playerDom.replaceWith($($("<div></div>").html($(this.env.srcNode).clone())));
                $.each(projekktors, function (idx) {
                    try {
                        if (this.getId() == ref.getId() || this.getId() == ref.getId() || this.getParent() == ref.getId()) {
                            projekktors.splice(idx, 1);
                            return
                        }
                    } catch (e) {}
                });
                return this
            };
            this.reset = function () {
                var ref = this;
                this._clearqueue();
                this._enqueue(function () {
                    ref._reset()
                });
                return this
            }, this._reset = function () {
                $(this).unbind();
                this.env.mediaContainer = null;
                this.removePlugin();
                this._removeGUIListeners();
                this._init(this.env.playerDom, this.config);
                return this
            }, this._cookie = function (key, value) {
                if (document.cookie === undefined) {
                    return null
                }
                if (document.cookie === false) {
                    return null
                }
                var options = {};
                if (arguments.length > 1 && (value === null || typeof value !== "object")) {
                    if (value === null) {
                        options.expires = -1
                    }
                    if (typeof options.expires === "number") {
                        var days = options.expires,
                            t = options.expires = new Date();
                        t.setDate(t.getDate() + days)
                    }
                    return (document.cookie = [encodeURIComponent(this.config._cookieName + "_" + key), "=", options.raw ? String(value) : encodeURIComponent(String(value)), options.expires ? "; expires=" + this.config._cookieExpiry.toUTCString() : "", options.path ? "; path=" + options.path : "", options.domain ? "; domain=" + options.domain : "", options.secure ? "; secure" : ""].join(""))
                }
                options = value || {};
                var result, decode = options.raw ?
                function (s) {
                    return s
                } : decodeURIComponent;
                var returnthis = (result = new RegExp("(?:^|; )" + encodeURIComponent(this.config._cookieName + "_" + key) + "=([^;]*)").exec(document.cookie)) ? decode(result[1]) : null;
                return (returnthis != null) ? this._cleanValue(returnthis) : null
            };
            this._testMediaSupport = function (foceTest) {
                var result = [];
                var hasNativeAudio = false;
                var hasFlash = (this.getFlashVersion() > 0);
                var nativeElementType = "";
                for (var i = 0; i < $p.mmap.length; i++) {
                    result[$p.mmap[i]["type"]] = "NA";
                    if ($p.mmap[i]["model"] == "image" && $p.mmap[i]["platform"] == "native") {
                        result[$p.mmap[i]["type"]] = "image";
                        continue
                    }
                    if ($p.mmap[i]["platform"] == "internal") {
                        result[$p.mmap[i]["type"]] = $p.mmap[i]["model"];
                        continue
                    }
                    if ((hasFlash == true || $p.mmap[i]["fixed"] === "maybe") && $p.mmap[i]["platform"] == "flash") {
                        if ($p.mmap[i]["model"].toUpperCase().indexOf("flash") > -1) {
                            if (this.getConfig("enableFlashFallback") == true || foceTest === true) {
                                result[$p.mmap[i]["type"]] = ($p.mmap[i]["type"].indexOf("audio") > -1) ? "audioflash" : "videoflash"
                            }
                        } else {
                            result[$p.mmap[i]["type"]] = $p.mmap[i]["model"]
                        }
                    }
                    if ($p.mmap[i]["fixed"] !== true && (this.getConfig("enableNativePlayback") !== false || foceTest === true)) {
                        if (($p.mmap[i]["type"].indexOf("video") > -1 || $p.mmap[i]["type"].indexOf("audio") > -1)) {
                            try {
                                nativeElementType = ($p.mmap[i]["type"].indexOf("video") > -1) ? "video" : "audio";
                                var testObject = document.createElement(nativeElementType);
                                if (testObject.canPlayType != false) {
                                    switch (testObject.canPlayType($p.mmap[i]["type"])) {
                                    case "no":
                                        break;
                                    case "":
                                        break;
                                    case "maybe":
                                        if ($.browser.opera) {
                                            if ($.browser.version.slice(0, 2) < 11) {
                                                break
                                            }
                                        }
                                    case "probably":
                                    default:
                                        result[$p.mmap[i]["type"]] = nativeElementType
                                    }
                                }
                            } catch (e) {}
                        }
                    }
                }
                return result
            };
            this.randomId = function (length) {
                var chars = "abcdefghiklmnopqrstuvwxyz";
                var result = "";
                for (var i = 0; i < length; i++) {
                    var rnum = Math.floor(Math.random() * chars.length);
                    result += chars.substring(rnum, rnum + 1)
                }
                return result
            };
            this.toAbsoluteURL = function (s) {
                var l = location,
                    h, p, f, i;
                if (s == null || s == "") {
                    return ""
                }
                if (/^\w+:/.test(s)) {
                    return s
                }
                h = l.protocol + "//" + l.host;
                if (s.indexOf("/") == 0) {
                    return h + s
                }
                p = l.pathname.replace(/\/[^\/]*$/, "");
                f = s.match(/\.\.\//g);
                if (f) {
                    s = s.substring(f.length * 3);
                    for (i = f.length; i--;) {
                        p = p.substring(0, p.lastIndexOf("/"))
                    }
                }
                return h + p + "/" + s
            };
            this.parseTemplate = function (template, data) {
                if (data === undefined || data.length == 0 || typeof data != "object") {
                    return template
                }
                for (var i in data) {
                    template = template.replace(new RegExp("%{" + i + "}", "gi"), data[i])
                }
                template = template.replace(/%{(.*?)}/gi, "");
                return template
            };
            this._cleanValue = function (value) {
                switch (value) {
                case "false":
                    return false;
                case "true":
                    return true;
                case "null":
                    return null;
                case "undefined":
                    return "";
                case undefined:
                    return false;
                default:
                    return (typeof value != "string" && typeof value != "number" && typeof value != "boolean") ? false : value
                }
            };
            this._getFilesFromHash = function (idx) {
                var data = window.location.hash.substring(1);
                if (data == undefined || data == null) {
                    return false
                }
                if (data.indexOf(this.config._FilePosterSeparator) > -1) {
                    data = data.split(this.config._FilePosterSeparator)
                }
                if (data[1] && idx == 1) {
                    return data[1]
                } else {
                    if (idx == 0) {
                        return data[0]
                    }
                }
                return false
            };
            this._getTypeFromFileExtension = function (url) {
                var fileExt = "",
                    extRegEx = [],
                    extTypes = {},
                    extRegEx = [];
                for (var i in $p.mmap) {
                    extRegEx.push("." + $p.mmap[i].ext);
                    extTypes[$p.mmap[i].ext] = $p.mmap[i]
                }
                extRegEx = "^.*.(" + extRegEx.join("|") + ")$";
                try {
                    fileExt = url.match(new RegExp(extRegEx))[1];
                    fileExt = (!fileExt) ? "NaN" : fileExt.replace(".", "")
                } catch (e) {
                    fileExt = "NaN"
                }
                return extTypes[fileExt].type
            };
            this._debug = function (desc, data) {
                if (this.config._debug === false) {
                    return
                }
                if (this.config._debug == "console") {
                    try {
                        if (desc) {
                            console.log(desc)
                        }
                        if (data) {
                            console.log(data)
                        }
                    } catch (e) {}
                    return
                }
                var result = "<pre><b>" + desc + "</b>\n";
                if (data && this.config.debugLevel > 1) {
                    switch (typeof data) {
                    case "undefined":
                        break;
                    case "object":
                        var temp = "";
                        if (temp == "") {
                            temp = "";
                            for (var i in data) {
                                temp += i + " : " + data[i] + "\n"
                            }
                        }
                        result += temp;
                        break;
                    case "string":
                        result += data
                    }
                    result += "</pre>"
                }
                try {
                    $("#" + this.config._debug).prepend(result)
                } catch (e) {}
            };
            this._raiseError = function (txt) {
                this.env.playerDom.html(txt).css({
                    color: "#fdfdfd",
                    backgroundColor: "#333",
                    lineHeight: this.config.height + "px",
                    textAlign: "center",
                    display: "block"
                });
                this._bubbleEvent("error")
            };
            this._readMediaTag = function (domNode) {
                var result = {};
                if (domNode[0].tagName.toUpperCase() != "VIDEO" && domNode[0].tagName.toUpperCase() != "AUDIO") {
                    return false
                }
                result = {
                    autoplay: (domNode.prop("autoplay") !== undefined && domNode.prop("autoplay") !== false) ? true : false,
                    controls: (domNode.prop("controls") !== undefined && domNode.prop("controls") !== false) ? true : false,
                    loop: (domNode.prop("loop") !== undefined && domNode.prop("loop") !== false) ? true : false,
                    title: (domNode.attr("title") !== undefined && domNode.attr("title") !== false) ? domNode.attr("title") : "",
                    poster: (domNode.attr("poster") !== undefined && domNode.attr("poster") !== false) ? domNode.attr("poster") : "",
                    width: (domNode.attr("width") !== undefined && domNode.attr("width") !== false) ? domNode.attr("width") : false,
                    height: (domNode.attr("height") !== undefined && domNode.attr("height") !== false) ? domNode.attr("height") : false
                };
                if ($.browser.msie) {
                    var htmlTag = $($("<div></div>").html($(domNode).clone())).html();
                    var attr = ["autoplay", "controls", "loop"];
                    for (var i = 0; i < attr.length; i++) {
                        if (htmlTag.indexOf(attr[i]) == -1) {
                            continue
                        }
                        result[attr[i]] = true
                    }
                }
                domNode.prop("autoplay", false);
                result.playlist = [];
                result.playlist[0] = [];
                if (srcNode.attr("src")) {
                    result.playlist[0].push({
                        src: srcNode.attr("src"),
                        type: srcNode.attr("type") || this._getTypeFromFileExtension(srcNode.attr("src"))
                    })
                }
                if ($.browser.msie && $.browser.version < 9) {
                    var childNode = srcNode;
                    do {
                        childNode = childNode.next("source");
                        if (childNode.attr("src")) {
                            result.playlist[0].push({
                                src: childNode.attr("src"),
                                type: childNode.attr("type") || this._getTypeFromFileExtension(childNode.attr("src"))
                            })
                        }
                    } while (childNode.attr("src"))
                } else {
                    srcNode.children("source").each(function () {
                        if ($(this).attr("src")) {
                            result.playlist[0].push({
                                src: $(this).attr("src"),
                                type: $(this).attr("type") || ref._getTypeFromFileExtension($(this).attr("src"))
                            })
                        }
                    })
                }
                return result
            };
            this.cDump = function () {
                try {
                    JSON.stringify({})
                } catch (e) {
                    return
                }
                if ($("#debug" + this.getId()).length > 0) {
                    $("#debug" + this.getId()).remove();
                    return
                }
                var result = {
                    timestamp: new Date().getTime(),
                    agent: navigator.userAgent.toLowerCase(),
                    dom: $($("<div></div>").html($(this.env.srcNode).clone())).html(),
                    media: this.media,
                    grid: {},
                    config: this.config
                };
                for (var i in this.mediaGrid) {
                    result.grid[i] = this.mediaGrid[i]
                }
                var w = $(document.createElement("div")).attr("id", "debug" + this.getId()).css({
                    backgroundColor: "#FF0000",
                    color: "#fdfdfd",
                    padding: "5px",
                    width: (this.env.playerDom.width() - 10) + "px",
                    zIndex: 99999,
                    position: "absolute",
                    top: this.env.playerDom.position().top,
                    left: this.env.playerDom.position().left
                }).html("<b>" + this.config._messages[1000] + "</b>");
                var tA = $(document.createElement("textarea")).attr("id", "debug" + this.getId()).css({
                    backgroundColor: "#fdfdfd",
                    width: "100%",
                    height: "100px",
                    border: 0
                }).html(JSON.stringify(result)).appendTo(w);
                $("body").append(w);
                tA.select()
            };
            this._applyDimensions = function () {
                if (this.config._height !== false && this.config._width !== false) {
                    if (this.config._width <= this.config._minWidth) {
                        this.config._width = this.config._minWidth;
                        this.env.autoSize = true
                    }
                    if (this.config._height <= this.config._minHeight) {
                        this.config._height = this.config._minHeight;
                        this.env.autoSize = true
                    }
                }
                this.env.playerDom.css({
                    overflow: "hidden"
                });
                if (this.config._width !== false && this.config._height !== false) {
                    this.env.playerDom.css({
                        width: this.config._width + "px",
                        height: this.config._height + "px"
                    })
                }
            };
            this._init = function () {
                this.env.srcNode = $.extend(true, {}, srcNode);
                var cfgBySource = this._readMediaTag(srcNode);
                if (cfgBySource !== false) {
                    this.env.playerDom = $(document.createElement("div")).attr({
                        "class": srcNode[0].className,
                        style: srcNode.attr("style")
                    });
                    srcNode.replaceWith(this.env.playerDom)
                } else {
                    cfgBySource = {
                        width: (srcNode.attr("width")) ? srcNode.attr("width") : srcNode.width(),
                        height: (srcNode.attr("height")) ? srcNode.attr("height") : srcNode.height()
                    };
                    this.env.playerDom = srcNode
                }
                cfg = $.extend(true, {}, cfgBySource, cfg);
                for (var i in cfg) {
                    if (this.config["_" + i] != undefined) {
                        this.config["_" + i] = cfg[i]
                    } else {
                        this.config[i] = cfg[i]
                    }
                }
                if (this.getIsMobileClient()) {
                    this.config._autoplay = false
                }
                if (this.config._sandBox !== false && this.config._playlist.length == 0) {
                    this.config._playlist = [];
                    this.config._playlist.push({
                        0: {
                            src: this._getFilesFromHash(0),
                            type: this._getTypeFromFileExtension(this._getFilesFromHash(0))
                        },
                        config: {
                            poster: this._getFilesFromHash(1)
                        }
                    })
                }
                this._id = srcNode[0].id || this.randomId(8);
                this.env.playerDom.attr("id", this._id);
                if (this.config._theme) {
                    this.getFromUrl(this.parseTemplate(this.config._themeRepo, {
                        id: this.config._theme,
                        ver: this.config._version
                    }), this, "_applyTheme", false, "jsonp")
                } else {
                    this._start(false)
                }
                return this
            };
            this._start = function (data) {
                var ref = this,
                    files = [];
                this._applyDimensions();
                this.mediaGrid = this._testMediaSupport();
                try {
                    $("#projekktorver").html("V" + this.config._version)
                } catch (e) {}
                this._registerPlugins();
                if (this.config._sandBox !== false) {
                    if (this.getSandboxWindow()) {
                        this.getSandboxWindow().ready(function () {
                            ref._enterFullViewport();
                            ref.env.inFullscreen = false
                        })
                    } else {
                        ref._enterFullViewport();
                        ref.env.inFullscreen = false;
                        this.config.disableFullscreen = true
                    }
                }
                if (typeof onReady === "function") {
                    this._enqueue(function () {
                        onReady(ref)
                    })
                }
                for (var i in this.config._playlist[0]) {
                    if (this.config._playlist[0][i].type) {
                        if (this.config._playlist[0][i].type.indexOf("/json") > -1 || this.config._playlist[0][i].type.indexOf("/xml") > -1) {
                            this.setFile(this.config._playlist[0][i].src, true, this.config._playlist[0][i].type);
                            return this
                        }
                    }
                }
                this.setFile(this.config._playlist);
                return this
            };
            this._applyTheme = function (data) {
                var ref = this;
                if (data === false) {
                    this._raiseError("The Projekktor theme-set specified could not be loaded.");
                    return false
                }
                if (typeof data.version == "string") {
                    if ((parseInt(this.config._version.split(".")[0]) || 0) < (parseInt(data.version.split(".")[0]) || 0) || (parseInt(this.config._version.split(".")[1]) || 0) < (parseInt(data.version.split(".")[1]) || 0)) {
                        this._raiseError("You are using Projekktor V" + this.config._version + " but the applied theme requires at least V" + data.version + ".");
                        return false
                    }
                }
                if (typeof data.config.plugins == "object") {
                    for (var i = 0; i < data.config.plugins.length; i++) {
                        try {
                            typeof eval("projekktor" + data.config.plugins[i])
                        } catch (e) {
                            this._raiseError("The applied theme requires the following Projekktor plugin(s): <b>" + data.config.plugins.join(", ") + "</b>");
                            return false
                        }
                    }
                }
                if (typeof data.css == "string") {
                    $("head").append('<style type="text/css">' + this.parseTemplate(data.css, {
                        rp: data.baseURL
                    }) + "</style>")
                }
                if (typeof data.html == "string") {
                    this.env.playerDom.html(this.parseTemplate(data.html, {
                        p: this.config._cssClassPrefix
                    }))
                }
                this.env.playerDom.addClass(data.id);
                if (typeof data.config == "object") {
                    for (var i in data.config) {
                        if (this.config["_" + i] != undefined) {
                            this.config["_" + i] = data.config[i]
                        } else {
                            this.config[i] = data.config[i]
                        }
                    }
                }
                if (data.onReady) {
                    this._enqueue(function (player) {
                        eval(data.onReady)
                    })
                }
                return this._start()
            };
            return this._init()
        }
    };
    $p.mmap = [];
    $p.models = {};
    $p.newModel = function (obj, ext) {
        var result = false,
            extend = ($p.models[ext] && ext != undefined) ? $p.models[ext].prototype : {};
        if (typeof obj != "object") {
            return result
        }
        if (!obj.modelId) {
            return result
        }
        if ($p.models[obj.modelId]) {
            return result
        }
        $p.models[obj.modelId] = function () {};
        $p.models[obj.modelId].prototype = $.extend({}, extend, obj);
        for (var i = 0; i < obj.iLove.length; i++) {
            obj.iLove[i].model = obj.modelId.toLowerCase();
            $p.mmap.push(obj.iLove[i])
        }
        return true
    }
});
var projekktorPluginInterface = function () {};
jQuery(function (a) {
    projekktorPluginInterface.prototype = {
        pluginReady: false,
        name: "",
        pp: {},
        config: {},
        playerDom: null,
        canvas: {
            media: null,
            projekktor: null
        },
        _appliedDOMObj: [],
        _init: function (b) {
            this.config = a.extend(true, this.config, b);
            this.initialize()
        },
        getConfig: function (b) {
            var c = undefined;
            if (this.pp.getConfig("plugin_" + this.name) != undefined) {
                c = this.pp.getConfig("plugin_" + this.name)[b]
            }
            if (c == undefined) {
                c = this.pp.getConfig(b)
            }
            if (c == undefined) {
                c = (this.config[b] || false)
            }
            return c
        },
        sendEvent: function (b, c) {
            this.pp._bubbleEvent({
                _plugin: this.name,
                _event: b
            }, c)
        },
        deconstruct: function () {
            this.pluginReady = false;
            a.each(this._appliedDOMObj, function () {
                a(this).remove()
            })
        },
        parseTemplate: function (b, c) {
            return this.pp.parseTemplate(b, c)
        },
        blockSelection: function (b) {
            if (!b) {
                return
            }
            if (a.browser.mozilla) {
                b.css("MozUserSelect", "none")
            } else {
                if (a.browser.msie) {
                    b.bind("selectstart", function () {
                        return false
                    })
                } else {
                    b.mousedown(function () {
                        return false
                    })
                }
            }
        },
        applyToPlayer: function (c, d) {
            var e = this.getConfig("cssClassPrefix");
            if (!c) {
                return null
            }
            if (this.playerDom.find("." + e + c.attr("class")).length == 0) {
                var b = c.attr("class");
                c.removeClass(b);
                c.addClass(e + b);
                if (d === true) {
                    c.prependTo(this.playerDom)
                } else {
                    c.appendTo(this.playerDom)
                }
                this._appliedDOMObj.push(c);
                return c
            }
            var b = c.attr("class");
            c = this.playerDom.find("." + e + c.attr("class"));
            c.removeClass(b);
            c.addClass(e + b);
            return c
        },
        initialize: function () {},
        detachHandler: function (b) {},
        displayReadyHandler: function (b) {},
        pluginsReadyHandler: function (b) {},
        stateHandler: function () {},
        bufferHandler: function () {},
        scheduleLoading: function (b) {},
        configModified: function (b) {},
        scheduledHandler: function (b) {},
        scheduleModifiedHandler: function (b) {},
        itemHandler: function (b) {},
        startHandler: function (b) {},
        doneHandler: function (b) {},
        stopHandler: function (b) {},
        endedHandler: function (b) {},
        canplayHandler: function (b) {},
        volumeHandler: function (b) {},
        timeHandler: function (b) {},
        progressHandler: function (b) {},
        mousemoveHandler: function (b) {},
        mouseleaveHandler: function (b) {},
        mouseeterHandler: function (b) {},
        fullscreenHandler: function (b) {},
        awakingHandler: function (b) {},
        keyHandler: function (b) {}
    }
});
var playerModel = function () {};
jQuery(function (a) {
    playerModel.prototype = {
        modelId: "player",
        iLove: [],
        _currentState: null,
        _currentBufferState: null,
        _KbPerSec: 0,
        _bandWidthTimer: null,
        _isPoster: false,
        _isPlaying: false,
        modelReady: true,
        requiresFlash: false,
        hasGUI: false,
        allowRandomSeek: false,
        flashVerifyMethod: "api_get",
        elementReady: false,
        mediaElement: null,
        pp: {},
        media: {
            duration: 0,
            position: 0,
            startOffset: 0,
            file: false,
            poster: "",
            ended: false,
            message: "",
            error: null,
            mediaType: "",
            loadProgress: 0,
            errorCode: 0,
            message: "",
            type: "NA",
            volume: 0
        },
        _init: function (b) {
            this.pp = b.pp || null;
            this.media = b.media || this.media;
            this._ap = b.autoplay;
            this.init()
        },
        init: function (b) {
            this.ready()
        },
        ready: function () {
            this.sendUpdate("modelReady");
            this.displayItem(this._ap)
        },
        displayItem: function (b) {
            if (b !== true || this.getState() === "STOPPED") {
                this._setState("idle");
                this.applyImage(this.getPoster(), this.pp.getMediaContainer().html(""));
                this._isPoster = true;
                this.elementReady = true
            } else {
                if (this.hasGUI) {
                    this.pp.env.playerDom.children().not(".ppdisplay").addClass("inactive").removeClass("active")
                }
                if (this.requiresFlash !== false) {
                    if (this.requiresFlash > this.pp.getFlashVersion()) {
                        this.setTestcard(6);
                        return
                    }
                }
                this.elementReady = false;
                this._isPoster = false;
                this.applyMedia(this.pp.getMediaContainer().html("").show())
            }
            this.waitTillReady(b)
        },
        applyMedia: function () {},
        sendUpdate: function (b, c) {
            this.pp._modelUpdateListener(b, c)
        },
        waitTillReady: function (c) {
            var b = this;
            (function () {
                try {
                    if (b.elementReady !== true) {
                        setTimeout(arguments.callee, 70);
                        return
                    }
                } catch (d) {}
                if (b.getState() !== "STOPPED" || c === true) {
                    try {
                        b.addListeners()
                    } catch (d) {}
                }
                b.pp._modelUpdateListener("displayReady");
                if (c === true) {
                    b.setPlay()
                }
            })()
        },
        addListeners: function () {},
        removeListeners: function () {
            try {
                this.mediaElement.unbind()
            } catch (b) {}
        },
        detachMedia: function () {},
        destroy: function () {
            this.setPause();
            this.removeListeners();
            this.detachMedia();
            try {
                a("#" + this.mediaElement.id).empty()
            } catch (b) {}
            try {
                a("#" + this.mediaElement.id).remove()
            } catch (b) {}
            try {
                this.mediaElement.remove()
            } catch (b) {}
            this.pp.getMediaContainer().html("");
            this.mediaElement = null;
            this.media.loadProgress = 0;
            this.media.playProgress = 0;
            this.media.position = 0;
            this.media.duration = 0;
            this._setState("stopped")
        },
        reInit: function () {
            if (this.requiresFlash === false || !(a.browser.mozilla) || this.getState() === "ERROR" || this.pp.getConfig("bypassFlashFFFix") === true) {
                return
            }
            this.sendUpdate("FFreinit");
            this.removeListeners();
            this.displayItem((this.getState() !== "IDLE"))
        },
        applyCommand: function (c, b) {
            switch (c) {
            case "play":
                if (this.getState() === "IDLE") {
                    this._setState("awakening");
                    this.displayItem(true);
                    break
                }
                this.setPlay();
                break;
            case "pause":
                this.setPause();
                break;
            case "volume":
                if (!this.setVolume(b)) {
                    this.sendUpdate("volume", b)
                }
                break;
            case "stop":
                this.setStop();
                break;
            case "seek":
                if (this.media.loadProgress == -1) {
                    break
                }
                this.setSeek(b);
                break;
            case "fullscreen":
                this.sendUpdate("fullscreen", b);
                this.setFullscreen(b);
                this.reInit();
                break;
            case "resize":
                this.setResize();
                this.sendUpdate("resize", b);
                break
            }
        },
        setSeek: function (b) {},
        setPlay: function () {},
        setPause: function () {},
        setStop: function () {
            this.detachMedia();
            this.destroy();
            this.displayItem(false)
        },
        setVolume: function (b) {},
        setFullscreen: function (b) {},
        setResize: function () {},
        getVolume: function () {
            var b = this.mediaElement.prop("muted");
            return (b == true) ? 0 : this.mediaElement.prop("volume")
        },
        getLoadProgress: function () {
            return this.media.loadProgress || 0
        },
        getLoadPlaybackProgress: function () {
            return this.media.playProgress || 0
        },
        getPosition: function () {
            return this.media.position || 0
        },
        getDuration: function () {
            return this.media.duration || 0
        },
        getInFullscreen: function () {
            return this.pp.getInFullscreen()
        },
        getKbPerSec: function () {
            return this._KbPerSec
        },
        getIsPlaying: function () {
            return this._isPlaying
        },
        getState: function () {
            return (this._currentState == null) ? "IDLE" : this._currentState
        },
        getFile: function () {
            return this.media.file || null
        },
        getModelName: function () {
            return this.modelId || null
        },
        getHasGUI: function () {
            return (this.hasGUI && !this._isPoster)
        },
        getIsReady: function () {
            return this.elementReady
        },
        getPoster: function () {
            return this.pp.getConfig("poster")
        },
        timeListener: function (e) {
            if (e == undefined) {
                return
            }
            var d = (e.position != undefined) ? e.position : e.currentTime;
            var c = e.duration;
            var b = (d > 0 && c > 0) ? d * 100 / c : 0;
            this.media.duration = this._roundNumber(c, 2);
            this.media.position = this._roundNumber(d, 2);
            this.media.playProgress = b;
            this.sendUpdate("time", this.media.position);
            this.loadProgressUpdate()
        },
        loadProgressUpdate: function () {
            try {
                var d = this.mediaElement[0];
                if (typeof d.buffered !== "object") {
                    return
                }
                if (typeof d.buffered.length <= 0) {
                    return
                }
                var b = Math.round(d.buffered.end(d.buffered.length - 1) * 100) / 100,
                    c = b * 100 / this.media.duration;
                if (c == this.media.loadProgress) {
                    return
                }
                this.media.loadProgress = (this.allowRandomSeek === true) ? 100 : -1;
                this.media.loadProgress = (this.media.loadProgress < 100 || this.media.loadProgress == undefined) ? c : 100;
                this.sendUpdate("progress", this.media.loadProgress)
            } catch (f) {}
        },
        progressListener: function (c, h) {
            try {
                if (typeof this.mediaElement[0].buffered == "object") {
                    if (this.mediaElement[0].buffered.length > 0) {
                        this.mediaElement.unbind("progress");
                        return
                    }
                }
            } catch (g) {}
            if (this._bandWidthTimer == null) {
                this._bandWidthTimer = (new Date()).getTime()
            }
            var f = 0,
                d = 0;
            if (!isNaN(c.loaded / c.total)) {
                f = c.loaded;
                d = c.total
            } else {
                if (c.originalEvent && !isNaN(c.originalEvent.loaded / c.originalEvent.total)) {
                    f = c.originalEvent.loaded;
                    d = c.originalEvent.total
                } else {
                    if (h && !isNaN(h.loaded / h.total)) {
                        f = h.loaded;
                        d = h.total
                    }
                }
            }
            var b = (f > 0 && d > 0) ? f * 100 / d : 0;
            if (Math.round(b) > Math.round(this.media.loadProgress)) {
                this._KbPerSec = ((f / 1024) / (((new Date()).getTime() - this._bandWidthTimer) / 1000))
            }
            b = (this.media.loadProgress !== 100) ? b : 100;
            b = (this.allowRandomSeek === true) ? 100 : b;
            if (this.media.loadProgress != b) {
                this.media.loadProgress = b;
                this.sendUpdate("progress", b)
            }
            if (this.media.loadProgress >= 100 && this.allowRandomSeek == false) {
                this._setBufferState("full")
            }
        },
        endedListener: function (b) {
            if (this.mediaElement === null) {
                return
            }
            this._setState("completed")
        },
        waitingListener: function (b) {
            this._setBufferState("empty")
        },
        canplayListener: function (b) {
            this._setBufferState("full")
        },
        canplaythroughListener: function (b) {
            this._setBufferState("full")
        },
        suspendListener: function (b) {
            this._setBufferState("full")
        },
        playingListener: function (b) {
            this._setState("playing")
        },
        startListener: function (b) {
            this.applyCommand("volume", this.pp.getConfig("volume"));
            this._setState("playing")
        },
        pauseListener: function (b) {
            this._setState("paused")
        },
        volumeListener: function (b) {
            this.sendUpdate("volume", this.getVolume())
        },
        flashReadyListener: function () {
            this.elementReady = true
        },
        errorListener: function (b, d) {
            try {
                switch (b.target.error.code) {
                case b.target.error.MEDIA_ERR_ABORTED:
                    this.setTestcard(1);
                    break;
                case b.target.error.MEDIA_ERR_NETWORK:
                    this.setTestcard(2);
                    break;
                case b.target.error.MEDIA_ERR_DECODE:
                    this.setTestcard(3);
                    break;
                case b.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
                    this.setTestcard(4);
                    break;
                default:
                    this.setTestcard(5);
                    break
                }
            } catch (c) {}
        },
        metaDataListener: function (c) {
            try {
                this.videoWidth = c.videoWidth;
                this.videoHeight = c.videoHeight
            } catch (b) {}
            this._scaleVideo()
        },
        setTestcard: function (f, b) {
            var e = this.pp.getMediaContainer(),
                d = this.pp.getConfig("messages"),
                c = (d[f] != undefined) ? d[f] : d[0];
            c = (b != undefined && b != "") ? b : c;
            if (this.pp.getItemCount() > 1) {
                c += d[99]
            }
            if (c.length < 3) {
                c = "ERROR"
            }
            if (f == 100) {
                c = ""
            }
            c = this.pp.parseTemplate(c, a.extend({}, this.media.fileConfig, {
                flashver: this.requiresFlash
            }));
            e.css({
                width: "100%",
                height: "100%"
            }).html("");
            this.mediaElement = a(document.createElement("div")).addClass("pptestcard").appendTo(e);
            if (c.length > 0) {
                a(document.createElement("p")).appendTo(this.mediaElement).html(c)
            }
            this._setState("error")
        },
        applyImage: function (e, c) {
            var g = a(document.createElement("img")).hide(),
                f = this;
            if (e == "" || e == undefined) {
                g = a(document.createElement("span")).attr({
                    id: this.pp.getMediaId() + "_image"
                }).appendTo(c);
                return g
            }
            g.appendTo(c).attr({
                id: this.pp.getMediaId() + "_image",
                src: e
            }).css({
                position: "absolute"
            });
            g.error(function (h) {
                a(this).remove()
            });
            var b = function (h) {
                    h.realWidth = h.prop("width");
                    h.realHeight = h.prop("height");
                    h.width = function () {
                        return h.realWidth
                    };
                    h.height = function () {
                        return h.realHeight
                    }
                };
            if (a.browser.msie) {
                (function () {
                    try {
                        if (g[0].complete == true) {
                            g.show();
                            b(g);
                            f.stretch(f.pp.getConfig("imageScaling"), g, c.width(), c.height());
                            return
                        }
                        setTimeout(arguments.callee, 100)
                    } catch (h) {
                        setTimeout(arguments.callee, 100)
                    }
                })()
            } else {
                g.load(function (h) {
                    a(this).show();
                    b(g);
                    f.stretch(f.pp.getConfig("imageScaling"), a(this), c.width(), c.height())
                })
            }
            var d = function (i, h) {
                    if (h.is(":visible") === false) {
                        f.pp.removeListener("fullscreen", arguments.callee)
                    }
                    f.stretch(f.pp.getConfig("imageScaling"), i, h.width(), h.height())
                };
            this.pp.addListener("fullscreen", function () {
                d(g, c)
            });
            this.pp.addListener("resize", function () {
                d(g, c)
            });
            return g
        },
        stretch: function (b, d, m, k, f, h) {
            if (d == undefined || d == null) {
                return false
            }
            if (d._originalDimensions === undefined) {
                d._originalDimensions = {};
                d._originalDimensions = {
                    width: d.width(),
                    height: d.height()
                }
            }
            var g = (f !== undefined) ? f : d._originalDimensions.width;
            var c = (h !== undefined) ? h : d._originalDimensions.height;
            var i = (m / g);
            var l = (k / c);
            var e = m;
            var j = k;
            switch (b) {
            case "fill":
                if (i > l) {
                    e = g * i;
                    j = c * i
                } else {
                    if (i < l) {
                        e = g * l;
                        j = c * l
                    }
                }
                break;
            case "aspectratio":
            default:
                if (i > l) {
                    e = g * l;
                    j = c * l
                } else {
                    if (i < l) {
                        e = g * i;
                        j = c * i
                    }
                }
                break
            }
            m = this._roundNumber((e / m) * 100, 0);
            k = this._roundNumber((j / k) * 100, 0);
            if (m == 0 || k == 0) {
                return false
            }
            d.css({
                margin: 0,
                padding: 0,
                width: m + "%",
                height: k + "%",
                left: (100 - m) / 2 + "%",
                top: (100 - k) / 2 + "%"
            });
            if (d._originalDimensions.width != d.width() || d._originalDimensions.height != d.height()) {
                return true
            }
            return false
        },
        toAttributeString: function (c) {
            var d = "";
            for (var b in c) {
                if (b.toUpperCase() === "FLASHVARS") {
                    continue
                }
                if (typeof c[b] != "function") {
                    d += b + '="' + c[b] + '" '
                }
            }
            return d
        },
        toFlashvarsString: function (d) {
            var f = "";
            var e = "";
            for (var c in d) {
                if (typeof d[c] != "function") {
                    e = d[c];
                    for (var b in this.media) {
                        if (typeof e != "string") {
                            continue
                        }
                        e = e.replace("{" + b + "}", this.media[b])
                    }
                    f += c + "=" + encodeURIComponent(e) + "&"
                }
            }
            return f.replace(/&$/, "")
        },
        createFlash: function (h, b) {
            var f = (h.FlashVars === null) ? this.pp.getConfig("flashVars") : h.FlashVars;
            var e = "",
                d = "",
                c = "",
                g = "";
            if (f) {
                f = this.toFlashvarsString(f);
                if (f.length > 0) {
                    h.src += "?" + f
                }
            }
            if (a.browser.msie) {
                g = ' id="' + h.id + '" '
            }
            var d = "<object" + g + ' codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"  name="' + h.name + '" width="' + h.width + '" height="' + h.height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
            d += '<param name="movie" value="' + h.src + '"></param>';
            d += '<param name="allowScriptAccess" value="' + h.allowScriptAccess + '"></param>';
            d += '<param name="allowFullScreen" value="' + h.allowFullScreen + '"></param>';
            d += '<param name="wmode" value="' + h.wmode + '"></param>';
            var c = "<embed " + this.toAttributeString(h) + ' pluginspage="http://www.macromedia.com/go/getflashplayer" swliveconnect="true" type="application/x-shockwave-flash"></embed>';
            e = d + c;
            e += "</object>";
            if (a.browser.mozilla) {
                e = c
            }
            b[0].innerHTML = e;
            this.mediaElement = a("#" + h.id)[0];
            this._waitforPlayer()
        },
        _waitforPlayer: function () {
            if (this.elementReady == true) {
                return
            }
            var b = this;
            this._setBufferState("empty");
            (function () {
                try {
                    if (b.mediaElement == undefined) {
                        setTimeout(arguments.callee, 100)
                    } else {
                        if (b.mediaElement[b.flashVerifyMethod] == undefined) {
                            setTimeout(arguments.callee, 100)
                        } else {
                            b._setBufferState("full");
                            b.flashReadyListener()
                        }
                    }
                } catch (c) {
                    setTimeout(arguments.callee, 100)
                }
            })()
        },
        _roundNumber: function (b, c) {
            if (b <= 0 || isNaN(b)) {
                return 0
            }
            return Math.round(b * Math.pow(10, c)) / Math.pow(10, c)
        },
        _setState: function (b) {
            if (this._currentState != b) {
                this._currentState = b.toUpperCase();
                this.sendUpdate("state", this._currentState)
            }
        },
        _setBufferState: function (b) {
            if (this._currentBufferState != b) {
                this._currentBufferState = b.toUpperCase();
                this.sendUpdate("buffer", this._currentBufferState)
            }
        },
        _scaleVideo: function (h) {
            var d = this.pp.getMediaContainer();
            if (this.pp.getIsMobileClient()) {
                return
            }
            try {
                var f = d.width();
                var i = d.height();
                var b = this.videoWidth;
                var c = this.videoHeight;
                if (this.stretch(this.pp.getConfig("videoScaling"), this.mediaElement, f, i, b, c)) {
                    this.sendUpdate("scaled", {
                        realWidth: b,
                        realHeight: c,
                        displayWidth: f,
                        displayHeight: i
                    })
                }
            } catch (g) {}
        }
    }
});
jQuery(function (a) {
    $p.newModel({
        modelId: "NA",
        iLove: [{
            ext: "NaN",
            type: "none/none",
            platform: "native"
        }],
        hasGUI: true,
        applyMedia: function (b) {
            if (this.pp.getConfig("enableTestcard") && !this.pp.getIsMobileClient()) {
                this.setTestcard((this.media.file !== "" && this.media.errorCode === 7) ? 5 : this.media.errorCode);
                this.elementReady = true
            } else {
                this.elementReady = true;
                this.applyCommand("stop");
                window.location.href = this.media.file
            }
        },
        setPlay: function () {
            this.sendUpdate("start")
        },
        setPause: function () {
            if (this._hasEnded == false) {
                this._hasEnded = true;
                this.sendUpdate("ended")
            }
        }
    })
});
jQuery(function (a) {
    $p.newModel({
        modelId: "PLAYLIST",
        iLove: [{
            ext: "json",
            type: "text/json",
            platform: "internal"
        }, {
            ext: "jsonp",
            type: "text/jsonp",
            platform: "internal"
        }, {
            ext: "xml",
            type: "text/xml",
            platform: "internal"
        }],
        applyMedia: function (b) {
            this.elementReady = true
        },
        setPlay: function () {
            this.sendUpdate("playlist", this.media.file)
        }
    })
});
jQuery(function (a) {
    $p.newModel({
        modelId: "VIDEOFLASH",
        iLove: [{
            ext: "flv",
            type: "video/x-flv",
            platform: "flash",
            fixed: true
        }, {
            ext: "flv",
            type: "video/flv",
            platform: "flash",
            fixed: true
        }, {
            ext: "mp4",
            type: "video/mp4",
            platform: "flash"
        }, {
            ext: "mov",
            type: "video/quicktime",
            platform: "flash"
        }, {
            ext: "m4v",
            type: "video/mp4",
            platform: "flash"
        }],
        requiresFlash: 9,
        allowRandomSeek: false,
        flashVerifyMethod: "api_get",
        _jarisVolume: 0,
        applyMedia: function (b) {
            var c = {
                id: this.pp.getMediaId() + "_flash",
                name: this.pp.getMediaId() + "_flash",
                src: this.pp.getConfig("playerFlashMP4"),
                width: "100%",
                height: "100%",
                allowScriptAccess: "always",
                allowFullScreen: "true",
                allowNetworking: "all",
                wmode: "transparent",
                bgcolor: "#000000",
                FlashVars: {
                    source: this.media.file,
                    type: "video",
                    streamtype: this.pp.getConfig("flashStreamType"),
                    server: (this.pp.getConfig("flashStreamType") == "rtmp") ? this.pp.getConfig("flashRTMPServer") : "",
                    autostart: "false",
                    hardwarescaling: "true",
                    controls: "false",
                    jsapi: "true"
                }
            };
            switch (this.pp.getConfig("flashStreamType")) {
            case "rtmp":
            case "http":
                this.allowRandomSeek = true;
                this.media.loadProgress = 100;
                break
            }
            this.createFlash(c, b)
        },
        addListeners: function () {
            this.mediaElement.api_addlistener("onprogress", "projekktor('" + this.pp.getId() + "').playerModel.progressListener");
            this.mediaElement.api_addlistener("ontimeupdate", "projekktor('" + this.pp.getId() + "').playerModel.timeListener");
            if (this.getModelName().indexOf("VIDEO") > -1) {
                this.mediaElement.api_addlistener("ondatainitialized", "projekktor('" + this.pp.getId() + "').playerModel.metaDataListener")
            }
            if (this.getModelName().indexOf("AUDIO") > -1) {
                this.mediaElement.api_addlistener("onconnectionsuccess", "projekktor('" + this.pp.getId() + "').playerModel.startListener")
            }
            this.mediaElement.api_addlistener("onplaypause", "projekktor('" + this.pp.getId() + "').playerModel._playpauseListener");
            this.mediaElement.api_addlistener("onplaybackfinished", "projekktor('" + this.pp.getId() + "').playerModel.endedListener");
            this.mediaElement.api_addlistener("onmute", "projekktor('" + this.pp.getId() + "').playerModel.volumeListener");
            this.mediaElement.api_addlistener("onvolumechange", "projekktor('" + this.pp.getId() + "').playerModel.volumeListener");
            this.mediaElement.api_addlistener("onbuffering", "projekktor('" + this.pp.getId() + "').playerModel.waitingListener");
            this.mediaElement.api_addlistener("onnotbuffering", "projekktor('" + this.pp.getId() + "').playerModel.canplayListener");
            this.mediaElement.api_addlistener("onconnectionfailed", "projekktor('" + this.pp.getId() + "').playerModel.errorListener")
        },
        removeListeners: function () {
            try {
                this.mediaElement.api_removelistener("*")
            } catch (b) {}
        },
        _playpauseListener: function (b) {
            if (b.isplaying) {
                this.playingListener()
            } else {
                this.pauseListener()
            }
        },
        metaDataListener: function (c) {
            this.startListener(c);
            try {
                this.videoWidth = c.width;
                this.videoHeight = c.height;
                this.sendUpdate("scaled", {
                    width: this.videoWidth,
                    height: this.videoHeight
                })
            } catch (b) {}
        },
        setSeek: function (c) {
            try {
                this.mediaElement.api_seek(c)
            } catch (b) {}
        },
        setVolume: function (b) {
            try {
                this.mediaElement.api_volume(b)
            } catch (c) {
                return false
            }
            return true
        },
        setPause: function (b) {
            try {
                this.mediaElement.api_pause()
            } catch (c) {}
        },
        setPlay: function (b) {
            try {
                this.mediaElement.api_play()
            } catch (c) {}
        },
        getVolume: function () {
            return this._jarisVolume
        },
        errorListener: function (b) {
            this.setTestcard(4)
        },
        volumeListener: function (b) {
            if (this._jarisVolume != b.volume) {
                this._jarisVolume = b.volume;
                this.sendUpdate("volume", b.volume)
            }
        },
        detachMedia: function () {
            try {
                a(this.mediaElement).remove()
            } catch (b) {}
        }
    });
    $p.newModel({
        modelId: "AUDIOFLASH",
        iLove: [{
            ext: "mp3",
            type: "audio/mp3",
            platform: "flash"
        }, {
            ext: "m4a",
            type: "audio/mp4",
            platform: "flash"
        }],
        applyMedia: function (b) {
            this.imageElement = this.applyImage(this.pp.getConfig("cover") || this.pp.getConfig("poster"), b);
            var c = a("#" + this.pp.getMediaId() + "_flash_container");
            if (c.length == 0) {
                c = a(document.createElement("div")).css({
                    width: "1px",
                    height: "1px"
                }).attr("id", this.pp.getMediaId() + "_flash_container").appendTo(a(document.body))
            }
            var d = {
                id: this.pp.getMediaId() + "_flash",
                name: this.pp.getMediaId() + "_flash",
                src: this.pp.getConfig("playerFlashMP3"),
                width: "1px",
                height: "1px",
                allowScriptAccess: "always",
                allowFullScreen: "true",
                allowNetworking: "all",
                wmode: "transparent",
                bgcolor: "#000000",
                FlashVars: {
                    source: this.media.file,
                    type: "audio",
                    streamtype: this.pp.getConfig("flashStreamType"),
                    server: (this.pp.getConfig("flashStreamType") == "rtmp") ? this.pp.getConfig("flashRTMPServer") : "",
                    autostart: "false",
                    hardwarescaling: "false",
                    controls: "false",
                    jsapi: "true"
                }
            };
            this.createFlash(d, c)
        }
    }, "VIDEOFLASH")
});
jQuery(function (a) {
    $p.newModel({
        modelId: "VIDEO",
        iLove: [{
            ext: "ogv",
            type: "video/ogg",
            platform: "native"
        }, {
            ext: "webm",
            type: "video/webm",
            platform: "native"
        }, {
            ext: "ogg",
            type: "video/ogg",
            platform: "native"
        }, {
            ext: "anx",
            type: "video/ogg",
            platform: "native"
        }],
        allowRandomSeek: false,
        videoWidth: 0,
        videoHeight: 0,
        element: "video",
        init: function (b) {
            if (this.pp.getIsMobileClient() && this.element == "video") {
                this.hasGUI = true
            }
            this.ready()
        },
        applyMedia: function (d) {
            this.elementReady = false;
            if (this.media.mediaType.indexOf("/ogg") > -1 || this.media.mediaType.indexOf("/webm") > -1) {
                this.allowRandomSeek = true
            }
            if (this.element == "audio") {
                this.imageElement = this.applyImage(this.pp.getConfig("cover") || this.pp.getConfig("poster"), d)
            }
            var b = (this.element == "video") ? d : a("body");
            b.append(a(document.createElement(this.element)).attr({
                id: this.pp.getMediaId() + "_html",
                poster: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi/v//PwNAgAEACQsDAUdpTjcAAAAASUVORK5CYII=",
                loop: false,
                "x-webkit-airplay": "allow"
            }).prop({
                controls: this.hasGUI,
                autoplay: false,
                loop: false
            }).css({
                width: ((this.element == "video") ? "100%" : "1px"),
                height: ((this.element == "video") ? "100%" : "1px"),
                position: "absolute",
                top: 0,
                left: 0
            }));
            this.mediaElement = a("#" + this.pp.getMediaId() + "_html");
            for (var c in this.media._originalConfig) {
                if (this.media._originalConfig[c].src) {
                    a(document.createElement("source")).appendTo(this.mediaElement).attr({
                        src: this.media._originalConfig[c].src,
                        type: this.media._originalConfig[c].type
                    })
                }
            }
            this.waitforPlayer()
        },
        waitforPlayer: function () {
            if (this.elementReady == true) {
                return
            }
            var d = this,
                c = a("#" + this.pp.getMediaId() + "_html");
            try {
                if (c == undefined) {
                    setTimeout(function () {
                        d.waitforPlayer()
                    }, 200);
                    return
                }
                if (c[0].networkState == undefined) {
                    setTimeout(function () {
                        d.waitforPlayer()
                    }, 200);
                    return
                }
                this.elementReady = true
            } catch (b) {
                setTimeout(function () {
                    d.waitforPlayer()
                }, 200);
                return
            }
        },
        addListeners: function () {
            var b = this;
            if (this.element == "video") {
                this.mediaElement.bind("loadedmetadata", function () {
                    b.metaDataListener(this)
                })
            }
            this.mediaElement.bind("pause", function () {
                b.pauseListener(this)
            });
            this.mediaElement.bind("playing", function () {
                b.startListener(this)
            });
            this.mediaElement.bind("play", function () {
                b.playingListener(this)
            });
            this.mediaElement.bind("volumechange", function () {
                b.volumeListener(this)
            });
            this.mediaElement.bind("progress", function (c) {
                b.progressListener(c, this)
            });
            this.mediaElement.bind("timeupdate", function () {
                b.timeListener(this)
            });
            this.mediaElement.bind("ended", function () {
                b.endedListener(this)
            });
            this.mediaElement.bind("waiting", function () {
                b.waitingListener(this)
            });
            this.mediaElement.bind("canplaythrough", function () {
                b.canplayListener(this)
            });
            this.mediaElement.bind("canplay", function () {
                b.canplayListener(this)
            });
            this.mediaElement.bind("error", function (c) {
                b.errorListener(c, this)
            });
            this.mediaElement.bind("suspend", function () {
                b.suspendListener(this)
            })
        },
        updatePlayerInfo: function () {
            if (this.mediaElement == null) {
                return
            }
            var b = this,
                c = this.mediaElement[0];
            if (this.getState() == "PLAYING") {
                switch (c.networkState) {
                case c.NETWORK_EMPTY:
                    break;
                case c.NETWORK_IDLE:
                    break;
                case c.NETWORK_LOADING:
                    break;
                case c.NETWORK_NO_SOURCE:
                    this.setTestcard(4);
                    break
                }
            }
            if ("PAUSED|ERROR".indexOf(this.getState()) == -1) {
                setTimeout(function () {
                    b.updatePlayerInfo()
                }, 500)
            }
        },
        detachMedia: function () {
            try {
                this.mediaElement[0].pause();
                a(this.mediaElement[0]).prop("src", "");
                this.mediaElement[0].load()
            } catch (b) {}
        },
        setPlay: function () {
            try {
                this.mediaElement[0].play()
            } catch (b) {}
            this.updatePlayerInfo()
        },
        setPause: function () {
            try {
                this.mediaElement[0].pause()
            } catch (b) {}
        },
        setVolume: function (b) {
            try {
                this.mediaElement.prop("volume", b)
            } catch (c) {}
            return true
        },
        setSeek: function (c) {
            try {
                this.mediaElement.prop("currentTime", c)
            } catch (b) {}
        },
        setFullscreen: function (b) {
            if (this.element == "audio") {
                return
            }
            this._scaleVideo()
        },
        setResize: function () {
            if (this.element == "audio") {
                return
            }
            this._scaleVideo(false)
        }
    });
    $p.newModel({
        modelId: "AUDIO",
        iLove: [{
            ext: "ogg",
            type: "audio/ogg",
            platform: "native"
        }, {
            ext: "oga",
            type: "audio/ogg",
            platform: "native"
        }],
        imageElement: {},
        element: "audio"
    }, "VIDEO")
});
jQuery(function (a) {
    $p.newModel({
        modelId: "IMAGE",
        iLove: [{
            ext: "jpg",
            type: "image/jpeg",
            platform: "native"
        }, {
            ext: "gif",
            type: "image/gif",
            platform: "native"
        }, {
            ext: "png",
            type: "image/png",
            platform: "native"
        }],
        allowRandomSeek: true,
        _interval: null,
        _position: 0,
        _duration: 0,
        applyMedia: function (b) {
            this.mediaElement = this.applyImage(this.media.file, b);
            this.elementReady = true;
            this._duration = this.pp.getConfig("duration")
        },
        setPlay: function () {
            var b = this;
            this._setBufferState("full");
            this.progressListener(100);
            this.playingListener();
            if (this._duration > 0) {
                this._interval = setInterval(function () {
                    b._position = b._position + 0.5;
                    if (b._position > b._duration) {
                        clearInterval(b._interval);
                        b._setState("completed")
                    }
                    b.timeListener({
                        duration: b._duration,
                        position: b._position
                    })
                }, 500)
            } else {
                b._setState("completed")
            }
        },
        detachMedia: function () {
            clearInterval(this._interval);
            this.mediaElement.remove()
        },
        setPause: function () {
            this.pauseListener();
            clearInterval(this._interval)
        },
        setSeek: function (b) {
            if (b < this._duration) {
                this._position = b
            }
        }
    });
    $p.newModel({
        modelId: "HTML",
        iLove: [{
            ext: "html",
            type: "text/html",
            platform: "internal"
        }],
        applyMedia: function (c) {
            var b = this;
            this.mediaElement = a(document.createElement("iframe")).attr({
                id: this.pp.getMediaId() + "_iframe",
                name: this.pp.getMediaId() + "_iframe",
                src: this.media.file,
                scrolling: "no",
                frameborder: "0",
                width: "100%",
                height: "100%"
            }).css({
                overflow: "hidden",
                border: "0px",
                width: "100%",
                height: "100%"
            }).appendTo(c);
            this.mediaElement.load(function (d) {
                b.success()
            });
            this.mediaElement.error(function (d) {
                b.remove()
            });
            this._duration = this.pp.getConfig("duration")
        },
        success: function () {
            this.elementReady = true
        },
        remove: function () {
            this.mediaElement.remove();
            this.elementReady = true
        }
    }, "IMAGE")
});
jQuery(function (a) {
    $p.newModel({
        modelId: "YTVIDEO",
        iLove: [{
            ext: "youtube.com",
            type: "video/youtube",
            platform: "flash",
            fixed: "maybe"
        }],
        modelReady: false,
        allowRandomSeek: true,
        useIframeAPI: true,
        _updateTimer: null,
        init: function (c) {
            var b = this;
            this.useIframeAPI = this.pp.getConfig("useYTIframeAPI") || this.pp.getIsMobileClient();
            if (this.useIframeAPI !== true) {
                this.requiresFlash = 8;
                this.flashVerifyMethod = "cueVideoById";
                this.ready();
                return
            }
            var d = this.pp.getId();
            if (window.ProjekktorYoutubePlayerAPIReady !== true) {
                a.getScript("http://www.youtube.com/player_api");
                (function () {
                    try {
                        if (window.ProjekktorYoutubePlayerAPIReady == true) {
                            b.ready();
                            return
                        }
                        setTimeout(arguments.callee, 50)
                    } catch (f) {
                        setTimeout(arguments.callee, 50)
                    }
                })()
            } else {
                this.ready()
            }
            window.onYouTubePlayerAPIReady = function () {
                window.ProjekktorYoutubePlayerAPIReady = true
            }
        },
        applyMedia: function (c) {
            this._setBufferState("empty");
            var b = this;
            if (this.useIframeAPI === true) {
                this.mediaElement = new YT.Player(this.pp.getId() + "_media", {
                    width: (this.pp.getIsMobileClient()) ? this.pp.config._width : "100%",
                    height: (this.pp.getIsMobileClient()) ? this.pp.config._height : "100%",
                    playerVars: {
                        autoplay: 0,
                        disablekb: 1,
                        start: 0,
                        controls: 0,
                        enablejsapi: 1,
                        wmode: "transparent"
                    },
                    videoId: this.youtubeGetId(),
                    events: {
                        onReady: function (e) {
                            b.onReady(e)
                        },
                        onStateChange: function (e) {
                            b.stateChange(e)
                        },
                        onError: function (e) {
                            b.errorListener(e)
                        }
                    }
                });
                a(this.mediaElement.a).prop("ALLOWTRANSPARENCY", true).attr({
                    scrolling: "no",
                    frameborder: 0
                }).css({
                    overflow: "hidden",
                    border: "0px",
                    display: "block"
                });
                if (a.browser.mozilla) {
                    this.requiresFlash = 8
                }
            } else {
                var d = {
                    id: this.pp.getId() + "_youtube",
                    name: this.pp.getId() + "_youtube",
                    src: "http://www.youtube.com/apiplayer",
                    width: "100%",
                    height: "100%",
                    bgcolor: "#000000",
                    allowScriptAccess: "always",
                    wmode: "transparent",
                    FlashVars: {
                        enablejsapi: 1,
                        autoplay: 1
                    }
                };
                this.createFlash(d, c)
            }
        },
        flashReadyListener: function () {
            this._youtubeResizeFix();
            this.addListeners();
            this.mediaElement.cueVideoById(this.youtubeGetId())
        },
        flashReinitListener: function () {
            this._youtubeResizeFix();
            this.addListeners();
            if (a.browser.mozilla) {
                this.mediaElement.cueVideoById(this.youtubeGetId());
                if (this.getState() === "PLAYING") {
                    this.setPlay()
                }
            }
            this.elementReady = true
        },
        _youtubeResizeFix: function () {
            a(this.mediaElement).attr({
                width: "99.99999%",
                height: "99.9999%"
            });
            this.applyCommand("volume", this.pp.getConfig("volume"))
        },
        addListeners: function () {
            if (this.useIframeAPI === true) {
                return
            }
            this.mediaElement.addEventListener("onStateChange", "projekktor('" + this.pp.getId() + "').playerModel.stateChange");
            this.mediaElement.addEventListener("onError", "projekktor('" + this.pp.getId() + "').playerModel.errorListener")
        },
        setSeek: function (c) {
            try {
                this.mediaElement.seekTo(c, true)
            } catch (b) {}
        },
        setVolume: function (b) {
            try {
                this.mediaElement.setVolume(b * 100)
            } catch (c) {}
        },
        setPause: function (b) {
            try {
                this.mediaElement.pauseVideo()
            } catch (c) {}
        },
        setPlay: function (b) {
            try {
                this.mediaElement.playVideo()
            } catch (c) {}
        },
        getVolume: function () {
            try {
                return this.mediaElement.getVolume()
            } catch (b) {}
            return 0
        },
        getPoster: function () {
            return this.media.config["poster"] || this.pp.config.poster || "http://img.youtube.com/vi/" + this.youtubeGetId() + "/0.jpg"
        },
        errorListener: function (b) {
            switch ((b.data == undefined) ? b : b.data) {
            case 100:
                this.setTestcard(500);
                break;
            case 101:
            case 150:
                this.setTestcard(501);
                break;
            case 2:
                this.setTestcard(502);
                break
            }
        },
        stateChange: function (b) {
            clearTimeout(this._updateTimer);
            if (this.mediaElement === null) {
                return
            }
            switch ((b.data == undefined) ? b : b.data) {
            case -1:
                this.setPlay();
                break;
            case 0:
                this.endedListener({});
                break;
            case 1:
                this._setBufferState("full");
                this.playingListener({});
                this.canplayListener({});
                this.updateInfo();
                break;
            case 2:
                this.pauseListener({});
                break;
            case 3:
                this.waitingListener({});
                break;
            case 5:
                if (this.useIframeAPI !== true) {
                    this.onReady()
                }
                break
            }
        },
        onReady: function () {
            this.setVolume(this.pp.getVolume());
            this.elementReady = true;
            if (this.media.title || this.pp.config.title || this.elementReady) {
                return
            }
            var b = this;
            a.ajax({
                url: "http://gdata.youtube.com/feeds/api/videos/" + this.youtubeGetId() + "?v=2&alt=jsonc",
                complete: function (f, c) {
                    try {
                        data = f.responseText;
                        if (typeof data == "string") {
                            data = a.parseJSON(data)
                        }
                        if (data.data.title) {
                            b.sendUpdate("config", {
                                title: data.data.title + " (" + data.data.uploader + ")"
                            })
                        }
                    } catch (d) {}
                    b.elementReady = true
                }
            })
        },
        youtubeGetId: function () {
            return encodeURIComponent(this.media.file.replace(/^[^v]+v.(.{11}).*/, "$1"))
        },
        updateInfo: function () {
            var b = this;
            clearTimeout(this._updateTimer);
            (function () {
                if (b.mediaElement == null) {
                    clearTimeout(b._updateTimer);
                    return
                }
                try {
                    if (b.getState() !== "IDLE" && b.getState() !== "COMPLETED") {
                        b.timeListener({
                            position: b.mediaElement.getCurrentTime(),
                            duration: b.mediaElement.getDuration()
                        });
                        b.progressListener({
                            loaded: b.mediaElement.getVideoBytesLoaded(),
                            total: b.mediaElement.getVideoBytesTotal()
                        })
                    }
                } catch (c) {}
                b._updateTimer = setTimeout(arguments.callee, 500)
            })()
        }
    });
    $p.newModel({
        modelId: "YTAUDIO",
        iLove: [{
            ext: "youtube.com",
            type: "audio/youtube",
            platform: "flash",
            fixed: "maybe"
        }],
        applyMedia: function (b) {
            this.imageElement = this.applyImage(this.pp.getConfig("cover") || this.pp.getConfig("poster"), b);
            this._setBufferState("empty");
            this.mediaElement = new YT.Player(this.pp.getId() + "_media", {
                width: "100px",
                height: "100px",
                playerVars: {
                    autoplay: 10,
                    disablekb: 1,
                    start: 0,
                    controls: 0,
                    enablejsapi: 1,
                    playerapiid: this.pp.getId(),
                    origin: location.host
                },
                videoId: this.youtubeGetId(),
                events: {
                    onReady: "onReady" + this.pp.getId(),
                    onStateChange: "onStateChange" + this.pp.getId(),
                    onError: "onError" + this.pp.getId()
                }
            })
        }
    }, "YTVIDEO")
});
var projekktorControlbar = function () {};
jQuery(function (a) {
    projekktorControlbar.prototype = {
        _cTimer: null,
        _noCHide: false,
        _cFading: false,
        _vSliderAct: false,
        _storeVol: 0,
        _timeTags: {},
        cb: null,
        cbFS: null,
        _pos: {
            left: 0,
            right: 0
        },
        controlElements: {},
        controlElementsConfig: {
            cb: null,
            playhead: {
                on: null,
                call: null
            },
            loaded: {
                on: "click",
                call: "scrubberClk"
            },
            scrubber: {
                on: "click",
                call: "scrubberClk"
            },
            play: {
                on: "click",
                call: "playClk"
            },
            pause: {
                on: "click",
                call: "pauseClk"
            },
            stop: {
                on: "click",
                call: "stopClk"
            },
            prev: {
                on: "click",
                call: "prevClk"
            },
            next: {
                on: "click",
                call: "nextClk"
            },
            rewind: {
                on: "click",
                call: "rewindClk"
            },
            forward: {
                on: "click",
                call: "forwardClk"
            },
            fsexit: {
                on: "click",
                call: "exitFullscreenClk"
            },
            fsenter: {
                on: "click",
                call: "enterFullscreenClk"
            },
            vslider: {
                on: "click",
                call: "vsliderClk"
            },
            vmarker: {
                on: "click",
                call: "vsliderClk"
            },
            vknob: {
                on: "mousedown",
                call: "vknobStartDragListener"
            },
            mute: {
                on: "click",
                call: "muteClk"
            },
            unmute: {
                on: "click",
                call: "unmuteClk"
            },
            vmax: {
                on: "click",
                call: "vmaxClk"
            },
            open: {
                on: "click",
                call: "openCloseClk"
            },
            close: {
                on: "click",
                call: "openCloseClk"
            },
            loopon: {
                on: "click",
                call: "loopClk"
            },
            loopoff: {
                on: "click",
                call: "loopClk"
            },
            draghandle: {
                on: "mousedown",
                call: "handleStartDragListener"
            },
            controls: {
                on: null,
                call: null
            },
            title: null,
            sec_dur: null,
            min_dur: null,
            hr_dur: null,
            sec_elp: null,
            min_elp: null,
            hr_elp: null,
            sec_rem: null,
            min_rem: null,
            hr_rem: null
        },
        config: {
            controlsDisableFade: false,
            controlsTemplate: "<div %{fsexit}></div><div %{fsenter}></div><div %{play}></div><div %{pause}></div><div %{prev}></div><div %{next}></div><div %{title}></div><div %{timeleft}>%{min_dur}:%{sec_dur} | %{min_rem}:%{sec_rem}</div><div %{scrubber}><div %{loaded}></div><div %{playhead}></div></div><div %{vslider}><div %{vmarker}></div><div %{vknob}></div></div><div %{mute}></div><div %{vmax}></div>",
            controlsTemplateFull: null,
            toggleMute: false
        },
        initialize: function () {
            var e = this,
                d = this.playerDom.html(),
                c = true,
                f = this.getConfig("cssClassPrefix");
            for (var b in this.controlElementsConfig) {
                if (d.match(new RegExp(f + b, "gi"))) {
                    c = false;
                    break
                }
            }
            if (c) {
                this.cb = this.applyToPlayer(a(document.createElement("div")).addClass("controls"));
                this.cbFS = this.applyToPlayer(a(document.createElement("div")).addClass("controls").addClass("fullscreen").removeClass("active").addClass("inactive"));
                if (this.getConfig("controlsDisableFade") !== true) {
                    this.cb.addClass("fade");
                    this.cbFS.addClass("fade")
                }
                this.applyTemplate(this.cb, this.getConfig("controlsTemplate"));
                this.applyTemplate(this.cbFS, this.getConfig("controlsTemplateFull") || this.getConfig("controlsTemplate"))
            } else {
                this.cb = this.playerDom.find("." + f + "controls:not(.fullscreen)");
                this.cbFS = this.playerDom.children("." + f + "controls.fullscreen");
                if (this.cbFS.length == 0) {
                    this.cbFS = this.cb
                }
            }
            for (var b in this.controlElementsConfig) {
                this.controlElements[b] = a(this.playerDom).find("." + f + b);
                this.blockSelection(this.controlElements[b])
            }
            this.addGuiListeners();
            this._storeVol = this.getConfig("volume");
            this.drawUpdateControls();
            this.hidecb(true);
            this.pluginReady = true
        },
        applyTemplate: function (d, c) {
            var e = this,
                f = this.getConfig("cssClassPrefix");
            if (c) {
                var b = c.match(/\%{[a-zA-Z_]*\}/gi);
                if (b != null) {
                    a.each(b, function (g, h) {
                        var i = h.replace(/\%{|}/gi, "");
                        if (h.match(/\_/gi)) {
                            c = c.replace(h, '<span class="' + f + i + '"></span>')
                        } else {
                            c = c.replace(h, 'class="' + f + i + '"')
                        }
                    })
                }
                d.html(c)
            }
        },
        itemHandler: function (b) {
            this.pluginReady = true;
            this.hidecb(true)
        },
        displayReadyHandler: function (b) {
            this.pluginReady = true;
            this.showcb(true)
        },
        drawUpdateControls: function () {
            var b = this,
                c = this.pp.getState();
            clearTimeout(this._cTimer);
            if (this.pp.getHasGUI()) {
                return
            }
            if (this.getConfig("controls") == false) {
                this.hidecb(true);
                return
            }
            var d = (this.pp.getItemCount() < 2 || this.getConfig("disallowSkip"));
            if (!d) {
                this.controlElements.prev.removeClass("inactive").addClass("active");
                this.controlElements.next.removeClass("inactive").addClass("active")
            } else {
                this.controlElements.prev.removeClass("active").addClass("inactive");
                this.controlElements.next.removeClass("active").addClass("inactive")
            }
            if (this.pp.getItemIdx() < 1) {
                this.controlElements.prev.removeClass("active").addClass("inactive")
            }
            if (this.pp.getItemIdx() >= this.pp.getItemCount() - 1) {
                this.controlElements.next.removeClass("active").addClass("inactive")
            }
            if (this.getConfig("disablePause")) {
                this.controlElements.pause.removeClass("active").addClass("inactive");
                this.controlElements.play.removeClass("active").addClass("inactive")
            } else {
                if (c === "PLAYING") {
                    this.drawPauseButton()
                }
                if (c === "PAUSED") {
                    this.drawPlayButton()
                }
                if (c === "IDLE") {
                    this.drawPlayButton()
                }
            }
            if (c == "IDLE") {
                this.controlElements.stop.removeClass("active").addClass("inactive")
            } else {
                this.controlElements.stop.removeClass("inactive").addClass("active")
            }
            if (c == "IDLE") {
                this.controlElements.forward.removeClass("active").addClass("inactive");
                this.controlElements.rewind.removeClass("active").addClass("inactive")
            } else {
                this.controlElements.forward.removeClass("inactive").addClass("active");
                this.controlElements.rewind.removeClass("inactive").addClass("active")
            }
            if (this.pp.getInFullscreen() === true) {
                this.drawExitFullscreenButton()
            } else {
                this.drawEnterFullscreenButton()
            }
            if (this.getConfig("disableFullscreen")) {
                this.controlElements.fsexit.removeClass("active").addClass("inactive");
                this.controlElements.fsenter.removeClass("active").addClass("inactive")
            }
            if (this.pp.config._loop != true) {
                this.controlElements.loopoff.removeClass("active").addClass("inactive");
                this.controlElements.loopon.removeClass("inactive").addClass("active")
            } else {
                this.controlElements.loopoff.removeClass("inactive").addClass("active");
                this.controlElements.loopon.removeClass("active").addClass("inactive")
            }
            this.drawTitle(this.getConfig("title"));
            this.drawUpdateTimeDisplay();
            this.drawUpdateVolumeDisplay(this.pp.getVolume() || this._storeVol)
        },
        stateHandler: function (b) {
            this.drawUpdateControls();
            if ("STOPPED|STARTING|AWAKENING|IDLE".indexOf(b) > -1) {
                this.drawUpdateTimeDisplay(0, 0, 0);
                this.drawUpdateProgressDisplay(0);
                this.hidecb(true)
            } else {
                this.drawUpdateProgressDisplay()
            }
        },
        scheduleModifiedHandler: function () {
            if (this.pp.getState() === "IDLE") {
                return
            }
            this.drawUpdateControls();
            this.drawUpdateTimeDisplay();
            this.drawUpdateProgressDisplay()
        },
        volumeHandler: function (b) {
            this.drawUpdateVolumeDisplay(b)
        },
        progressHandler: function (b) {
            this.drawUpdateProgressDisplay()
        },
        timeHandler: function (b) {
            this.drawUpdateTimeDisplay();
            this.drawUpdateProgressDisplay()
        },
        fullscreenHandler: function (d) {
            var b = this,
                c = this.getConfig("cssClassPrefix");
            this._noCHide = false;
            this._cFading = false;
            this._vSliderAct = false;
            clearTimeout(this._cTimer);
            if (!this.getConfig("controls")) {
                return
            }
            if (this.pp.getInFullscreen() === true) {
                this.playerDom.children("." + c + "controls:not(.fullscreen)").stop(true, true).removeClass("active").addClass("inactive").css("display", "");
                this.playerDom.children("." + c + "controls.fullscreen").stop(true, true).removeClass("inactive").addClass("active").css("display", "")
            } else {
                this.playerDom.children("." + c + "controls:not(.fullscreen)").stop(true, true).removeClass("inactive").addClass("active").css("display", "");
                this.playerDom.children("." + c + "controls.fullscreen").stop(true, true).removeClass("active").addClass("inactive").css("display", "")
            }
            this.drawUpdateControls();
            if (this.pp.getState() == "IDLE") {
                this.hidecb(true)
            } else {
                this._cTimer = setTimeout(function () {
                    b.hidecb()
                }, 2500)
            }
        },
        addGuiListeners: function () {
            var b = this;
            a.each(this.controlElementsConfig, function (c, d) {
                if (!d) {
                    return
                }
                if (d.on != null) {
                    b.controlElements[c][d.on](function (e) {
                        b.clickCatcher(e, d.call, b.controlElements[c])
                    })
                }
            });
            this.cbFS.mouseenter(function (c) {
                b.controlsMouseEnterListener(c)
            });
            this.cbFS.mouseleave(function (c) {
                b.controlsMouseLeaveListener(c)
            });
            this.cb.mouseenter(function (c) {
                b.controlsMouseEnterListener(c)
            });
            this.cb.mouseleave(function (c) {
                b.controlsMouseLeaveListener(c)
            })
        },
        clickCatcher: function (b, d, c) {
            if (a.browser.msie) {
                b.cancelBubble = true
            } else {
                b.stopPropagation()
            }
            if (c.hasClass("inactive")) {
                return
            }
            this[d](b, c)
        },
        drawTitle: function (b) {
            this.controlElements.title.html(b)
        },
        hidecb: function (c) {
            var d = this.getConfig("cssClassPrefix"),
                b = (this.pp.getInFullscreen() === true) ? this.cbFS : this.cb;
            clearTimeout(this._cTimer);
            if (b == null) {
                return
            }
            b.stop(true, true);
            if (this.pp.getHasGUI() || this.getConfig("controls") == false) {
                b.removeClass("active").addClass("inactive").css("display", "");
                return
            }
            if (!b.is(":visible")) {
                return
            }
            if (c === true || !b.hasClass("fade")) {
                this._noCHide = false;
                this._cFading = false;
                b.removeClass("active").addClass("inactive").css("display", "");
                return
            } else {
                if (this._noCHide == true && this.getConfig("controls") == true) {
                    return
                }
            }
            if (this.getConfig("controls") == false) {
                b.removeClass("active").addClass("inactive")
            } else {
                b.fadeOut("slow", function () {
                    a(this).removeClass("active").addClass("inactive").css("display", "")
                })
            }
        },
        showcb: function (c) {
            if (this.pp.getHasGUI() || this.getConfig("controls") == false) {
                b.removeClass("active").addClass("inactive").css("display", "");
                return
            }
            var d = this,
                b = (this.pp.getInFullscreen() === true) ? this.cbFS : this.cb,
                e = this.getConfig("cssClassPrefix");
            clearTimeout(this._cTimer);
            if (b == null) {
                return
            }
            if ("IDLE|AWAKENING|ERROR".indexOf(this.pp.getState()) > -1) {
                return
            }
            b.stop(true, true);
            if ((!b.hasClass("fade") && c == true)) {
                b.removeClass("inactive").addClass("active").css("display", "");
                return
            }
            if (b.is(":visible") || this._cFading == true) {
                b.removeClass("inactive").addClass("active").css("display", "");
                this._cTimer = setTimeout(function () {
                    d.hidecb()
                }, 2500);
                return
            }
            this._cFading = true;
            b.fadeIn("fast", function () {
                d._cFading = false;
                a(this).removeClass("inactive").addClass("active").css("display", "")
            })
        },
        drawUpdateTimeDisplay: function (f, d, j) {
            if (this.pp.getHasGUI()) {
                return
            }
            try {
                var c = (f != undefined) ? f : this.pp.getLoadPlaybackProgress(),
                    i = (d != undefined) ? d : this.pp.getDuration(),
                    b = (j != undefined) ? j : this.pp.getPosition()
            } catch (g) {
                var c = f || 0,
                    i = d || 0,
                    b = j || 0
            }
            this.controlElements.playhead.css("width", c + "%");
            var h = a.extend({}, this._clockDigits(i, "dur"), this._clockDigits(b, "elp"), this._clockDigits(i - b, "rem"));
            a.each(this.controlElements, function (e, k) {
                if (h[e]) {
                    a.each(k, function () {
                        a(this).html(h[e])
                    })
                }
            })
        },
        drawUpdateProgressDisplay: function () {
            this.controlElements.loaded.css("width", this.pp.getLoadProgress() + "%")
        },
        drawUpdateVolumeDisplay: function (b) {
            if (this._vSliderAct == true) {
                return
            }
            if (b == undefined) {
                return
            }
            clearTimeout(this._cTimer);
            var d = (this.pp.getInFullscreen() === true) ? this.cbFS : this.cb,
                f = d.is(":visible"),
                e = this,
                c = (this.controlElements.mute.hasClass("toggle") || this.controlElements.unmute.hasClass("toggle"));
            d.stop(true, true).show();
            switch (b) {
            case 0:
                this.controlElements.vknob.css("left", 0);
                break;
            case 1:
                this.controlElements.vknob.css("left", (this.controlElements.vslider.width() - (this.controlElements.vknob.width() / 2)) + "px");
                break;
            default:
                this.controlElements.vknob.css("left", b * (this.controlElements.vslider.width() - (this.controlElements.vknob.width() / 2)) + "px");
                break
            }
            if (c) {
                if (b) {
                    this.controlElements.mute.removeClass("inactive").addClass("active");
                    this.controlElements.unmute.removeClass("active").addClass("inactive")
                } else {
                    this.controlElements.mute.removeClass("active").addClass("inactive");
                    this.controlElements.unmute.removeClass("inactive").addClass("active");
                    this.controlElements.vmax.removeClass("inactive").addClass("active")
                }
                if (b == 1) {
                    this.controlElements.vmax.removeClass("active").addClass("inactive")
                } else {
                    this.controlElements.vmax.removeClass("inactive").addClass("active")
                }
            } else {
                this.controlElements.vmax.removeClass("inactive").addClass("active");
                this.controlElements.unmute.removeClass("inactive").addClass("active");
                this.controlElements.mute.removeClass("inactive").addClass("active")
            }
            this.controlElements.vmarker.css("width", b * 100 + "%");
            this._cTimer = setTimeout(function () {
                e.hidecb()
            }, 3500);
            if (!f) {
                d.hide()
            }
        },
        drawPauseButton: function (b) {
            this.controlElements.pause.removeClass("inactive").addClass("active");
            this.controlElements.play.removeClass("active").addClass("inactive")
        },
        drawPlayButton: function (b) {
            this.controlElements.pause.removeClass("active").addClass("inactive");
            this.controlElements.play.removeClass("inactive").addClass("active")
        },
        drawEnterFullscreenButton: function (b) {
            this.controlElements.fsexit.removeClass("active").addClass("inactive");
            this.controlElements.fsenter.removeClass("inactive").addClass("active")
        },
        drawExitFullscreenButton: function (b) {
            this.controlElements.fsexit.removeClass("inactive").addClass("active");
            this.controlElements.fsenter.removeClass("active").addClass("inactive")
        },
        playClk: function (b) {
            this.pp.setPlay()
        },
        pauseClk: function (b) {
            this.pp.setPause()
        },
        stopClk: function (b) {
            this.pp.setStop()
        },
        controlsMouseEnterListener: function (b) {
            this._noCHide = true
        },
        controlsMouseLeaveListener: function (b) {
            this._noCHide = false
        },
        controlsClk: function (b) {},
        mousemoveHandler: function (b) {
            this.showcb()
        },
        mouseleaveHandler: function (b) {
            var c = this;
            this._cTimer = setTimeout(function () {
                c.hidecb()
            }, 2500)
        },
        prevClk: function (b) {
            this.pp.setActiveItem("previous")
        },
        nextClk: function (b) {
            this.pp.setActiveItem("next")
        },
        forwardClk: function (b) {
            this.pp.setPlayhead("+10")
        },
        rewindClk: function (b) {
            this.pp.setPlayhead("-10")
        },
        muteClk: function (b) {
            this._storeVol = (this.pp.getVolume() == 0) ? this.getConfig("volume") : this.pp.getVolume();
            this.pp.setVolume(0)
        },
        unmuteClk: function (b) {
            if (this._storeVol <= 0) {
                this._storeVol = 1
            }
            this.pp.setVolume(this._storeVol)
        },
        vmaxClk: function (b) {
            this.pp.setVolume(1)
        },
        enterFullscreenClk: function (b) {
            this.pp.setFullscreen(true)
        },
        exitFullscreenClk: function (b) {
            this.pp.setFullscreen(false)
        },
        openCloseClk: function (b) {
            var c = this;
            a(a(b.currentTarget).attr("class").split(/\s+/)).each(function (d, e) {
                if (e.indexOf("toggle") == -1) {
                    return
                }
                c.playerDom.find("." + e.substring(6)).slideToggle("slow", function () {
                    c.pp.setResize()
                });
                c.controlElements.open.toggle();
                c.controlElements.close.toggle()
            })
        },
        loopClk: function (b) {
            if (a.inArray(this.getConfig("cssClassPrefix") + "loopon", a(b.currentTarget).attr("class").split(/\s+/)) > -1) {
                this.pp.config._loop = true
            } else {
                this.pp.config._loop = false
            }
            this.drawUpdateControls()
        },
        startClk: function (b) {
            this.pp.setPlay()
        },
        scrubberClk: function (b) {
            var e = 0;
            if (this.getConfig("disallowSkip") == true) {
                return
            }
            var g = (this.pp.getInFullscreen() === true) ? 1 : 0,
                d = a(this.controlElements.scrubber[g]).width(),
                c = a(this.controlElements.loaded[g]).width(),
                f = b.pageX - a(this.controlElements.scrubber[g]).offset().left;
            if (f < 0 || f == "NaN" || f == undefined) {
                e = 0
            } else {
                if (c != undefined) {
                    if (f > c) {
                        f = c - 1
                    }
                    e = ((f * 100 / d) * this.pp.getDuration() / 100) * 1
                }
            }
            this.pp.setPlayhead(e)
        },
        vmarkerClk: function (b) {
            vsliderClk(b)
        },
        vsliderClk: function (c) {
            if (this._vSliderAct == true) {
                return
            }
            var f = (this.pp.getInFullscreen() === true) ? 1 : 0,
                b = a(this.controlElements.vslider[f]),
                d = b.width(),
                e = c.pageX - b.offset().left;
            if (e < 0 || e == "NaN" || e == undefined) {
                result = 0
            } else {
                result = (e / d)
            }
            this.pp.setVolume(result);
            this._storeVol = result
        },
        vknobStartDragListener: function (b, i) {
            this._vSliderAct = true;
            var d = this,
                f = (this.pp.getInFullscreen() === true) ? 1 : 0,
                c = a(i[f]),
                h = a(this.controlElements.vslider[f]),
                k = Math.abs(parseInt(c.position().left) - b.clientX),
                e = 0,
                g = function (l) {
                    if (a.browser.msie) {
                        l.cancelBubble = true
                    } else {
                        l.stopPropagation()
                    }
                    d.playerDom.unbind("mouseup", g);
                    h.unbind("mousemove", j);
                    h.unbind("mouseup", g);
                    c.unbind("mousemove", j);
                    c.unbind("mouseup", g);
                    d._vSliderAct = false;
                    return false
                },
                j = function (l) {
                    clearTimeout(d._cTimer);
                    if (a.browser.msie) {
                        l.cancelBubble = true
                    } else {
                        l.stopPropagation()
                    }
                    var m = (l.clientX - k);
                    m = (m > h.width() - c.width() / 2) ? h.width() - (c.width() / 2) : m;
                    m = (m < 0) ? 0 : m;
                    c.css("left", m + "px");
                    e = Math.abs(m / (h.width() - (c.width() / 2)));
                    d.pp.setVolume(e);
                    d._storeVol = e;
                    a(d.controlElements.vmarker[f]).css("width", e * 100 + "%");
                    return false
                };
            this.playerDom.mouseup(g);
            h.mousemove(j);
            h.mouseup(g);
            c.mousemove(j);
            c.mouseup(g)
        },
        handleStartDragListener: function (d, g) {
            var h = this;
            var f = Math.abs(parseInt(this.cb.position().left) - d.clientX);
            var c = Math.abs(parseInt(this.cb.position().top) - d.clientY);
            var b = function (i) {
                    if (a.browser.msie) {
                        i.cancelBubble = true
                    } else {
                        i.stopPropagation()
                    }
                    h.playerDom.unbind("mouseup", b);
                    h.playerDom.unbind("mouseout", b);
                    h.playerDom.unbind("mousemove", e);
                    return false
                };
            var e = function (j) {
                    if (a.browser.msie) {
                        j.cancelBubble = true
                    } else {
                        j.stopPropagation()
                    }
                    clearTimeout(h._cTimer);
                    var k = (j.clientX - f);
                    k = (k > h.playerDom.width() - h.cb.width()) ? h.playerDom.width() - h.cb.width() : k;
                    k = (k < 0) ? 0 : k;
                    h.cb.css("left", k + "px");
                    var i = (j.clientY - c);
                    i = (i > h.playerDom.height() - h.cb.height()) ? h.playerDom.height() - h.cb.height() : i;
                    i = (i < 0) ? 0 : i;
                    h.cb.css("top", i + "px");
                    return false
                };
            this.playerDom.mousemove(e);
            this.playerDom.mouseup(b)
        },
        errorHandler: function (b) {
            this.hidecb(true)
        },
        _clockDigits: function (d, i) {
            if (d < 0 || isNaN(d) || d == undefined) {
                d = 0
            }
            var f = Math.floor(d / (60 * 60));
            var g = d % (60 * 60);
            var c = Math.floor(g / 60);
            var b = g % 60;
            var e = Math.floor(b);
            var h = {};
            h["min_" + i] = (c < 10) ? "0" + c : c;
            h["sec_" + i] = (e < 10) ? "0" + e : e;
            h["hr_" + i] = (f < 10) ? "0" + f : f;
            return h
        }
    }
});
var projekktorDisplay = function () {};
jQuery(function (a) {
    projekktorDisplay.prototype = {
        logo: null,
        logoIsFading: false,
        display: null,
        clickCatcher: null,
        displayClicks: 0,
        buffIcn: null,
        buffIcnSprite: null,
        bufferDelayTimer: null,
        bufferIconDelay: 1,
        config: {
            onclick: {
                callback: "setPlayPause",
                value: null
            },
            onclick_playing: {
                callback: "setPlayPause",
                value: null
            },
            ondblclick: {
                callback: "setFullscreen",
                value: null
            },
            bufferIconDelay: 200,
            spriteUrl: "",
            spriteWidth: 50,
            spriteHeight: 50,
            spriteTiles: 25,
            spriteOffset: 1,
            spriteCountUp: false,
            logoImage: "",
            logoDelay: 0,
            logoPosition: "tl",
            onlogoclick: {
                callback: "",
                value: {
                    url: "",
                    target: "_blank",
                    pause: true
                }
            }
        },
        initialize: function () {
            var c = this;
            var b = {
                position: "absolute",
                overflow: "hidden",
                height: "100%",
                width: "100%",
                top: 0,
                left: 0,
                padding: 0,
                margin: 0,
                display: "block"
            };
            this.startButton = this.applyToPlayer(a(document.createElement("div")).addClass("start")).addClass("inactive");
            this.buffIcn = this.applyToPlayer(a(document.createElement("div")).addClass("buffering")).addClass("inactive");
            if (this.config.spriteUrl != "") {
                this.buffIcnSprite = a(document.createElement("div")).appendTo(this.buffIcn).css({
                    width: this.config.spriteWidth,
                    height: this.config.spriteHeight,
                    marginLeft: ((this.buffIcn.width() - this.config.spriteWidth) / 2) + "px",
                    marginTop: ((this.buffIcn.height() - this.config.spriteHeight) / 2) + "px",
                    backgroundColor: "transparent",
                    backgroundImage: "url(" + this.config.spriteUrl + ")",
                    backgroundRepeat: "no-repeat",
                    backgroundPosition: "0 0"
                }).addClass("inactive")
            }
            this.display = this.applyToPlayer(a(document.createElement("div")).addClass("display").css(b));
            this.pp.getMediaContainer();
            this.logo = this.applyToPlayer(a(document.createElement("img")).addClass("logo").attr("src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi/v//PwNAgAEACQsDAUdpTjcAAAAASUVORK5CYII=").css("position", "absolute").css(((this.getConfig("logoPosition").indexOf("r") > -1) ? "right" : "left"), "2%").css(((this.getConfig("logoPosition").indexOf("t") > -1) ? "top" : "bottom"), "2%"));
            if (!this.pp.getIsMobileClient()) {
                this.clickCatcher = a(document.createElement("div")).css(b).addClass("clickcatcher").appendTo(this.display);
                if (a.browser.msie) {
                    this.clickCatcher.css("background", "url(#)")
                }
            }
            this.pluginReady = true
        },
        displayReadyHandler: function () {
            var b = this;
            try {
                this.clickCatcher.unbind();
                this.clickCatcher.click(function (d) {
                    b._displayClickListener(d)
                })
            } catch (c) {}
            this.startButton.unbind();
            this.startButton.click(function () {
                b.pp.setPlay()
            })
        },
        bufferHandler: function (b) {
            if (b == "EMPTY") {
                this.showBufferIcon()
            } else {
                this.hideBufferIcon()
            }
        },
        stateHandler: function (b) {
            if (b === "IDLE") {
                this.startButton.addClass("active").removeClass("inactive")
            } else {
                this.startButton.addClass("inactive").removeClass("active")
            }
            if (b == "AWAKENING" || b == "COMPLETED" || b == "ERROR") {
                this.hideBufferIcon()
            }
            if (b == "ERROR" || b === "STOPPED") {
                this.logo.addClass("inactive").removeClass("active")
            }
        },
        stoppedHandler: function () {
            this.hideBufferIcon()
        },
        scheduleLoadingHandler: function () {
            this.startButton.addClass("inactive").removeClass("active");
            this.showBufferIcon()
        },
        scheduledHandler: function () {
            if (!this.getConfig("autoplay")) {
                this.startButton.addClass("active").removeClass("inactive")
            }
            this.hideBufferIcon()
        },
        itemHandler: function () {
            var b = this;
            this.hideBufferIcon();
            this.logoIsFading = false;
            this.logo.stop(true, true).addClass("inactive").removeClass("active").unbind();
            if (this.getConfig("logoImage") != false) {
                this.logo.attr("src", this.getConfig("logoImage")).css({
                    cursor: (this.getConfig("logoURL") != "") ? "pointer" : "normal"
                }).click(function () {
                    try {
                        b.pp[b.getConfig("onlogoclick").callback](b.getConfig("onlogoclick").value)
                    } catch (c) {}
                    return false
                })
            } else {
                this.logo.attr("src", "").addClass("inactive").removeClass("active")
            }
        },
        timeHandler: function () {
            if (this.getConfig("logoImage") == false) {
                return
            }
            if (this.pp.getIsMobileClient()) {
                return
            }
            var b = this.pp.getPosition(),
                d = this.pp.getDuration(),
                c = this;
            if (!this.logo.is(":visible") && !this.logoIsFading && b + this.config.logoDelay < d) {
                if (b > this.config.logoDelay && d > (this.config.logoDelay * 2)) {
                    this.logoIsFading = true;
                    this.logo.fadeIn("slow", function () {
                        c.logoIsFading = false;
                        a(this).addClass("active").removeClass("inactive").css("display", "")
                    })
                }
            }
            if (this.logo.is(":visible") && !this.logoIsFading) {
                if (b + this.config.logoDelay > d) {
                    this.logoIsFading = true;
                    this.logo.fadeOut("slow", function () {
                        a(this).addClass("inactive").removeClass("active").css("display", "");
                        c.logoIsFading = false
                    })
                }
            }
        },
        _displayClickListener: function (b) {
            var c = this;
            if (this.pp.getState() == "ERROR") {
                this.pp.setActiveItem("next");
                return false
            }
            this.displayClicks++;
            if (this.displayClicks > 0) {
                setTimeout(function () {
                    if (c.displayClicks == 1) {
                        if (c.pp.getState() == "PLAYING") {
                            try {
                                c.pp[c.getConfig("onclick_playing").callback](c.getConfig("onclick_playing").value)
                            } catch (d) {}
                        } else {
                            try {
                                c.pp[c.getConfig("onclick").callback](c.getConfig("onclick").value)
                            } catch (d) {}
                        }
                    } else {
                        if (c.displayClicks == 2) {
                            try {
                                c.pp[c.getConfig("ondblclick").callback](c.getConfig("ondblclick").value)
                            } catch (d) {}
                        }
                    }
                    c.displayClicks = 0;
                    if (a.browser.msie) {
                        b.cancelBubble = true
                    } else {
                        b.stopPropagation()
                    }
                }, 250)
            }
            return false
        },
        hideBufferIcon: function () {
            var b = this;
            clearTimeout(this.bufferDelayTimer);
            this.buffIcn.stop(true, true);
            this.buffIcn.fadeOut("fast", function () {
                a(this).addClass("inactive").removeClass("active").css("display", "")
            })
        },
        showBufferIcon: function (b) {
            var c = this;
            clearTimeout(this.bufferDelayTimer);
            if (this.pp.getHasGUI()) {
                return
            }
            if (this.pp.getModel() === "YTAUDIO" || this.pp.getModel() === "YTVIDEO") {
                b = true
            }
            if (b != true && this.config.bufferIconDelay > 0) {
                this.bufferDelayTimer = setTimeout(function () {
                    c.showBufferIcon(true)
                }, c.config.bufferIconDelay);
                return
            }
            this.buffIcn.stop(true, true);
            if (this.buffIcn.hasClass("active")) {
                return
            }
            this.buffIcn.fadeIn("fast", function () {
                if (c.buffIcnSprite == null) {
                    return
                }
                var d = (c.config.spriteCountUp == true) ? 0 : (c.config.spriteHeight + c.config.spriteOffset) * c.config.spriteTiles;
                c.buffIcnSprite.addClass("active").removeClass("inactive").css("display", "");
                (function () {
                    if (!c.buffIcn.is(":visible")) {
                        return
                    }
                    c.buffIcnSprite.css("backgroundPosition", "0px -" + d + "px");
                    if (c.config.spriteCountUp == true) {
                        d += c.config.spriteHeight + c.config.spriteOffset
                    } else {
                        d -= c.config.spriteHeight + c.config.spriteOffset
                    }
                    if (d >= c.config.spriteHeight * c.config.spriteTiles) {
                        d = 0
                    }
                    setTimeout(arguments.callee, 60)
                })()
            })
        }
    }
});

/*!
 * jQuery Tools v1.2.5 - The missing UI library for the Web TOOLTIPP ONLY
 * 
 * tooltip/tooltip.js
 * tooltip/tooltip.dynamic.js
 * tooltip/tooltip.slide.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(a){a.tools=a.tools||{version:"v1.2.5"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m)throw"Nonexistent effect \""+e.effect+"\"";r=r.split(/,\s*/);if(r.length!=2)throw"Tooltip: bad events configuration for "+q;d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):e.tip?h=a(e.tip).eq(0):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length)throw"Cannot find tooltip for "+d}if(f.isShown())return f;h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=b||a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented())return f;o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b)});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.bind(p[0],function(){clearTimeout(i),clearTimeout(j)}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0])}),h.data("__set",!0));return f},hide:function(c){if(!h||!f.isShown())return f;c=c||a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c)});return f}},isShown:function(a){return a?n=="full":n},getConf:function(){return e},getTip:function(){return h},getTrigger:function(){return d}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}})}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c)return c;b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c)});return b.api?c:this}})(jQuery);
(function(a){var b=a.tools.tooltip;b.dynamic={conf:{classNames:"top right bottom left"}};function c(b){var c=a(window),d=c.width()+c.scrollLeft(),e=c.height()+c.scrollTop();return[b.offset().top<=c.scrollTop(),d<=b.offset().left+b.width(),e<=b.offset().top+b.height(),c.scrollLeft()>=b.offset().left]}function d(a){var b=a.length;while(b--)if(a[b])return!1;return!0}a.fn.dynamic=function(e){typeof e=="number"&&(e={speed:e}),e=a.extend({},b.dynamic.conf,e);var f=e.classNames.split(/\s/),g;this.each(function(){var b=a(this).tooltip().onBeforeShow(function(b,h){var i=this.getTip(),j=this.getConf();g||(g=[j.position[0],j.position[1],j.offset[0],j.offset[1],a.extend({},j)]),a.extend(j,g[4]),j.position=[g[0],g[1]],j.offset=[g[2],g[3]],i.css({visibility:"hidden",position:"absolute",top:h.top,left:h.left}).show();var k=c(i);if(!d(k)){k[2]&&(a.extend(j,e.top),j.position[0]="top",i.addClass(f[0])),k[3]&&(a.extend(j,e.right),j.position[1]="right",i.addClass(f[1])),k[0]&&(a.extend(j,e.bottom),j.position[0]="bottom",i.addClass(f[2])),k[1]&&(a.extend(j,e.left),j.position[1]="left",i.addClass(f[3]));if(k[0]||k[2])j.offset[0]*=-1;if(k[1]||k[3])j.offset[1]*=-1}i.css({visibility:"visible"}).hide()});b.onBeforeShow(function(){var a=this.getConf(),b=this.getTip();setTimeout(function(){a.position=[g[0],g[1]],a.offset=[g[2],g[3]]},0)}),b.onHide(function(){var a=this.getTip();a.removeClass(e.classNames)}),ret=b});return e.api?ret:this}})(jQuery);
(function(a){var b=a.tools.tooltip;a.extend(b.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!a.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.addEffect("slide",function(a){var b=this.getConf(),d=this.getTip(),e=b.slideFade?{opacity:b.opacity}:{},f=c[b.direction]||c.up;e[f[1]]=f[0]+"="+b.slideOffset,b.slideFade&&d.css({opacity:0}),d.show().animate(e,b.slideInSpeed,a)},function(b){var d=this.getConf(),e=d.slideOffset,f=d.slideFade?{opacity:0}:{},g=c[d.direction]||c.up,h=""+g[0];d.bounce&&(h=h=="+"?"-":"+"),f[g[1]]=h+"="+e,this.getTip().animate(f,d.slideOutSpeed,function(){a(this).hide(),b.call()})})})(jQuery);

/* MAP HIGHLIGHT 1.3 
http://davidlynch.org/blog/2008/03/maphilight-image-map-mouseover-highlighting/

*/
(function($) {
	var has_VML, create_canvas_for, add_shape_to, clear_canvas, shape_from_area,
		canvas_style, hex_to_decimal, css3color, is_image_loaded, options_from_area;

	has_VML = document.namespaces;
	has_canvas = !!document.createElement('canvas').getContext;

	if(!(has_canvas || has_VML)) {
		$.fn.maphilight = function() { return this; };
		return;
	}
	
	if(has_canvas) {
		hex_to_decimal = function(hex) {
			return Math.max(0, Math.min(parseInt(hex, 16), 255));
		};
		css3color = function(color, opacity) {
			return 'rgba('+hex_to_decimal(color.substr(0,2))+','+hex_to_decimal(color.substr(2,2))+','+hex_to_decimal(color.substr(4,2))+','+opacity+')';
		};
		create_canvas_for = function(img) {
			var c = $('<canvas style="width:'+img.width+'px;height:'+img.height+'px;"></canvas>').get(0);
			c.getContext("2d").clearRect(0, 0, c.width, c.height);
			return c;
		};
		add_shape_to = function(canvas, shape, coords, options, name) {
			var i, context = canvas.getContext('2d');
			context.beginPath();
			if(shape == 'rect') {
				context.rect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
			} else if(shape == 'poly') {
				context.moveTo(coords[0], coords[1]);
				for(i=2; i < coords.length; i+=2) {
					context.lineTo(coords[i], coords[i+1]);
				}
			} else if(shape == 'circ') {
				context.arc(coords[0], coords[1], coords[2], 0, Math.PI * 2, false);
			}
			context.closePath();
			if(options.fill) {
				context.fillStyle = css3color(options.fillColor, options.fillOpacity);
				context.fill();
			}
			if(options.stroke) {
				context.strokeStyle = css3color(options.strokeColor, options.strokeOpacity);
				context.lineWidth = options.strokeWidth;
				context.stroke();
			}
			if(options.fade) {
				$(canvas).css('opacity', 0).animate({opacity: 1}, 100);
			}
		};
		clear_canvas = function(canvas) {
			canvas.getContext('2d').clearRect(0, 0, canvas.width,canvas.height);
		};
	} else {   // ie executes this code
		create_canvas_for = function(img) {
			return $('<var style="zoom:1;overflow:hidden;display:block;width:'+img.width+'px;height:'+img.height+'px;"></var>').get(0);
		};
		add_shape_to = function(canvas, shape, coords, options, name) {
			var fill, stroke, opacity, e;
			fill = '<v:fill color="#'+options.fillColor+'" opacity="'+(options.fill ? options.fillOpacity : 0)+'" />';
			stroke = (options.stroke ? 'strokeweight="'+options.strokeWidth+'" stroked="t" strokecolor="#'+options.strokeColor+'"' : 'stroked="f"');
			opacity = '<v:stroke opacity="'+options.strokeOpacity+'"/>';
			if(shape == 'rect') {
				e = $('<v:rect name="'+name+'" filled="t" '+stroke+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+coords[0]+'px;top:'+coords[1]+'px;width:'+(coords[2] - coords[0])+'px;height:'+(coords[3] - coords[1])+'px;"></v:rect>');
			} else if(shape == 'poly') {
				e = $('<v:shape name="'+name+'" filled="t" '+stroke+' coordorigin="0,0" coordsize="'+canvas.width+','+canvas.height+'" path="m '+coords[0]+','+coords[1]+' l '+coords.join(',')+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+canvas.width+'px;height:'+canvas.height+'px;"></v:shape>');
			} else if(shape == 'circ') {
				e = $('<v:oval name="'+name+'" filled="t" '+stroke+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(coords[0] - coords[2])+'px;top:'+(coords[1] - coords[2])+'px;width:'+(coords[2]*2)+'px;height:'+(coords[2]*2)+'px;"></v:oval>');
			}
			e.get(0).innerHTML = fill+opacity;
			$(canvas).append(e);
		};
		clear_canvas = function(canvas) {
			$(canvas).find('[name=highlighted]').remove();
		};
	}
	
	shape_from_area = function(area) {
		var i, coords = area.getAttribute('coords').split(',');
		for (i=0; i < coords.length; i++) { coords[i] = parseFloat(coords[i]); }
		return [area.getAttribute('shape').toLowerCase().substr(0,4), coords];
	};

	options_from_area = function(area, options) {
		var $area = $(area);
		return $.extend({}, options, $.metadata ? $area.metadata() : false, $area.data('maphilight'));
	};
	
	is_image_loaded = function(img) {
		if(!img.complete) { return false; } // IE
		if(typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; } // Others
		return true;
	};

	canvas_style = {
		position: 'absolute',
		left: 0,
		top: 0,
		padding: 0,
		border: 0
	};
	
	var ie_hax_done = false;
	$.fn.maphilight = function(opts) {
		opts = $.extend({}, $.fn.maphilight.defaults, opts);
		
		if(!has_canvas && $.browser.msie && !ie_hax_done) {
			document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
			var style = document.createStyleSheet();
			var shapes = ['shape','rect', 'oval', 'circ', 'fill', 'stroke', 'imagedata', 'group','textbox'];
			$.each(shapes,
				function() {
					style.addRule('v\\:' + this, "behavior: url(#default#VML); antialias:true");
				}
			);
			ie_hax_done = true;
		}
		
		return this.each(function() {
			var img, wrap, options, map, canvas, canvas_always, mouseover, highlighted_shape, usemap;
			img = $(this);

			if(!is_image_loaded(this)) {
				// If the image isn't fully loaded, this won't work right.  Try again later.
				return window.setTimeout(function() {
					img.maphilight(opts);
				}, 200);
			}

			options = $.extend({}, opts, $.metadata ? img.metadata() : false, img.data('maphilight'));

			// jQuery bug with Opera, results in full-url#usemap being returned from jQuery's attr.
			// So use raw getAttribute instead.
			usemap = img.get(0).getAttribute('usemap');

			map = $('map[name="'+usemap.substr(1)+'"]');

			if(!(img.is('img') && usemap && map.size() > 0)) {
				return;
			}

			if(img.hasClass('maphilighted')) {
				// We're redrawing an old map, probably to pick up changes to the options.
				// Just clear out all the old stuff.
				var wrapper = img.parent();
				img.insertBefore(wrapper);
				wrapper.remove();
				$(map).unbind('.maphilight').find('area[coords]').unbind('.maphilight');
			}

			wrap = $('<div></div>').css({
				display:'block',
				background:'url("'+this.src+'")',
				position:'relative',
				padding:0,
				width:this.width,
				height:this.height
				});
			if(options.wrapClass) {
				if(options.wrapClass === true) {
					wrap.addClass($(this).attr('class'));
				} else {
					wrap.addClass(options.wrapClass);
				}
			}
			img.before(wrap).css('opacity', 0).css(canvas_style).remove();
			if($.browser.msie) { img.css('filter', 'Alpha(opacity=0)'); }
			wrap.append(img);
			
			canvas = create_canvas_for(this);
			$(canvas).css(canvas_style);
			canvas.height = this.height;
			canvas.width = this.width;
			
			mouseover = function(e) {
				var shape, area_options;
				area_options = options_from_area(this, options);
				if(
					!area_options.neverOn
					&&
					!area_options.alwaysOn
				) {
					shape = shape_from_area(this);
					add_shape_to(canvas, shape[0], shape[1], area_options, "highlighted");
					if(area_options.groupBy) {
						var areas;
						// two ways groupBy might work; attribute and selector
						if(/^[a-zA-Z][-a-zA-Z]+$/.test(area_options.groupBy)) {
							areas = map.find('area['+area_options.groupBy+'="'+$(this).attr(area_options.groupBy)+'"]')
						} else {
							areas = map.find(area_options.groupBy);
						}
						var first = this;
						areas.each(function() {
							if(this != first) {
								var subarea_options = options_from_area(this, options);
								if(!subarea_options.neverOn && !subarea_options.alwaysOn) {
									var shape = shape_from_area(this);
									add_shape_to(canvas, shape[0], shape[1], subarea_options, "highlighted");
								}
							}
						});
					}
					// workaround for IE7, IE8 not rendering the final rectangle in a group
					if(!has_canvas) {
						$(canvas).append('<v:rect></v:rect>');
					}
				}
			}

			$(map).bind('alwaysOn.maphilight', function() {
				// Check for areas with alwaysOn set. These are added to a *second* canvas,
				// which will get around flickering during fading.
				if(canvas_always) {
					clear_canvas(canvas_always)
				}
				if(!has_canvas) {
					$(canvas).empty();
				}
				$(map).find('area[coords]').each(function() {
					var shape, area_options;
					area_options = options_from_area(this, options);
					if(area_options.alwaysOn) {
						if(!canvas_always && has_canvas) {
							canvas_always = create_canvas_for(img.get());
							$(canvas_always).css(canvas_style);
							canvas_always.width = img.width();
							canvas_always.height = img.height();
							img.before(canvas_always);
						}
						area_options.fade = area_options.alwaysOnFade; // alwaysOn shouldn't fade in initially
						shape = shape_from_area(this);
						if (has_canvas) {
							add_shape_to(canvas_always, shape[0], shape[1], area_options, "");
						} else {
							add_shape_to(canvas, shape[0], shape[1], area_options, "");
						}
					}
				});
			});
			
			$(map).trigger('alwaysOn.maphilight').find('area[coords]')
				.bind('mouseover.maphilight', mouseover)
				.bind('mouseout.maphilight', function(e) { clear_canvas(canvas); });;
			
			img.before(canvas); // if we put this after, the mouseover events wouldn't fire.
			
			img.addClass('maphilighted');
		});
	};
	$.fn.maphilight.defaults = {
		fill: true,
		fillColor: '000000',
		fillOpacity: 0.2,
		stroke: true,
		strokeColor: 'ff0000',
		strokeOpacity: 1,
		strokeWidth: 1,
		fade: true,
		alwaysOn: false,
		neverOn: false,
		groupBy: false,
		wrapClass: true
	};
})(jQuery);

/*!
 * jQuery UI 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*
 * jQuery UI Accordion 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14",
animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
;

