﻿
/*
 * Modernizr v1.6
 * http://www.modernizr.com
 *
 * Developed by:
 * - Faruk Ates  http://farukat.es/
 * - Paul Irish  http://paulirish.com/
 *
 * Copyright (c) 2009-2010
 * Dual-licensed under the BSD or MIT licenses.
 * http://www.modernizr.com/license/
 */
window.Modernizr=function(i,e,u){function s(a,b){return(""+a).indexOf(b)!==-1}function D(a,b){for(var c in a)if(j[a[c]]!==u&&(!b||b(a[c],E)))return true}function n(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);c=(a+" "+F.join(c+" ")+c).split(" ");return!!D(c,b)}function S(){f.input=function(a){for(var b=0,c=a.length;b<c;b++)L[a[b]]=!!(a[b]in h);return L}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));f.inputtypes=function(a){for(var b=0,c,k=a.length;b<
k;b++){h.setAttribute("type",a[b]);if(c=h.type!=="text"){h.value=M;if(/^range$/.test(h.type)&&h.style.WebkitAppearance!==u){l.appendChild(h);c=e.defaultView;c=c.getComputedStyle&&c.getComputedStyle(h,null).WebkitAppearance!=="textfield"&&h.offsetHeight!==0;l.removeChild(h)}else/^(search|tel)$/.test(h.type)||(c=/^(url|email)$/.test(h.type)?h.checkValidity&&h.checkValidity()===false:h.value!=M)}N[a[b]]=!!c}return N}("search tel url email datetime date month week time datetime-local number range color".split(" "))}
var f={},l=e.documentElement,E=e.createElement("modernizr"),j=E.style,h=e.createElement("input"),M=":)",O=Object.prototype.toString,q=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),F="Webkit Moz O ms Khtml".split(" "),v={svg:"http://www.w3.org/2000/svg"},d={},N={},L={},P=[],w,Q=function(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent=a+"{#modernizr{height:3px}}";(e.head||e.getElementsByTagName("head")[0]).appendChild(b);c.id="modernizr";l.appendChild(c);a=c.offsetHeight===
3;b.parentNode.removeChild(b);c.parentNode.removeChild(c);return!!a},o=function(){var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(b,c){c=c||document.createElement(a[b]||"div");b="on"+b;var k=b in c;if(!k){c.setAttribute||(c=document.createElement("div"));if(c.setAttribute&&c.removeAttribute){c.setAttribute(b,"");k=typeof c[b]=="function";if(typeof c[b]!="undefined")c[b]=u;c.removeAttribute(b)}}return k}}(),G={}.hasOwnProperty,R;R=
typeof G!=="undefined"&&typeof G.call!=="undefined"?function(a,b){return G.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};d.flexbox=function(){var a=e.createElement("div"),b=e.createElement("div");(function(k,g,r,x){g+=":";k.style.cssText=(g+q.join(r+";"+g)).slice(0,-g.length)+(x||"")})(a,"display","box","width:42px;padding:0;");b.style.cssText=q.join("box-flex:1;")+"width:10px;";a.appendChild(b);l.appendChild(a);var c=b.offsetWidth===42;a.removeChild(b);
l.removeChild(a);return c};d.canvas=function(){var a=e.createElement("canvas");return!!(a.getContext&&a.getContext("2d"))};d.canvastext=function(){return!!(f.canvas&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.webgl=function(){var a=e.createElement("canvas");try{if(a.getContext("webgl"))return true}catch(b){}try{if(a.getContext("experimental-webgl"))return true}catch(c){}return false};d.touch=function(){return"ontouchstart"in i||Q("@media ("+q.join("touch-enabled),(")+
"modernizr)")};d.geolocation=function(){return!!navigator.geolocation};d.postmessage=function(){return!!i.postMessage};d.websqldatabase=function(){return!!i.openDatabase};d.indexedDB=function(){for(var a=-1,b=F.length;++a<b;){var c=F[a].toLowerCase();if(i[c+"_indexedDB"]||i[c+"IndexedDB"])return true}return false};d.hashchange=function(){return o("hashchange",i)&&(document.documentMode===u||document.documentMode>7)};d.history=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return o("drag")&&
o("dragstart")&&o("dragenter")&&o("dragover")&&o("dragleave")&&o("dragend")&&o("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){j.cssText="background-color:rgba(150,255,150,.5)";return s(j.backgroundColor,"rgba")};d.hsla=function(){j.cssText="background-color:hsla(120,40%,100%,.5)";return s(j.backgroundColor,"rgba")||s(j.backgroundColor,"hsla")};d.multiplebgs=function(){j.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(j.background)};d.backgroundsize=
function(){return n("backgroundSize")};d.borderimage=function(){return n("borderImage")};d.borderradius=function(){return n("borderRadius","",function(a){return s(a,"orderRadius")})};d.boxshadow=function(){return n("boxShadow")};d.textshadow=function(){return e.createElement("div").style.textShadow===""};d.opacity=function(){var a=q.join("opacity:.5;")+"";j.cssText=a;return s(j.opacity,"0.5")};d.cssanimations=function(){return n("animationName")};d.csscolumns=function(){return n("columnCount")};d.cssgradients=
function(){var a=("background-image:"+q.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+q.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);j.cssText=a;return s(j.backgroundImage,"gradient")};d.cssreflections=function(){return n("boxReflect")};d.csstransforms=function(){return!!D(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!D(["perspectiveProperty","WebkitPerspective",
"MozPerspective","OPerspective","msPerspective"]);if(a)a=Q("@media ("+q.join("transform-3d),(")+"modernizr)");return a};d.csstransitions=function(){return n("transitionProperty")};d.fontface=function(){var a,b=e.head||e.getElementsByTagName("head")[0]||l,c=e.createElement("style"),k=e.implementation||{hasFeature:function(){return false}};c.type="text/css";b.insertBefore(c,b.firstChild);a=c.sheet||c.styleSheet;b=k.hasFeature("CSS2","")?function(g){if(!(a&&g))return false;var r=false;try{a.insertRule(g,
0);r=!/unknown/i.test(a.cssRules[0].cssText);a.deleteRule(a.cssRules.length-1)}catch(x){}return r}:function(g){if(!(a&&g))return false;a.cssText=g;return a.cssText.length!==0&&!/unknown/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(g.split(" ")[0])===0};f._fontfaceready=function(g){g(f.fontface)};return b('@font-face { font-family: "font"; src: "font.ttf"; }')};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');
b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"')||a.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localstorage=function(){try{return"localStorage"in
i&&i.localStorage!==null}catch(a){return false}};d.sessionstorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webWorkers=function(){return!!i.Worker};d.applicationcache=function(){return!!i.applicationCache};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS(v.svg,"svg").createSVGRect};d.inlinesvg=function(){var a=document.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==v.svg};d.smil=function(){return!!e.createElementNS&&
/SVG/.test(O.call(e.createElementNS(v.svg,"animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(O.call(e.createElementNS(v.svg,"clipPath")))};for(var H in d)if(R(d,H)){w=H.toLowerCase();f[w]=d[H]();P.push((f[w]?"":"no-")+w)}f.input||S();f.crosswindowmessaging=f.postmessage;f.historymanagement=f.history;f.addTest=function(a,b){a=a.toLowerCase();if(!f[a]){b=!!b();l.className+=" "+(b?"":"no-")+a;f[a]=b;return f}};j.cssText="";E=h=null;i.attachEvent&&function(){var a=e.createElement("div");
a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function c(p){for(var m=-1;++m<r;)p.createElement(g[m])}function k(p,m){for(var I=p.length,t=-1,y,J=[];++t<I;){y=p[t];m=y.media||m;J.push(k(y.imports,m));J.push(y.cssText)}return J.join("")}var g="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video".split("|"),r=g.length,x=RegExp("<(/*)(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)",
"gi"),T=RegExp("\\b(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)\\b(?!.*[;}])","gi"),z=b.createDocumentFragment(),A=b.documentElement,K=A.firstChild,B=b.createElement("style"),C=b.createElement("body");B.media="all";c(b);c(z);a.attachEvent("onbeforeprint",function(){for(var p=-1;++p<r;)for(var m=b.getElementsByTagName(g[p]),I=m.length,t=-1;++t<I;)if(m[t].className.indexOf("iepp_")<0)m[t].className+=" iepp_"+
g[p];K.insertBefore(B,K.firstChild);B.styleSheet.cssText=k(b.styleSheets,"all").replace(T,".iepp_$1");z.appendChild(b.body);A.appendChild(C);C.innerHTML=z.firstChild.innerHTML.replace(x,"<$1bdo")});a.attachEvent("onafterprint",function(){C.innerHTML="";A.removeChild(C);K.removeChild(B);A.appendChild(z.firstChild)})}(this,document);f._enableHTML5=true;f._version="1.6";l.className=l.className.replace(/\bno-js\b/,"")+" js";l.className+=" "+P.join(" ");return f}(this,this.document);
/*
 * jquery-ujs
 *
 * http://github.com/rails/jquery-ujs/blob/master/src/rails.js
 *
 * This rails.js file supports jQuery 1.4.3 and 1.4.4 .
 *
 */

jQuery(function ($) {
    var csrf_token = $('meta[name=csrf-token]').attr('content'),
        csrf_param = $('meta[name=csrf-param]').attr('content');

    $.fn.extend({
        /**
         * Triggers a custom event on an element and returns the event result
         * this is used to get around not being able to ensure callbacks are placed
         * at the end of the chain.
         *
         * TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our
         *       own events and placing ourselves at the end of the chain.
         */
        triggerAndReturn: function (name, data) {
            var event = new $.Event(name);
            this.trigger(event, data);

            return event.result !== false;
        },

        /**
         * Handles execution of remote calls. Provides following callbacks:
         *
         * - ajax:beforeSend  - is executed before firing ajax call
         * - ajax:success  - is executed when status is success
         * - ajax:complete - is executed when the request finishes, whether in failure or success.
         * - ajax:error    - is execute in case of error
         */
        callRemote: function () {
            var el      = this,
                method  = el.attr('method') || el.attr('data-method') || 'GET',
                url     = el.attr('action') || el.attr('href'),
                dataType  = el.attr('data-type')  || ($.ajaxSettings && $.ajaxSettings.dataType);

            if (url === undefined) {
                throw "No URL specified for remote call (action or href must be present).";
            } else {
                    var $this = $(this), data = el.is('form') ? el.serializeArray() : [];

                    $.ajax({
                        url: url,
                        data: data,
                        dataType: dataType,
                        type: method.toUpperCase(),
                        beforeSend: function (xhr) {
                            xhr.setRequestHeader("Accept", "text/javascript");
                            if ($this.triggerHandler('ajax:beforeSend') === false) {
                              return false;
                            }
                        },
                        success: function (data, status, xhr) {
                            el.trigger('ajax:success', [data, status, xhr]);
                        },
                        complete: function (xhr) {
                            el.trigger('ajax:complete', xhr);
                        },
                        error: function (xhr, status, error) {
                            el.trigger('ajax:error', [xhr, status, error]);
                        }
                    });
            }
        }
    });

    /**
     *  confirmation handler
     */

    $('body').delegate('a[data-confirm], button[data-confirm], input[data-confirm]', 'click.rails', function () {
        var el = $(this);
        if (el.triggerAndReturn('confirm')) {
            if (!confirm(el.attr('data-confirm'))) {
                return false;
            }
        }
    });



    /**
     * remote handlers
     */
    $('form[data-remote]').live('submit.rails', function (e) {
        $(this).callRemote();
        e.preventDefault();
    });

    $('a[data-remote],input[data-remote]').live('click.rails', function (e) {
        $(this).callRemote();
        e.preventDefault();
    });

    /**
     * <%#= link_to "Delete", user_path(@user), :method => :delete, :confirm => "Are you sure?" %>
     *
     * <a href="/users/5" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
     */
    $('a[data-method]:not([data-remote])').live('click.rails', function (e){
        var link = $(this),
            href = link.attr('href'),
            method = link.attr('data-method'),
            form = $('<form method="post" action="'+href+'"></form>'),
            metadata_input = '<input name="_method" value="'+method+'" type="hidden" />';

        if (csrf_param !== undefined && csrf_token !== undefined) {
            metadata_input += '<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />';
        }

        form.hide()
            .append(metadata_input)
            .appendTo('body');

        e.preventDefault();
        form.submit();
    });

    /**
     * disable-with handlers
     */
    var disable_with_input_selector           = 'input[data-disable-with]',
        disable_with_form_remote_selector     = 'form[data-remote]:has('       + disable_with_input_selector + ')',
        disable_with_form_not_remote_selector = 'form:not([data-remote]):has(' + disable_with_input_selector + ')';

    var disable_with_input_function = function () {
        $(this).find(disable_with_input_selector).each(function () {
            var input = $(this);
            input.data('enable-with', input.val())
                .attr('value', input.attr('data-disable-with'))
                .attr('disabled', 'disabled');
        });
    };

    $(disable_with_form_remote_selector).live('ajax:before.rails', disable_with_input_function);
    $(disable_with_form_not_remote_selector).live('submit.rails', disable_with_input_function);

    $(disable_with_form_remote_selector).live('ajax:complete.rails', function () {
        $(this).find(disable_with_input_selector).each(function () {
            var input = $(this);
            input.removeAttr('disabled')
                 .val(input.data('enable-with'));
        });
    });

    var jqueryVersion = $().jquery;

	if (!( (jqueryVersion === '1.4.3') || (jqueryVersion === '1.4.4'))){
		alert('This rails.js does not support the jQuery version you are using. Please read documentation.');
	}


});
/**
 * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework
 *
 * (en) Workaround for Webkit browsers to fix focus problems when using skiplinks
 * (de) Workaround für Webkit browsers, um den Focus zu korrigieren, bei Verwendung von Skiplinks
 *
 * @note			inspired by Paul Ratcliffe's article
 *					http://www.communis.co.uk/blog/2009-06-02-skip-links-chrome-safari-and-added-wai-aria
 *
 * @copyright       Copyright 2005-2010, Dirk Jesse
 * @license         CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/),
 *                  YAML-C (http://www.yaml.de/en/license/license-conditions.html)
 * @link            http://www.yaml.de
 * @package         yaml
 * @version         3.2.1
 * @revision        $Revision: 443 $
 * @lastmodified    $Date: 2009-12-31 18:05:05 +0100 (Do, 31. Dez 2009) $
 */

var YAML_focusFix = {
	init: function() {

		var userAgent = navigator.userAgent.toLowerCase();
		var	is_webkit = userAgent.indexOf('webkit') > -1;
		var	is_ie = userAgent.indexOf('msie') > -1;
		var i = 0;
		var links, skiplinks = [];

		if (is_webkit || is_ie)
		{
			if ( document.getElementsByClassName !== undefined) {
				skiplinks = document.getElementsByClassName('skip');

				for (i=0; i<skiplinks.length; i++) {
					this.setTabIndex(skiplinks[i]);
				}
			} else {
				links = document.getElementsByTagName('a');
				for (i=0; i<links.length; i++) {
					var s = links[i].getAttribute('href');
					if (s.length > 1 && s.substr(0, 1) == '#' ) {
						this.setTabIndex(links[i]);
					}
				}
			}
		}
	},

	setTabIndex: function( skiplink ){
		var target = skiplink.href.substr(skiplink.href.indexOf('#')+1);
		var targetElement = document.getElementById(target);

		if (targetElement !== null) {
			targetElement.setAttribute("tabindex", "-1");
			skiplink.setAttribute("onclick", "document.getElementById('"+target+"').focus();");
		}
	}
};

YAML_focusFix.init();
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
/*
 * Shadowbox.js, version 3.0.3
 * http://shadowbox-js.com/
 *
 * Copyright 2007-2010, Michael J. I. Jackson
 * Date: 2010-04-22 13:02:43 +0000
 */
(function(T,p){var g={version:"3.0.3"};var Y=navigator.userAgent.toLowerCase();if(Y.indexOf("windows")>-1||Y.indexOf("win32")>-1){g.isWindows=true}else{if(Y.indexOf("macintosh")>-1||Y.indexOf("mac os x")>-1){g.isMac=true}else{if(Y.indexOf("linux")>-1){g.isLinux=true}}}g.isIE=Y.indexOf("msie")>-1;g.isIE6=Y.indexOf("msie 6")>-1;g.isIE7=Y.indexOf("msie 7")>-1;g.isGecko=Y.indexOf("gecko")>-1&&Y.indexOf("safari")==-1;g.isWebKit=Y.indexOf("applewebkit/")>-1;var e=/#(.+)$/,M=/^(light|shadow)box\[(.*?)\]/i,o=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,at=/[0-9a-z]+$/i,aq=/(.+\/)shadowbox\.js/i;var w=false,m=false,V={},aj=0,O,ab;g.current=-1;g.dimensions=null;g.ease=function(K){return 1+Math.pow(K-1,3)};g.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};g.gallery=[];g.onReady=ak;g.path=null;g.player=null;g.playerId="sb-player";g.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:ak,onClose:ak,onFinish:ak,onOpen:ak,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};g.getCurrent=function(){return g.current>-1?g.gallery[g.current]:null};g.hasNext=function(){return g.gallery.length>1&&(g.current!=g.gallery.length-1||g.options.continuous)};g.isOpen=function(){return w};g.isPaused=function(){return ab=="pause"};g.applyOptions=function(K){V=ap({},g.options);ap(g.options,K)};g.revertOptions=function(){ap(g.options,V)};g.init=function(av,ay){if(m){return}m=true;if(g.skin.options){ap(g.options,g.skin.options)}if(av){ap(g.options,av)}if(!g.path){var ax,S=document.getElementsByTagName("script");for(var aw=0,K=S.length;aw<K;++aw){ax=aq.exec(S[aw].src);if(ax){g.path=ax[1];break}}}if(ay){g.onReady=ay}ar()};g.open=function(S){if(w){return}var K=g.makeGallery(S);g.gallery=K[0];g.current=K[1];S=g.getCurrent();if(S==null){return}g.applyOptions(S.options||{});f();if(g.gallery.length){S=g.getCurrent();if(g.options.onOpen(S)===false){return}w=true;g.skin.onOpen(S,U)}};g.close=function(){if(!w){return}w=false;if(g.player){g.player.remove();g.player=null}if(typeof ab=="number"){clearTimeout(ab);ab=null}aj=0;ag(false);g.options.onClose(g.getCurrent());g.skin.onClose();g.revertOptions()};g.play=function(){if(!g.hasNext()){return}if(!aj){aj=g.options.slideshowDelay*1000}if(aj){O=X();ab=setTimeout(function(){aj=O=0;g.next()},aj);if(g.skin.onPlay){g.skin.onPlay()}}};g.pause=function(){if(typeof ab!="number"){return}aj=Math.max(0,aj-(X()-O));if(aj){clearTimeout(ab);ab="pause";if(g.skin.onPause){g.skin.onPause()}}};g.change=function(K){if(!(K in g.gallery)){if(g.options.continuous){K=(K<0?g.gallery.length+K:0);if(!(K in g.gallery)){return}}else{return}}g.current=K;if(typeof ab=="number"){clearTimeout(ab);ab=null;aj=O=0}g.options.onChange(g.getCurrent());U(true)};g.next=function(){g.change(g.current+1)};g.previous=function(){g.change(g.current-1)};g.setDimensions=function(aH,ay,aF,aG,ax,K,aD,aA){var aC=aH,aw=ay;var aB=2*aD+ax;if(aH+aB>aF){aH=aF-aB}var av=2*aD+K;if(ay+av>aG){ay=aG-av}var S=(aC-aH)/aC,aE=(aw-ay)/aw,az=(S>0||aE>0);if(aA&&az){if(S>aE){ay=Math.round((aw/aC)*aH)}else{if(aE>S){aH=Math.round((aC/aw)*ay)}}}g.dimensions={height:aH+ax,width:ay+K,innerHeight:aH,innerWidth:ay,top:Math.floor((aF-(aH+aB))/2+aD),left:Math.floor((aG-(ay+av))/2+aD),oversized:az};return g.dimensions};g.makeGallery=function(ax){var K=[],aw=-1;if(typeof ax=="string"){ax=[ax]}if(typeof ax.length=="number"){ad(ax,function(az,aA){if(aA.content){K[az]=aA}else{K[az]={content:aA}}});aw=0}else{if(ax.tagName){var S=g.getCache(ax);ax=S?S:g.makeObject(ax)}if(ax.gallery){K=[];var ay;for(var av in g.cache){ay=g.cache[av];if(ay.gallery&&ay.gallery==ax.gallery){if(aw==-1&&ay.content==ax.content){aw=K.length}K.push(ay)}}if(aw==-1){K.unshift(ax);aw=0}}else{K=[ax];aw=0}}ad(K,function(az,aA){K[az]=ap({},aA)});return[K,aw]};g.makeObject=function(aw,av){var ax={content:aw.href,title:aw.getAttribute("title")||"",link:aw};if(av){av=ap({},av);ad(["player","title","height","width","gallery"],function(ay,az){if(typeof av[az]!="undefined"){ax[az]=av[az];delete av[az]}});ax.options=av}else{ax.options={}}if(!ax.player){ax.player=g.getPlayer(ax.content)}var K=aw.getAttribute("rel");if(K){var S=K.match(M);if(S){ax.gallery=escape(S[2])}ad(K.split(";"),function(ay,az){S=az.match(o);if(S){ax[S[1]]=S[2]}})}return ax};g.getPlayer=function(av){if(av.indexOf("#")>-1&&av.indexOf(document.location.href)==0){return"inline"}var aw=av.indexOf("?");if(aw>-1){av=av.substring(0,aw)}var S,K=av.match(at);if(K){S=K[0].toLowerCase()}if(S){if(g.img&&g.img.ext.indexOf(S)>-1){return"img"}if(g.swf&&g.swf.ext.indexOf(S)>-1){return"swf"}if(g.flv&&g.flv.ext.indexOf(S)>-1){return"flv"}if(g.qt&&g.qt.ext.indexOf(S)>-1){if(g.wmp&&g.wmp.ext.indexOf(S)>-1){return"qtwmp"}else{return"qt"}}if(g.wmp&&g.wmp.ext.indexOf(S)>-1){return"wmp"}}return"iframe"};function f(){var aw=g.errorInfo,ax=g.plugins,az,aA,aD,av,aC,S,aB,K;for(var ay=0;ay<g.gallery.length;++ay){az=g.gallery[ay];aA=false;aD=null;switch(az.player){case"flv":case"swf":if(!ax.fla){aD="fla"}break;case"qt":if(!ax.qt){aD="qt"}break;case"wmp":if(g.isMac){if(ax.qt&&ax.f4m){az.player="qt"}else{aD="qtf4m"}}else{if(!ax.wmp){aD="wmp"}}break;case"qtwmp":if(ax.qt){az.player="qt"}else{if(ax.wmp){az.player="wmp"}else{aD="qtwmp"}}break}if(aD){if(g.options.handleUnsupported=="link"){switch(aD){case"qtf4m":aC="shared";S=[aw.qt.url,aw.qt.name,aw.f4m.url,aw.f4m.name];break;case"qtwmp":aC="either";S=[aw.qt.url,aw.qt.name,aw.wmp.url,aw.wmp.name];break;default:aC="single";S=[aw[aD].url,aw[aD].name]}az.player="html";az.content='<div class="sb-message">'+s(g.lang.errors[aC],S)+"</div>"}else{aA=true}}else{if(az.player=="inline"){av=e.exec(az.content);if(av){aB=ah(av[1]);if(aB){az.content=aB.innerHTML}else{aA=true}}else{aA=true}}else{if(az.player=="swf"||az.player=="flv"){K=(az.options&&az.options.flashVersion)||g.options.flashVersion;if(g.flash&&!g.flash.hasFlashPlayerVersion(K)){az.width=310;az.height=177}}}}if(aA){g.gallery.splice(ay,1);if(ay<g.current){--g.current}else{if(ay==g.current){g.current=ay>0?ay-1:ay}}--ay}}}function ag(K){if(!g.options.enableKeys){return}(K?j:a)(document,"keydown",W)}function W(av){if(av.metaKey||av.shiftKey||av.altKey||av.ctrlKey){return}var S=l(av),K;switch(S){case 81:case 88:case 27:K=g.close;break;case 37:K=g.previous;break;case 39:K=g.next;break;case 32:K=typeof ab=="number"?g.pause:g.play;break}if(K){G(av);K()}}function U(az){ag(false);var ay=g.getCurrent();var av=(ay.player=="inline"?"html":ay.player);if(typeof g[av]!="function"){throw"unknown player "+av}if(az){g.player.remove();g.revertOptions();g.applyOptions(ay.options||{})}g.player=new g[av](ay,g.playerId);if(g.gallery.length>1){var aw=g.gallery[g.current+1]||g.gallery[0];if(aw.player=="img"){var S=new Image();S.src=aw.content}var ax=g.gallery[g.current-1]||g.gallery[g.gallery.length-1];if(ax.player=="img"){var K=new Image();K.src=ax.content}}g.skin.onLoad(az,r)}function r(){if(!w){return}if(typeof g.player.ready!="undefined"){var K=setInterval(function(){if(w){if(g.player.ready){clearInterval(K);K=null;g.skin.onReady(J)}}else{clearInterval(K);K=null}},10)}else{g.skin.onReady(J)}}function J(){if(!w){return}g.player.append(g.skin.body,g.dimensions);g.skin.onShow(q)}function q(){if(!w){return}if(g.player.onLoad){g.player.onLoad()}g.options.onFinish(g.getCurrent());if(!g.isPaused()){g.play()}ag(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(S,av){var K=this.length>>>0;av=av||0;if(av<0){av+=K}for(;av<K;++av){if(av in this&&this[av]===S){return av}}return -1}}function X(){return(new Date).getTime()}function ap(K,av){for(var S in av){K[S]=av[S]}return K}function ad(aw,ax){var S=0,K=aw.length;for(var av=aw[0];S<K&&ax.call(av,S,av)!==false;av=aw[++S]){}}function s(S,K){return S.replace(/\{(\w+?)\}/g,function(av,aw){return K[aw]})}function ak(){}function ah(K){return document.getElementById(K)}function z(K){K.parentNode.removeChild(K)}var al=true,L=true;function ao(){var K=document.body,S=document.createElement("div");al=typeof S.style.opacity==="string";S.style.position="fixed";S.style.margin=0;S.style.top="20px";K.appendChild(S,K.firstChild);L=S.offsetTop==20;K.removeChild(S)}g.getStyle=(function(){var K=/opacity=([^)]*)/,S=document.defaultView&&document.defaultView.getComputedStyle;return function(ay,ax){var aw;if(!al&&ax=="opacity"&&ay.currentStyle){aw=K.test(ay.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return aw===""?"1":aw}if(S){var av=S(ay,null);if(av){aw=av[ax]}if(ax=="opacity"&&aw==""){aw="1"}}else{aw=ay.currentStyle[ax]}return aw}})();g.appendHTML=function(av,S){if(av.insertAdjacentHTML){av.insertAdjacentHTML("BeforeEnd",S)}else{if(av.lastChild){var K=av.ownerDocument.createRange();K.setStartAfter(av.lastChild);var aw=K.createContextualFragment(S);av.appendChild(aw)}else{av.innerHTML=S}}};g.getWindowSize=function(K){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+K]}return document.body["client"+K]};g.setOpacity=function(av,K){var S=av.style;if(al){S.opacity=(K==1?"":K)}else{S.zoom=1;if(K==1){if(typeof S.filter=="string"&&(/alpha/i).test(S.filter)){S.filter=S.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{S.filter=(S.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(K*100)+")"}}};g.clearOpacity=function(K){g.setOpacity(K,1)};function C(K){return K.target}function Q(K){return[K.pageX,K.pageY]}function G(K){K.preventDefault()}function l(K){return K.keyCode}function j(av,S,K){jQuery(av).bind(S,K)}function a(av,S,K){jQuery(av).unbind(S,K)}jQuery.fn.shadowbox=function(K){return this.each(function(){var av=jQuery(this);var aw=jQuery.extend({},K||{},jQuery.metadata?av.metadata():jQuery.meta?av.data():{});var S=this.className||"";aw.width=parseInt((S.match(/w:(\d+)/)||[])[1])||aw.width;aw.height=parseInt((S.match(/h:(\d+)/)||[])[1])||aw.height;Shadowbox.setup(av,aw)})};var D=false,N;if(document.addEventListener){N=function(){document.removeEventListener("DOMContentLoaded",N,false);g.load()}}else{if(document.attachEvent){N=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",N);g.load()}}}}function i(){if(D){return}try{document.documentElement.doScroll("left")}catch(K){setTimeout(i,1);return}g.load()}function ar(){if(document.readyState==="complete"){return g.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",N,false);T.addEventListener("load",g.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",N);T.attachEvent("onload",g.load);var K=false;try{K=T.frameElement===null}catch(S){}if(document.documentElement.doScroll&&K){i()}}}}g.load=function(){if(D){return}if(!document.body){return setTimeout(g.load,13)}D=true;ao();g.onReady();if(!g.options.skipSetup){g.setup()}g.skin.init()};g.plugins={};if(navigator.plugins&&navigator.plugins.length){var an=[];ad(navigator.plugins,function(K,S){an.push(S.name)});an=an.join(",");var d=an.indexOf("Flip4Mac")>-1;g.plugins={fla:an.indexOf("Shockwave Flash")>-1,qt:an.indexOf("QuickTime")>-1,wmp:!d&&an.indexOf("Windows Media")>-1,f4m:d}}else{var B=function(K){var S;try{S=new ActiveXObject(K)}catch(av){}return !!S};g.plugins={fla:B("ShockwaveFlash.ShockwaveFlash"),qt:B("QuickTime.QuickTime"),wmp:B("wmplayer.ocx"),f4m:false}}var c=/^(light|shadow)box/i,aa="shadowboxCacheKey",h=1;g.cache={};g.select=function(S){var av=[];if(!S){var K;ad(document.getElementsByTagName("a"),function(ay,az){K=az.getAttribute("rel");if(K&&c.test(K)){av.push(az)}})}else{var ax=S.length;if(ax){if(typeof S=="string"){if(g.find){av=g.find(S)}}else{if(ax==2&&typeof S[0]=="string"&&S[1].nodeType){if(g.find){av=g.find(S[0],S[1])}}else{for(var aw=0;aw<ax;++aw){av[aw]=S[aw]}}}}else{av.push(S)}}return av};g.setup=function(K,S){ad(g.select(K),function(av,aw){g.addCache(aw,S)})};g.teardown=function(K){ad(g.select(K),function(S,av){g.removeCache(av)})};g.addCache=function(av,K){var S=av[aa];if(S==p){S=h++;av[aa]=S;j(av,"click",b)}g.cache[S]=g.makeObject(av,K)};g.removeCache=function(K){a(K,"click",b);delete g.cache[K[aa]];K[aa]=null};g.getCache=function(S){var K=S[aa];return(K in g.cache&&g.cache[K])};g.clearCache=function(){for(var K in g.cache){g.removeCache(g.cache[K].link)}g.cache={}};function b(K){g.open(this);if(g.gallery.length){G(K)}}g.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};g.iframe=function(S,av){this.obj=S;this.id=av;var K=ah("sb-overlay");this.height=S.height?parseInt(S.height,10):K.offsetHeight;this.width=S.width?parseInt(S.width,10):K.offsetWidth};g.iframe.prototype={append:function(K,av){var S='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(g.isIE){S+=' allowtransparency="true"';if(g.isIE6){S+=" src=\"javascript:false;document.write('');\""}}S+="></iframe>";K.innerHTML=S},remove:function(){var K=ah(this.id);if(K){z(K);if(g.isGecko){delete T.frames[this.id]}}},onLoad:function(){var K=g.isIE?ah(this.id).contentWindow:T.frames[this.id];K.location.href=this.obj.content}};var Z=16;g.qt=function(K,S){this.obj=K;this.id=S;this.height=K.height?parseInt(K.height,10):300;if(g.options.showMovieControls){this.height+=Z}this.width=K.width?parseInt(K.width,10):300};g.qt.ext=["dv","mov","moov","movie","mp4","avi","mpg","mpeg"];g.qt.prototype={append:function(aA,aB){var S=g.options,av=String(S.autoplayMovies),aC=String(S.showMovieControls);var az="<object",ax={id:this.id,name:this.id,height:this.height,width:this.width,kioskmode:"true"};if(g.isIE){ax.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";ax.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"}else{ax.type="video/quicktime";ax.data=this.obj.content}for(var aw in ax){az+=" "+aw+'="'+ax[aw]+'"'}az+=">";var ay={src:this.obj.content,scale:"aspect",controller:aC,autoplay:av};for(var K in ay){az+='<param name="'+K+'" value="'+ay[K]+'">'}az+="</object>";aA.innerHTML=az},remove:function(){try{document[this.id].Stop()}catch(S){}var K=ah(this.id);if(K){z(K)}}};var am=false,A=[],H=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],F,ai,v,P=true;function af(av,aF,aC,aA,aG){var K=(aF=="opacity"),aB=K?g.setOpacity:function(aH,aI){aH.style[aF]=""+aI+"px"};if(aA==0||(!K&&!g.options.animate)||(K&&!g.options.animateFade)){aB(av,aC);if(aG){aG()}return}var aD=parseFloat(g.getStyle(av,aF))||0;var aE=aC-aD;if(aE==0){if(aG){aG()}return}aA*=1000;var aw=X(),az=g.ease,ay=aw+aA,ax;var S=setInterval(function(){ax=X();if(ax>=ay){clearInterval(S);S=null;aB(av,aC);if(aG){aG()}}else{aB(av,aD+az((ax-aw)/aA)*aE)}},10)}function I(){F.style.height=g.getWindowSize("Height")+"px";F.style.width=g.getWindowSize("Width")+"px"}function ae(){F.style.top=document.documentElement.scrollTop+"px";F.style.left=document.documentElement.scrollLeft+"px"}function y(K){if(K){ad(A,function(S,av){av[0].style.visibility=av[1]||""})}else{A=[];ad(g.options.troubleElements,function(av,S){ad(document.getElementsByTagName(S),function(aw,ax){A.push([ax,ax.style.visibility]);ax.style.visibility="hidden"})})}}function x(av,K){var S=ah("sb-nav-"+av);if(S){S.style.display=K?"":"none"}}function n(K,ay){var ax=ah("sb-loading"),av=g.getCurrent().player,aw=(av=="img"||av=="html");if(K){g.setOpacity(ax,0);ax.style.display="block";var S=function(){g.clearOpacity(ax);if(ay){ay()}};if(aw){af(ax,"opacity",1,g.options.fadeDuration,S)}else{S()}}else{var S=function(){ax.style.display="none";g.clearOpacity(ax);if(ay){ay()}};if(aw){af(ax,"opacity",0,g.options.fadeDuration,S)}else{S()}}}function au(aD){var ay=g.getCurrent();ah("sb-title-inner").innerHTML=ay.title||"";var aE,aA,S,aF,aB;if(g.options.displayNav){aE=true;var aC=g.gallery.length;if(aC>1){if(g.options.continuous){aA=aB=true}else{aA=(aC-1)>g.current;aB=g.current>0}}if(g.options.slideshowDelay>0&&g.hasNext()){aF=!g.isPaused();S=!aF}}else{aE=aA=S=aF=aB=false}x("close",aE);x("next",aA);x("play",S);x("pause",aF);x("previous",aB);var K="";if(g.options.displayCounter&&g.gallery.length>1){var aC=g.gallery.length;if(g.options.counterType=="skip"){var ax=0,aw=aC,av=parseInt(g.options.counterLimit)||0;if(av<aC&&av>2){var az=Math.floor(av/2);ax=g.current-az;if(ax<0){ax+=aC}aw=g.current+(av-az);if(aw>aC){aw-=aC}}while(ax!=aw){if(ax==aC){ax=0}K+='<a onclick="Shadowbox.change('+ax+');"';if(ax==g.current){K+=' class="sb-counter-current"'}K+=">"+(++ax)+"</a>"}}else{K=[g.current+1,g.lang.of,aC].join(" ")}}ah("sb-counter").innerHTML=K;aD()}function u(aw){var K=ah("sb-title-inner"),av=ah("sb-info-inner"),S=0.35;K.style.visibility=av.style.visibility="";if(K.innerHTML!=""){af(K,"marginTop",0,S)}af(av,"marginTop",0,S,aw)}function ac(av,aB){var az=ah("sb-title"),K=ah("sb-info"),aw=az.offsetHeight,ax=K.offsetHeight,ay=ah("sb-title-inner"),aA=ah("sb-info-inner"),S=(av?0.35:0);af(ay,"marginTop",aw,S);af(aA,"marginTop",ax*-1,S,function(){ay.style.visibility=aA.style.visibility="hidden";aB()})}function E(K,aw,S,ay){var ax=ah("sb-wrapper-inner"),av=(S?g.options.resizeDuration:0);af(v,"top",aw,av);af(ax,"height",K,av,ay)}function t(K,aw,S,ax){var av=(S?g.options.resizeDuration:0);af(v,"left",aw,av);af(v,"width",K,av,ax)}function R(aB,av){var ax=ah("sb-body-inner"),aB=parseInt(aB),av=parseInt(av),S=v.offsetHeight-ax.offsetHeight,K=v.offsetWidth-ax.offsetWidth,az=ai.offsetHeight,aA=ai.offsetWidth,ay=parseInt(g.options.viewportPadding)||20,aw=(g.player&&g.options.handleOversize!="drag");return g.setDimensions(aB,av,az,aA,S,K,ay,aw)}var k={};k.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';k.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};k.init=function(){g.appendHTML(document.body,s(k.markup,g.lang));k.body=ah("sb-body-inner");F=ah("sb-container");ai=ah("sb-overlay");v=ah("sb-wrapper");if(!L){F.style.position="absolute"}if(!al){var av,K,S=/url\("(.*\.png)"\)/;ad(H,function(ax,ay){av=ah(ay);if(av){K=g.getStyle(av,"backgroundImage").match(S);if(K){av.style.backgroundImage="none";av.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+K[1]+",sizingMethod=scale);"}}})}var aw;j(T,"resize",function(){if(aw){clearTimeout(aw);aw=null}if(w){aw=setTimeout(k.onWindowResize,10)}})};k.onOpen=function(K,av){P=false;F.style.display="block";I();var S=R(g.options.initialHeight,g.options.initialWidth);E(S.innerHeight,S.top);t(S.width,S.left);if(g.options.showOverlay){ai.style.backgroundColor=g.options.overlayColor;g.setOpacity(ai,0);if(!g.options.modal){j(ai,"click",g.close)}am=true}if(!L){ae();j(T,"scroll",ae)}y();F.style.visibility="visible";if(am){af(ai,"opacity",g.options.overlayOpacity,g.options.fadeDuration,av)}else{av()}};k.onLoad=function(S,K){n(true);while(k.body.firstChild){z(k.body.firstChild)}ac(S,function(){if(!w){return}if(!S){v.style.visibility="visible"}au(K)})};k.onReady=function(aw){if(!w){return}var S=g.player,av=R(S.height,S.width);var K=function(){u(aw)};switch(g.options.animSequence){case"hw":E(av.innerHeight,av.top,true,function(){t(av.width,av.left,true,K)});break;case"wh":t(av.width,av.left,true,function(){E(av.innerHeight,av.top,true,K)});break;default:t(av.width,av.left,true);E(av.innerHeight,av.top,true,K)}};k.onShow=function(K){n(false,K);P=true};k.onClose=function(){if(!L){a(T,"scroll",ae)}a(ai,"click",g.close);v.style.visibility="hidden";var K=function(){F.style.visibility="hidden";F.style.display="none";y(true)};if(am){af(ai,"opacity",0,g.options.fadeDuration,K)}else{K()}};k.onPlay=function(){x("play",false);x("pause",true)};k.onPause=function(){x("pause",false);x("play",true)};k.onWindowResize=function(){if(!P){return}I();var K=g.player,S=R(K.height,K.width);t(S.width,S.left);E(S.innerHeight,S.top);if(K.onWindowResize){K.onWindowResize()}};g.skin=k;T.Shadowbox=g})(window);

var current_index = 0;
var backgrounds   = [
  "/images/layout/header/546-09.jpg",
  "/images/layout/header/546-14.jpg",
  "/images/layout/header/546-21.jpg",
  "/images/layout/header/1015-01.jpg",
  "/images/layout/header/1015-04.jpg",
  "/images/layout/header/1015-11.jpg",
  "/images/layout/header/1015-12.jpg",
  "/images/layout/header/1015-14.jpg",
  "/images/layout/header/1015-17.jpg",
  "/images/layout/header/1635-36.jpg",
  "/images/layout/header/1635-39.jpg"];

$(function() {
  $("#menu li:last").addClass("last");
  $("a[href$=.pdf]").click(function(e) { openPDFWin($(this).attr("href")); e.preventDefault(); });
  $("a[href^=http://]").attr("target", "_blank");
  window.setInterval(swapBackground, 7000);

  $(".pic-frame").show();
  $(".pic-frame a").each(function() {
      var self = this;
      $(this).before($($(self).attr("href") + " div.header").html());
  });
  $(".pic-frame a").tooltip({
      bodyHandler: function() {
          var package = $(this).attr("href");
          return "<h2>" + $(package + " h2").html() + "</h2><ul>" + $(package + " ul.features").html() + "</ul><p>" + $("#more_info").html() + "</p>";
      },
      showURL: false,
      track: true
  });

  $("hr.optional").hide();
  $(".pic-frame a").click(function(e) {
      $("#overview").hide();
      $(".back-to-overview").show();
      $(".package").fadeOut("slow").addClass("invisible");
      $($(this).attr("href")).fadeIn("slow").removeClass("invisible");
      e.preventDefault();
  });

  $(".back-to-overview a").click(function(e) {
      $(".package").fadeOut("slow");
      $("#overview").fadeIn("slow");
      $(".back-to-overview").hide();
      e.preventDefault();
  });

  $("div.package").addClass("invisible");

  $(".special_offer[data-href]").click(function() { document.location.href = $(this).attr("data-href"); });
});

function openPDFWin(url) {
  window.open(url, '', 'resizable');
}

function swapBackground() {
  if (current_index < backgrounds.length - 1) {
    current_index++;
  } else {
    current_index = 0;
  }

  $('#header').css("background-image", "url(" + backgrounds[current_index] + ")");
}

