Commits

Sergio Berlotto  committed 252aef9

Commit inicial! Site berlotto.net

  • Participants

Comments (0)

Files changed (349)

File __init__.py

Empty file added.

File encurtador/__init__.py

Empty file added.

File encurtador/admin.py

+from django.contrib import admin
+from models import Links
+
+class LinksAdmin(admin.ModelAdmin):
+    fileds       = ('url', 'short', 'acessos','data_criacao')
+    list_display = ('url', 'short', 'acessos')
+    
+admin.site.register(Links, LinksAdmin)

File encurtador/models.py

+# -*- coding: utf-8 -*-
+from django.db import models
+
+# Create your models here.
+class Links(models.Model):
+    url = models.CharField(max_length=500)
+    short = models.CharField(max_length=255)
+    data_criacao = models.DateTimeField(auto_now_add=True)
+    acessos = models.IntegerField()
+    
+    def __str__(self):
+        return self.url
+    
+    def get_absolute_url(self):
+        return self.url
+    
+    class Meta:
+        db_table = 'links'

File encurtador/tests.py

+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+

File encurtador/urls.py

+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+    (r'^encurtar/$','encurtador.views.encurtar'),
+    (r'^api/$','encurtador.views.api'),
+    (r'^lista/$','encurtador.views.lista'),
+    (r'^(?P<short>[\w\W\d]+)/$','encurtador.views.acessar'),
+    url(r'^$','encurtador.views.index', name='index'),
+)

File encurtador/util.py

+"""
+Gerador de strings equivalente aos encurtadores de URLs
+"""
+import string
+import random
+#=====================================================================================
+def novocodigo():
+    '''Metodo que gera a chave alphanumerica sequencial'''
+    return "".join(random.sample(string.letters+string.digits, 8))

File encurtador/views.py

+# -*- coding: utf-8 -*-
+from django.shortcuts import redirect, render_to_response
+from django.template import RequestContext
+from django.utils import simplejson
+from django.http import HttpResponse
+from models import Links
+from util import novocodigo
+import re
+
+#Regular expression for validade URL
+url_re = re.compile('^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?') 
+
+def index(request):
+    return render_to_response( 'encurtador/encurtador.html', context_instance=RequestContext(request))
+
+def api(request):
+    global url_re
+    url = request.GET['url']
+    print url
+    if url:
+        if url_re.match(url):
+            if Links.objects.filter(url=url):
+                link = Links.objects.get(url=url)
+                l_msg="Acesse: <a href='http://berlotto.net/u/%s'>http://berlotto.net/u/%s</a>" % (link.short,link.short)
+                d = {'sucess':True, 'msg':l_msg, 'shorturl':"http://berlotto.net/u/%s" % link.short}
+            else:
+                codigo = novocodigo()
+                inserido = False
+                while not inserido: #Isto é para não gravar um mesmo código 2 ou mais vezes.
+                    if not Links.objects.filter(short=codigo):
+                        link = Links()
+                        link.url = url
+                        link.short = codigo
+                        link.acessos = 0
+                        link.save()
+                        inserido = True
+                        l_msg="Acesse: <a href='http://berlotto.net/u/%s'>http://berlotto.net/u/%s</a>" % (link.short,link.short)
+                        d = {'sucess':True, 'msg':l_msg, 'shorturl':"http://berlotto.net/u/%s" % link.short}
+                    else:
+                        codigo = novocodigo()
+        else:
+            l_msg = "A url informada é inválida!"
+            d = {'sucess':False, 'msg':l_msg, 'shorturl':""}
+    else:
+        d = {'sucess':False, 'msg':"Nenhume url informada!", 'shorturl':""}
+
+    return HttpResponse(simplejson.dumps(d), mimetype='application/javascript')
+
+def acessar(request,short):
+    link = Links.objects.get(short=short)
+    if(link):
+        link.acessos = link.acessos + 1
+        link.save()
+        return redirect(link) #chama o metodo get_absolute_url
+    else:
+        return render_to_response( 'encurtador/encurtador.html', {'msg':u'O código de acesso informado (%s) é incorreto e não foi encontrado!' % short} , context_instance=RequestContext(request))
+    
+def encurtar(request):
+    if request.method == 'POST':
+        
+        if Links.objects.filter(url=request.POST['url']):
+            link = Links.objects.get(url=request.POST['url'])
+            l_msg="Acesse: <a href='http://berlotto.net/u/%s'>http://berlotto.net/u/%s</a>" % (link.short,link.short)
+            return render_to_response('encurtador/encurtador.html', {'msg':l_msg}, context_instance=RequestContext(request) )
+        else:
+            codigo = novocodigo()
+            inserido = False
+            while not inserido: #Isto é para não gravar um mesmo código 2 ou mais vezes.
+                if not Links.objects.filter(short=codigo):
+                    link = Links()
+                    link.url = request.POST['url']
+                    link.short = codigo
+                    link.acessos = 0
+                    link.save()
+                    inserido = True
+                    l_msg="Acesse: <a href='http://berlotto.net/u/%s'>http://berlotto.net/u/%s</a>" % (link.short,link.short)
+                    return render_to_response('encurtador/encurtador.html', {'msg':l_msg}, context_instance=RequestContext(request) )
+                else:
+                    codigo = novocodigo() 
+    else:
+        return redirect('index')
+            
+
+def lista(request):
+    l = list(Links.objects.all())
+    return render_to_response('encurtador/listaurls.html', {'links':l}, context_instance=RequestContext(request) )

File imagens/__init__.py

Empty file added.

File imagens/admin.py

+from django.contrib import admin
+from models import Imagem
+
+class ImagensAdmin(admin.ModelAdmin):
+    #fileds       = ('slug', 'titulo', 'acessos','data')
+    list_display = ('slug', 'titulo', 'acessos', 'data')
+    
+admin.site.register(Imagem, ImagensAdmin)

File imagens/forms.py

+from django import forms
+
+class ImagensForm(forms.Form):
+    titulo    = forms.CharField(max_length=100)
+    descricao = forms.Textarea()
+    arquivo   = forms.ImageField()

File imagens/models.py

+from django.db import models
+from django.template.defaultfilters import slugify
+
+# Create your models here.
+class Imagem(models.Model):
+    
+    SITE='http://localhost:8000/'
+    
+    slug = models.SlugField(max_length=50)
+    titulo = models.CharField(max_length=100)
+    descricao = models.TextField(max_length=4000)
+    data = models.DateField(auto_now_add=True)
+    nome_arquivo = models.CharField(max_length=2000)
+    tipo = models.CharField(max_length=5)
+    acessos = models.IntegerField()
+    arquivo = models.ImageField(upload_to='shared')
+    
+    def save(self, *args, **kwargs):
+        self.slug = slugify(self.titulo)
+        super(Imagem, self).save(*args, **kwargs) 
+    
+    def __src__(self):
+        return self.slug
+    
+    def get_url(self):
+        return self.SITE+'imagem/'+self.slug
+    
+    def get_absolute_url(self):
+        return self.SITE+'static/shared/'+self.nome_arquivo
+    
+    class Meta:
+        db_table = 'imagens'
+    

File imagens/tests.py

+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+

File imagens/urls.py

+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+    (r'^upload/$','imagens.views.upload'),
+    (r'^lista/$','imagens.views.lista'),
+    (r'^(?P<slug>[-\d\w]+)/$','imagens.views.acessar'),
+    url(r'^$','imagens.views.index', name='index'),
+)

File imagens/views.py

+# -*- coding: utf-8 -*-
+from django.shortcuts import redirect, render_to_response
+from django.template import RequestContext
+from models import Imagem
+from forms import ImagensForm
+import os
+
+def index(request):
+    f = ImagensForm()
+    return render_to_response( 'imagem/imagem.html', {'form':f}, context_instance=RequestContext(request))
+
+def lista(request):
+    imagens = Imagem.objects.all().order_by('-data')
+    return render_to_response('imagem/lista.html', {'imagens':imagens}, context_instance=RequestContext(request))
+
+def upload(request):
+    arquivos = list()
+    if request.method == 'POST':
+        form = ImagensForm(request.POST, request.FILES)
+        if form.is_valid():
+            f = form.cleaned_data['arquivo']
+            filename = f.name
+            ext = os.path.splitext(filename)[1][1:].upper()
+            print filename
+            print ext
+            img = Imagem()
+            #img.descricao = request.POST['descricao']
+            img.titulo    = request.POST['titulo']
+            img.arquivo   = f
+            img.acessos   = 0
+            img.nome_arquivo = filename
+            img.tipo      = ext
+            img.save()
+            arquivos.append(img.get_absolute_url())
+            #Aqui salva o arquivo e retorna a mensagem com o link correto
+            return render_to_response( 'imagem/imagem.html', {'arquivo':img}, context_instance=RequestContext(request))
+        else:
+            print "Form Invalido"
+            return render_to_response( 'imagem/imagem.html', {'mgs':'Dados de envio inválidos!'}, context_instance=RequestContext(request))
+    else:
+        return render_to_response( 'imagem/imagem.html', context_instance=RequestContext(request))
+    
+def acessar(request, slug):
+    #aqui adiciona +1 no numero de acessos e retorna a página com a imagem
+    imagem = Imagem.objects.get(slug=slug)
+    return render_to_response( 'imagem/viewimagem.html', {'img':imagem}, context_instance=RequestContext(request))
+#!/usr/bin/env python2
+from django.core.management import execute_manager
+try:
+    import settings # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+    sys.exit(1)
+
+if __name__ == "__main__":
+    execute_manager(settings)
+# -*- coding: utf-8 -*-
+# Django settings for berlottonet project.
+import os
+#import django
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+     ('Admin Name', 'admin@email.com'),
+)
+
+#DJANGO_ROOT=os.path.dirname(os.path.realpath(django.__file__))
+SITE_ROOT=os.path.dirname(os.path.realpath(__file__))
+
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default':{
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'database.db',                      # Or path to database file if using sqlite3.
+        'USER': '',                      # Not used with sqlite3.
+        'PASSWORD': '',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+    }
+}
+
+FILE_UPLOAD_MAX_MEMORY_SIZE=10240 #10mb
+#FILE_UPLOAD_TEMP_DIR=/tmp #default system temp /tmp
+#FILE_UPLOAD_PERMISSIONS=0644 #default 0644
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Sao_Paulo'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'pt-BR'
+
+SITE_ID = 1
+
+#CACHE_BACKEND = 'file:///tmp/django_cache?timeout=10800&max_entries=1000'
+#CACHE_BACKEND = 'locmem://'
+CACHE_BACKEND = 'dummy://'
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = False
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = os.path.join(SITE_ROOT,'static_files')
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = 'http://localhost:8000/static/'
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '@)FJ@ORINF(@*)TU%N%TH)U%(%$#$I@_2952rwjf09j3@)(%)@'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.cache.UpdateCacheMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.cache.FetchFromCacheMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'berlottonet.urls'
+
+TEMPLATE_DIRS = (
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+    os.path.join(SITE_ROOT,'templates')
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    # Uncomment the next line to enable the admin:
+    'django.contrib.admin',
+    'encurtador', #Meu encurtador de URL
+    'website',    #O site propriamente dito
+    'imagens',    #Share de imagens
+)

File settings.py~

+# -*- coding: utf-8 -*-
+# Django settings for berlottonet project.
+import os
+#import django
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+     ('Sergio Berlotto', 'sergio@berlotto.net'),
+)
+
+#DJANGO_ROOT=os.path.dirname(os.path.realpath(django.__file__))
+SITE_ROOT=os.path.dirname(os.path.realpath(__file__))
+
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default':{
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'database.db',                      # Or path to database file if using sqlite3.
+        'USER': '',                      # Not used with sqlite3.
+        'PASSWORD': '',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+    },
+    'remoto': {
+        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'berlo352_news',                      # Or path to database file if using sqlite3.
+        'USER': 'berlo352_news',                      # Not used with sqlite3.
+        'PASSWORD': 'sxdcrftg6y7u',                  # Not used with sqlite3.
+        'HOST': 'berlotto.net',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
+    },
+    'production': {
+        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'berlo352_news',                      # Or path to database file if using sqlite3.
+        'USER': 'berlo352_news',                      # Not used with sqlite3.
+        'PASSWORD': 'sxdcrftg6y7u',                  # Not used with sqlite3.
+        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
+    }
+}
+
+FILE_UPLOAD_MAX_MEMORY_SIZE=10240 #10mb
+#FILE_UPLOAD_TEMP_DIR=/tmp #default system temp /tmp
+#FILE_UPLOAD_PERMISSIONS=0644 #default 0644
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Sao_Paulo'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'pt-BR'
+
+SITE_ID = 1
+
+#CACHE_BACKEND = 'file:///tmp/django_cache?timeout=10800&max_entries=1000'
+#CACHE_BACKEND = 'locmem://'
+CACHE_BACKEND = 'dummy://'
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = False
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = os.path.join(SITE_ROOT,'static_files')
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = 'http://localhost:8000/static/'
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '@1nj%yp+-cgf6zmuu#%_p%ge6y@1!*@qimux!-bpk=frt$inkl'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.cache.UpdateCacheMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.cache.FetchFromCacheMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'berlottonet.urls'
+
+TEMPLATE_DIRS = (
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+    os.path.join(SITE_ROOT,'templates')
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    # Uncomment the next line to enable the admin:
+    'django.contrib.admin',
+    'encurtador', #Meu encurtador de URL
+    'website',    #O site propriamente dito
+    'imagens',    #Share de imagens
+)

File static_files/css/menu.css

+ul.topnav {
+	list-style: none;
+	padding: 0 20px;
+	margin: auto;
+	width: 891px;
+	height: 30px;
+	background: #222;
+	font-size: 1.2em;
+	background: url(../img/topnav_bg.gif) repeat-x;
+}
+ul.topnav li {
+	float: left;
+	margin: 0;
+	padding: 0 15px 0 0;
+	position: relative; /*--Declare X and Y axis base for sub navigation--*/
+}
+ul.topnav li a{
+	padding: 10px 5px;
+	color: #fff;
+	display: block;
+	text-decoration: none;
+	float: left;
+      font: 10px normal Arial, Helvetica, sans-serif;
+}
+ul.topnav li a:hover{
+	background: url(../img/topnav_hover.gif) no-repeat center top;
+}
+ul.topnav li span { /*--Drop down trigger styles--*/
+	width: 17px;
+	height: 35px;
+	float: left;
+	background: url(../img/subnav_btn.gif) no-repeat center top;
+}
+ul.topnav li span.subhover {background-position: center bottom; cursor: pointer;} /*--Hover effect for trigger--*/
+ul.topnav li ul.subnav {
+	list-style: none;
+	position: absolute; /*--Important - Keeps subnav from affecting main navigation flow--*/
+	left: 0; top: 35px;
+	background: #333;
+	margin: 0; padding: 0;
+	display: none;
+	float: left;
+	width: 170px;
+-moz-border-radius-bottomleft: 5px;
+	-moz-border-radius-bottomright: 5px;
+	-webkit-border-bottom-left-radius: 5px;
+	-webkit-border-bottom-right-radius: 5px;
+	border: 1px solid #111;
+}
+ul.topnav li ul.subnav li{
+	margin: 0; padding: 0;
+	border-top: 1px solid #252525; /*--Create bevel effect--*/
+	border-bottom: 1px solid #444; /*--Create bevel effect--*/
+	clear: both;
+	width: 170px;
+}
+html ul.topnav li ul.subnav li a {
+	float: left;
+	width: 145px;
+	background: #333 url(../img/dropdown_linkbg.gif) no-repeat 10px center;
+	padding-left: 20px;
+}
+html ul.topnav li ul.subnav li a:hover { /*--Hover effect for subnav links--*/
+	background: #222 url(../img/dropdown_linkbg.gif) no-repeat 10px center;
+}

File static_files/css/reset.css

+/* http://meyerweb.com/eric/tools/css/reset/ 
+   v2.0 | 20110126
+      License: none (public domain)
+      */
+
+html body div span applet object iframe
+h1 h2 h3 h4 h5 h6 p blockquote pre
+a abbr acronym address big cite code
+del dfn em img ins kbd q s samp
+small strike strong sub sup tt var
+b u i center
+dl dt dd ol ul li
+fieldset form label legend
+table caption tbody tfoot thead tr th td
+article aside canvas details embed 
+figure figcaption footer header hgroup 
+menu nav output ruby section summary
+time mark audio video {
+  margin: 0;
+    padding: 0;
+      border: 0;
+        font-size: 100%;
+          font: inherit;
+            vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article aside details figcaption figure 
+footer header hgroup menu nav section {
+  display: block;
+}
+body {
+  line-height: 1;
+}
+ol ul {
+  list-style: none;
+}
+blockquote q {
+  quotes: none;
+}
+blockquote:before blockquote:after
+q:before q:after {
+  content: '';
+    content: none;
+}
+table {
+  border-collapse: collapse;
+    border-spacing: 0;
+}

File static_files/css/screen.css

+body { 
+  padding: 0px;
+  margin: 0px;
+  background: #DDD url(../img/body_bg.gif) repeat-x;
+  font: 0.8em/1.5 "arial",sans-serif; 
+  color: #354146; 
+  text-align: center; 
+}
+
+/* obecne odkazy --------------------------------------------------------------- */
+a {color:#1666a3;}
+a:link {color:#1666a3;}
+a:hover {color:#0b4775;}
+
+/* nadpisy --------------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 { margin:15px 0 10px 0; }
+h1 { font-size:200%; font-family: Georgia;}
+h1#logo a{color: #ced1d2; text-decoration: none; display: block;padding: 25px 0; font-weight: normal; }
+h1#logo a:hover{color: #fff;}
+h2 { font-size:130%; color: #354146;font-weight: bold; padding: 0;margin:0; }
+h3 { font-size:120%; }
+h4 { font-size:120%; }
+h5 { font-size:100%; }
+
+/* layout ---------------------------------------------------------------------- */
+#layout { 
+  text-align:left; 
+}
+  #container { 
+    clear: both;
+    background: url("../img/body-fundo.jpg");
+
+  }
+  #intro{
+    background: #e6e8e9;height: auto;
+    border-bottom: 1px solid lightgray;
+  }
+  #intro-in{
+    width:891px; 
+    margin:0 auto; 
+    padding: 10px 0;
+  }
+
+  	/* hlavicka ------------------------------------------------------------------ */
+  	#header {
+  	  width:891px; 
+      margin: 0 auto ; 
+      /*margin-top: -20px; / *retirar este item caso fique deslocado para cima*/
+      height: 120px;
+      }
+    #header h1{ margin: 0; } 
+      
+        
+    /* horizontalni navigace --------------------------------------------------- */
+      #nav {
+      	width:891px;
+      	
+      	position: relative;
+      	top: 0px; 
+      	margin: 0 auto; 
+      }
+/*
+      #nav ul {margin:0; padding:0; list-style:none;height: 35px;}
+      	#nav ul li {float:left; display:block; margin:0; padding:0;}
+      	#nav ul li a {
+          display: block; 
+          float: left;
+          font-size: 85%;
+          color: #fff;
+          text-decoration: none;
+          padding: 12px 20px 10px;
+          text-align: center;
+
+        }
+        #nav ul li a:hover {
+          color: #ced1d2;
+          text-decoration: underline;
+        }
+      	#nav ul li#active a {
+      	color: #101517;
+      	border: 1px solid #fff;border-bottom:1px solid #e6e8e9;
+        background:#e6e8e9; text-decoration:none;}
+  
+  */
+  
+    .content {
+      padding: 0 0 0 0;
+      z-index: 10;
+      width:891px; 
+      margin:0 auto; 
+       
+    }
+    .content .in{
+      padding: 20px 0 30px;
+    }
+    p.intro{
+      background: url("../img/line.jpg");
+      line-height: 23px;
+      margin:0 0 0;
+    }
+    #mainfooter{
+      background: url("../img/body-fundo.jpg");
+    }
+    .shadow{
+      border-top: 1px solid #dddddd;
+      padding: 10px 0;
+      background: url("../img/body-fundo.jpg");
+    }
+    img.thumb{padding: 3px; background: #fff; border: 1px solid #d1d1d1; margin-top: -10px;}
+    
+    .columns {list-style: none;margin:10px 0 0 0;padding:0; font-size: 90%;}
+    .columns li{float: left; width: 32%;}
+    .columns li.col2{border-left: 1px solid #d7d7d7; background-color: transparent; width: 600px;}
+    .columns li h3{padding: 0 10px;color: #2e4650; margin: 0 0 5px;}
+    .columns li.col2 h3{padding-left: 20px;}
+    .columns li p{line-height: 22px;padding: 0 20px 0 10px; margin: 0; color: #3f4345;}
+    .columns li.col2 p{padding: 0 20px 0 20px;}
+    .columns li a.more{display: block;color: #1666a3;padding: 5px 0;}
+    .columns li a.more:hover{color: #0b4775; text-decoration: none;}
+
+  
+  
+  	/* paticka ----------------------------------------------------------------- */
+  	#footer {
+  	  width:891px; 
+      margin:0 auto;
+      clear:both;
+      font-size: 85%;
+      padding-bottom: 70px;
+      color: #898989;
+    }
+    #footer a{color: #898989;}
+    #footer a:hover{color: #666666; text-decoration: none;}
+      #footer .f-left, #footer .f-right { padding: 0 10px; }
+
+
+
+
+/* odstavce -------------------------------------------------------------------- */
+p { margin:15px 0; }
+
+/* tabulky --------------------------------------------------------------------- */
+table { margin:15px 0; border-collapse:collapse; border-spacing:0; font-size:100%; }
+th { text-align:center; font-weight:bold; }
+th, td { padding:3px 5px; }
+
+/* seznamy --------------------------------------------------------------------- */
+ul, ol { display:block; margin:15px 0 15px 40px; }
+ul ul, ul ul ul, ol ol, ol ol ol { margin:0; margin-left:20px; }
+ol { list-style-type:decimal; }
+ol ol { list-style-type:upper-alpha; }
+ol ol ol {list-style-type:lower-alpha; }
+li { display:list-item; }
+ul li a { text-decoration:underline; }
+
+/* definice -------------------------------------------------------------------- */
+dl { margin:15px 0; }
+dt { font-weight:bold; }
+dd { margin-left:30px; }
+
+/* ostatni --------------------------------------------------------------------- */
+fieldset { margin:15px 0; padding:10px; border:1px solid #CCC; }
+legend { margin-left:10px; font-size:100%; font-weight:bold; color:#000; }
+abbr, acronym, .help { border-bottom:1px dotted #CCC; cursor:help; }
+blockquote { margin:15px 20px; font-style:italic; }
+del, .del { text-decoration:line-through; }
+strong, .strong { font-weight:bold; }
+cite, em, q, var { font-style:italic; }
+code, kbd, samp  {font-family:monospace; font-size:110%; }
+hr { display:block; height:1px; margin:10px 0; padding:0; border:0 solid #CCC; background:#CCC; color:#CCC;} 
+.f-left {float:left;}
+.f-right {float:right;}
+.a-left, tr.a-left td {text-align:left;}
+.a-center, tr.a-center td {text-align:center;}
+.a-right, tr.a-right td {text-align:right;}
+.a-justify {text-align:justify;}
+.va-top {vertical-align:top;}
+.va-middle {vertical-align:middle;}
+.va-bottom {vertical-align:bottom;}
+.clear { clear:both; }
+.box { min-height:1px; }
+.box:after { display:block; visibility:hidden; clear:both; line-height:0; font-size:0; content:"."; }
+.noscreen { display:none; }
+.mleft10 { margin-left: 10px; }
+.mright10 { margin-right: 10px; }
+.mtop10 { margin-top: 10px; }
+.mbottom10 { margin-bottom: 10px; }
+
+/* univerzalni prvky ------------------------------------------------------------ */
+input.small{
+  width: 50px;
+}
+input.normal{
+  width: 146px;
+}
+.bigger {font-size:115%;}
+.smaller {font-size:85%;}
+
+.high {color:#00F;}
+.nonhigh {color:#777;}
+
+.foto{  display: block; border: 3px solid #ddd;}
+.icones{ text-align: center; margin-top: 6px; }
+.icones img{  margin: 0px 5px; }
+.livro { text-align: center; float: left;}
+.lefttext { text-align: center;}
+.newslivro { text-align: justify; margin-left: 10px;margin-bottom:5px; float: left; background-color: transparent ; width: 510px; height: 540px; margin-top: -10px; overflow-y: scroll;}
+.text{ margin-left: 15px; }
+.newslivro h3, .newsbox h3{ background: url(../img/news.png) no-repeat; padding-left: 30px; }
+                 /*top right bottom left*/
+.newsbox{ margin: -5px 10px 10px 5px;}
+.newsbox h3{ padding-left: 30px !important; }
+span.time{ font-style: italic; text-align: right; }
+
+form label { position: absolute; text-align:right; width:80px; font-weight: bold; }
+form input, textarea { margin-left: 90px; }
+form label.check, form label.radio { position:relative; text-align:left; }
+form { outline: 1px dashed #d5d5d5; padding-top: 10px; padding-bottom: 10px;}
+
+#id_titulo{ width: 600px; }

File static_files/css/screen.css~

+body { 
+  padding: 0px;
+  margin: 0px;
+  background: #DDD url(../img/body_bg.gif) repeat-x;
+  font: 0.8em/1.5 "arial",sans-serif; 
+  color: #354146; 
+  text-align: center; 
+}
+
+/* obecne odkazy --------------------------------------------------------------- */
+a {color:#1666a3;}
+a:link {color:#1666a3;}
+a:hover {color:#0b4775;}
+
+/* nadpisy --------------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 { margin:15px 0 10px 0; }
+h1 { font-size:200%; font-family: Georgia;}
+h1#logo a{color: #ced1d2; text-decoration: none; display: block;padding: 25px 0; font-weight: normal; }
+h1#logo a:hover{color: #fff;}
+h2 { font-size:130%; color: #354146;font-weight: bold; padding: 0;margin:0; }
+h3 { font-size:120%; }
+h4 { font-size:120%; }
+h5 { font-size:100%; }
+
+/* layout ---------------------------------------------------------------------- */
+#layout { 
+  text-align:left; 
+}
+  #container { 
+    clear: both;
+    background: url("../img/body-fundo.jpg");
+
+  }
+  #intro{
+    background: #e6e8e9;height: auto;
+    border-bottom: 1px solid lightgray;
+  }
+  #intro-in{
+    width:891px; 
+    margin:0 auto; 
+    padding: 10px 0;
+  }
+
+  	/* hlavicka ------------------------------------------------------------------ */
+  	#header {
+  	  width:891px; 
+      margin: 0 auto ; 
+      /*margin-top: -20px; / *retirar este item caso fique deslocado para cima*/
+      height: 120px;
+      }
+    #header h1{ margin: 0; } 
+      
+        
+    /* horizontalni navigace --------------------------------------------------- */
+      #nav {
+      	width:891px;
+      	
+      	position: relative;
+      	top: 0px; 
+      	margin: 0 auto; 
+      }
+/*
+      #nav ul {margin:0; padding:0; list-style:none;height: 35px;}
+      	#nav ul li {float:left; display:block; margin:0; padding:0;}
+      	#nav ul li a {
+          display: block; 
+          float: left;
+          font-size: 85%;
+          color: #fff;
+          text-decoration: none;
+          padding: 12px 20px 10px;
+          text-align: center;
+
+        }
+        #nav ul li a:hover {
+          color: #ced1d2;
+          text-decoration: underline;
+        }
+      	#nav ul li#active a {
+      	color: #101517;
+      	border: 1px solid #fff;border-bottom:1px solid #e6e8e9;
+        background:#e6e8e9; text-decoration:none;}
+  
+  */
+  
+    .content {
+      padding: 0 0 0 0;
+      z-index: 10;
+      width:891px; 
+      margin:0 auto; 
+       
+    }
+    .content .in{
+      padding: 20px 0 30px;
+    }
+    p.intro{
+      background: url("../img/line.jpg");
+      line-height: 23px;
+      margin:0 0 0;
+    }
+    #mainfooter{
+      background: url("../img/body-fundo.jpg");
+    }
+    .shadow{
+      border-top: 1px solid #dddddd;
+      padding: 10px 0;
+      background: url("../img/body-fundo.jpg");
+    }
+    img.thumb{padding: 3px; background: #fff; border: 1px solid #d1d1d1; margin-top: -10px;}
+    
+    .columns {list-style: none;margin:10px 0 0 0;padding:0; font-size: 90%;}
+    .columns li{float: left; width: 32%;}
+    .columns li.col2{border-left: 1px solid #d7d7d7; background-color: transparent; width: 600px;}
+    .columns li h3{padding: 0 10px;color: #2e4650; margin: 0 0 5px;}
+    .columns li.col2 h3{padding-left: 20px;}
+    .columns li p{line-height: 22px;padding: 0 20px 0 10px; margin: 0; color: #3f4345;}
+    .columns li.col2 p{padding: 0 20px 0 20px;}
+    .columns li a.more{display: block;color: #1666a3;padding: 5px 0;}
+    .columns li a.more:hover{color: #0b4775; text-decoration: none;}
+
+  
+  
+  	/* paticka ----------------------------------------------------------------- */
+  	#footer {
+  	  width:891px; 
+      margin:0 auto;
+      clear:both;
+      font-size: 85%;
+      padding-bottom: 70px;
+      color: #898989;
+    }
+    #footer a{color: #898989;}
+    #footer a:hover{color: #666666; text-decoration: none;}
+      #footer .f-left, #footer .f-right { padding: 0 10px; }
+
+
+
+
+/* odstavce -------------------------------------------------------------------- */
+p { margin:15px 0; }
+
+/* tabulky --------------------------------------------------------------------- */
+table { margin:15px 0; border-collapse:collapse; border-spacing:0; font-size:100%; }
+th { text-align:center; font-weight:bold; }
+th, td { padding:3px 5px; }
+
+/* seznamy --------------------------------------------------------------------- */
+ul, ol { display:block; margin:15px 0 15px 40px; }
+ul ul, ul ul ul, ol ol, ol ol ol { margin:0; margin-left:20px; }
+ol { list-style-type:decimal; }
+ol ol { list-style-type:upper-alpha; }
+ol ol ol {list-style-type:lower-alpha; }
+li { display:list-item; }
+ul li a { text-decoration:underline; }
+
+/* definice -------------------------------------------------------------------- */
+dl { margin:15px 0; }
+dt { font-weight:bold; }
+dd { margin-left:30px; }
+
+/* ostatni --------------------------------------------------------------------- */
+fieldset { margin:15px 0; padding:10px; border:1px solid #CCC; }
+legend { margin-left:10px; font-size:100%; font-weight:bold; color:#000; }
+abbr, acronym, .help { border-bottom:1px dotted #CCC; cursor:help; }
+blockquote { margin:15px 20px; font-style:italic; }
+del, .del { text-decoration:line-through; }
+strong, .strong { font-weight:bold; }
+cite, em, q, var { font-style:italic; }
+code, kbd, samp  {font-family:monospace; font-size:110%; }
+hr { display:block; height:1px; margin:10px 0; padding:0; border:0 solid #CCC; background:#CCC; color:#CCC;} 
+.f-left {float:left;}
+.f-right {float:right;}
+.a-left, tr.a-left td {text-align:left;}
+.a-center, tr.a-center td {text-align:center;}
+.a-right, tr.a-right td {text-align:right;}
+.a-justify {text-align:justify;}
+.va-top {vertical-align:top;}
+.va-middle {vertical-align:middle;}
+.va-bottom {vertical-align:bottom;}
+.clear { clear:both; }
+.box { min-height:1px; }
+.box:after { display:block; visibility:hidden; clear:both; line-height:0; font-size:0; content:"."; }
+.noscreen { display:none; }
+.mleft10 { margin-left: 10px; }
+.mright10 { margin-right: 10px; }
+.mtop10 { margin-top: 10px; }
+.mbottom10 { margin-bottom: 10px; }
+
+/* univerzalni prvky ------------------------------------------------------------ */
+input.small{
+  width: 50px;
+}
+input.normal{
+  width: 146px;
+}
+.bigger {font-size:115%;}
+.smaller {font-size:85%;}
+
+.high {color:#00F;}
+.nonhigh {color:#777;}
+
+.foto{  display: block; border: 3px solid #ddd;}
+.icones{ text-align: center; margin-top: 6px; }
+.icones img{  margin: 0px 5px; }
+.livro { text-align: center; float: left;}
+.lefttext { text-align: center;}
+.newslivro { text-align: justify; margin-left: 10px;margin-bottom:5px; float: left; background-color: transparent ; width: 510px; height: 540px; margin-top: -10px; overflow-y: scroll;}
+.text{ margin-left: 15px; }
+.newslivro h3, .newsbox h3{ background: url(../img/news.png) no-repeat; padding-left: 30px; }
+                 /*top right bottom left*/
+.newsbox{ margin: -5px 10px 10px 5px;}
+.newsbox h3{ padding-left: 30px !important; }
+span.time{ font-style: italic; text-align: right; }
+
+form label { position: absolute; text-align:right; width:80px; font-weight: bold; }
+form input, textarea { margin-left: 90px; }
+form label.check, form label.radio { position:relative; text-align:left; }
+form { outline: 1px dashed #d5d5d5; padding-top: 10px; padding-bottom: 10px;}
+
+#id_titulo{ width: 600px; }

File static_files/galleria/LICENSE

+The MIT License
+
+Copyright (c) 2011 Aino http://aino.se
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

File static_files/galleria/galleria-1.2.5.min.js

+/*
+ Galleria v 1.2.5 2011-08-03
+ http://galleria.aino.se
+
+ Copyright (c) 2011, Aino
+ Licensed under the MIT license.
+*/
+(function(e){var l=this,n=l.document,H=e(n),t=e(l),A=!0,B=3E4,C=!1,x=navigator.userAgent.toLowerCase(),I=l.location.hash.replace(/#\//,""),m=function(){var a=3,b=n.createElement("div"),d=b.getElementsByTagName("i");do b.innerHTML="<\!--[if gt IE "+ ++a+"]><i></i><![endif]--\>";while(d[0]);return a>4?a:void 0}(),u=function(){return{html:n.documentElement,body:n.body,head:n.getElementsByTagName("head")[0],title:n.title}},J=function(){var a=[];e.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "),
+function(b,d){a.push(d);/_/.test(d)&&a.push(d.replace(/_/g,""))});return a}(),K=function(a){var b;if(typeof a!=="object")return a;e.each(a,function(d,c){/^[a-z]+_/.test(d)&&(b="",e.each(d.split("_"),function(a,c){b+=a>0?c.substr(0,1).toUpperCase()+c.substr(1):c}),a[b]=c,delete a[d])});return a},D=function(a){return e.inArray(a,J)>-1?Galleria[a.toUpperCase()]:a},v={trunk:{},add:function(a,b,d,c){c=c||!1;this.clear(a);if(c)var e=b,b=function(){e();v.add(a,b,d)};this.trunk[a]=l.setTimeout(b,d)},clear:function(a){var b=
+function(a){l.clearTimeout(this.trunk[a]);delete this.trunk[a]},d;if(a&&a in this.trunk)b.call(v,a);else if(typeof a==="undefined")for(d in this.trunk)this.trunk.hasOwnProperty(d)&&b.call(v,d)}},z=[],y=[],L=!1,s=!1,M=[],E=function(a){Galleria.theme=a;e.each(M,function(a,d){d._init.call(d)})},f=function(){return{array:function(a){return Array.prototype.slice.call(a,0)},create:function(a,b){var d=n.createElement(b||"div");d.className=a;return d},getScriptPath:function(a){a=a||e("script:last").attr("src");
+a=a.split("/");if(a.length==1)return"";a.pop();return a.join("/")+"/"},animate:function(){var a=function(a){var b="transition WebkitTransition MozTransition OTransition".split(" "),c;if(l.opera)return!1;for(c=0;b[c];c++)if(typeof a[b[c]]!=="undefined")return b[c];return!1}((n.body||n.documentElement).style),b={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[a],d={_default:[0.25,0.1,0.25,1],galleria:[0.645,0.045,0.355,1],
+galleriaIn:[0.55,0.085,0.68,0.53],galleriaOut:[0.25,0.46,0.45,0.94],ease:[0.25,0,0.25,1],linear:[0.25,0.25,0.75,0.75],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},c=function(a,b,c){var d={},c=c||"transition";e.each("webkit moz ms o".split(" "),function(){d["-"+this+"-"+c]=b});a.css(d)},i=function(a){c(a,"none","transition");Galleria.WEBKIT&&Galleria.TOUCH&&(c(a,"translate3d(0,0,0)","transform"),a.data("revert")&&(a.css(a.data("revert")),a.data("revert",null)))},j,
+h,g,k,p,w,F;return function(o,q,r){r=e.extend({duration:400,complete:function(){},stop:!1},r);o=e(o);r.duration?a?(r.stop&&(o.unbind(b),i(o)),j=!1,e.each(q,function(a,b){F=o.css(a);f.parseValue(F)!=f.parseValue(b)&&(j=!0);o.css(a,F)}),j?(h=[],g=r.easing in d?d[r.easing]:d._default,k=" "+r.duration+"ms cubic-bezier("+g.join(",")+")",l.setTimeout(function(){o.one(b,function(a){return function(){i(a);r.complete.call(a[0])}}(o));if(Galleria.WEBKIT&&Galleria.TOUCH&&(p={},w=[0,0,0],e.each(["left","top"],
+function(a,b){b in q&&(w[a]=f.parseValue(q[b])-f.parseValue(o.css(b))+"px",p[b]=q[b],delete q[b])}),w[0]||w[1]))o.data("revert",p),h.push("-webkit-transform"+k),c(o,"translate3d("+w.join(",")+")","transform");e.each(q,function(a){h.push(a+k)});c(o,h.join(","));o.css(q)},1)):l.setTimeout(function(){r.complete.call(o[0])},r.duration)):o.animate(q,r):(o.css(q),r.complete.call(o[0]))}}(),removeAlpha:function(a){if(m<9&&a){var b=a.style,a=(a=a.currentStyle)&&a.filter||b.filter||"";if(/alpha/.test(a))b.filter=
+a.replace(/alpha\([^)]*\)/i,"")}},forceStyles:function(a,b){a=e(a);a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style");a.css(b)},revertStyles:function(){e.each(f.array(arguments),function(a,b){b=e(b);b.removeAttr("style");b.attr("style","");b.data("styles")&&b.attr("style",b.data("styles")).data("styles",null)})},moveOut:function(a){f.forceStyles(a,{position:"absolute",left:-1E4})},moveIn:function(){f.revertStyles.apply(f,f.array(arguments))},elem:function(a){return a instanceof
+e?{$:a,dom:a[0]}:{$:e(a),dom:a}},hide:function(a,b,d){var d=d||function(){},c=f.elem(a),e=c.$,a=c.dom;e.data("opacity")||e.data("opacity",e.css("opacity"));c={opacity:0};b?f.animate(a,c,{duration:b,complete:m<9&&a?function(){f.removeAlpha(a);a.style.visibility="hidden";d.call(a)}:d,stop:!0}):m<9&&a?(f.removeAlpha(a),a.style.visibility="hidden"):e.css(c)},show:function(a,b,d){var d=d||function(){},c=f.elem(a),e=c.$,a=c.dom,j={opacity:parseFloat(e.data("opacity"))||1};if(b){if(m<9)e.css("opacity",0),
+a.style.visibility="visible";f.animate(a,j,{duration:b,complete:m<9&&a?function(){j.opacity==1&&f.removeAlpha(a);d.call(a)}:d,stop:!0})}else m<9&&j.opacity==1&&a?(f.removeAlpha(a),a.style.visibility="visible"):e.css(j)},optimizeTouch:function(){var a,b,d,c,f={},j=function(a){a.preventDefault();f=e.extend({},a,!0)},h=function(){this.evt=f},g=function(){this.handler.call(a,this.evt)};return function(k){e(k).bind("touchend",function(k){a=k.target;for(c=!0;a.parentNode&&a!=k.currentTarget&&c;)b=e(a).data("events"),
+d=e(a).data("fakes"),b&&"click"in b?(c=!1,k.preventDefault(),e(a).click(j).click(),b.click.pop(),e.each(b.click,h),e(a).data("fakes",b.click),delete b.click):d&&(c=!1,k.preventDefault(),e.each(d,g)),a=a.parentNode})}}(),addTimer:function(){v.add.apply(v,f.array(arguments));return this},clearTimer:function(){v.clear.apply(v,f.array(arguments));return this},wait:function(a){var a=e.extend({until:function(){return!1},success:function(){},error:function(){Galleria.raise("Could not complete wait function.")},
+timeout:3E3},a),b=f.timestamp(),d,c,i=function(){c=f.timestamp();d=c-b;if(a.until(d))return a.success(),!1;if(c>=b+a.timeout)return a.error(),!1;l.setTimeout(i,10)};l.setTimeout(i,10)},toggleQuality:function(a,b){if(!(m!==7&&m!==8)&&a)typeof b==="undefined"&&(b=a.style.msInterpolationMode==="nearest-neighbor"),a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor"},insertStyleTag:function(a){var b=n.createElement("style");u().head.appendChild(b);b.styleSheet?b.styleSheet.cssText=a:(a=n.createTextNode(a),
+b.appendChild(a))},loadScript:function(a,b){var d=!1,c=e("<script>").attr({src:a,async:!0}).get(0);c.onload=c.onreadystatechange=function(){if(!d&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"))d=!0,c.onload=c.onreadystatechange=null,typeof b==="function"&&b.call(this,this)};u().head.appendChild(c)},parseValue:function(a){return typeof a==="number"?a:typeof a==="string"?(a=a.match(/\-?\d|\./g))&&a.constructor===Array?a.join("")*1:0:0},timestamp:function(){return(new Date).getTime()},
+loadCSS:function(a,b,d){var c,i=!1,j;e("link[rel=stylesheet]").each(function(){if(RegExp(a).test(this.href))return c=this,!1});typeof b==="function"&&(d=b,b=void 0);d=d||function(){};if(c)return d.call(c,c),c;j=n.styleSheets.length;A&&(a+="?"+f.timestamp());e("#"+b).length?(e("#"+b).attr("href",a),j--,i=!0):(c=e("<link>").attr({rel:"stylesheet",href:a,id:b}).get(0),l.setTimeout(function(){var b=e('link[rel="stylesheet"], style');b.length?b.get(0).parentNode.insertBefore(c,b[0]):u().head.appendChild(c);
+m?j>=31?Galleria.raise("You have reached the browser stylesheet limit (31)",!0):c.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"))i=!0}:/file:\/\//i.test(a)?i=!0:e.ajax({url:a,success:function(){i=!0},error:function(a){a.isRejected()&&Galleria.WEBKIT&&(i=!0)}})},10));typeof d==="function"&&f.wait({until:function(){return i&&n.styleSheets.length>j},success:function(){l.setTimeout(function(){d.call(c,c)},100)},error:function(){Galleria.raise("Theme CSS could not load",
+!0)},timeout:1E4});return c}}}(),G=function(){var a=function(a,d,c,i){var j=this.getOptions("easing"),h=this.getStageWidth(),g={left:h*(a.rewind?-1:1)},k={left:0};if(c)g.opacity=0,k.opacity=1;e(a.next).css(g);f.animate(a.next,k,{duration:a.speed,complete:function(a){return function(){d();a.css({left:0})}}(e(a.next).add(a.prev)),queue:!1,easing:j});if(i)a.rewind=!a.rewind;if(a.prev){g={left:0};k={left:h*(a.rewind?1:-1)};if(c)g.opacity=1,k.opacity=0;e(a.prev).css(g);f.animate(a.prev,k,{duration:a.speed,
+queue:!1,easing:j,complete:function(){e(this).css("opacity",0)}})}};return{fade:function(a,d){e(a.next).css("opacity",0).show();f.animate(a.next,{opacity:1},{duration:a.speed,complete:d});a.prev&&(e(a.prev).css("opacity",1).show(),f.animate(a.prev,{opacity:0},{duration:a.speed}))},flash:function(a,d){e(a.next).css("opacity",0);a.prev?f.animate(a.prev,{opacity:0},{duration:a.speed/2,complete:function(){f.animate(a.next,{opacity:1},{duration:a.speed,complete:d})}}):f.animate(a.next,{opacity:1},{duration:a.speed,
+complete:d})},pulse:function(a,d){a.prev&&e(a.prev).hide();e(a.next).css("opacity",0).show();f.animate(a.next,{opacity:1},{duration:a.speed,complete:d})},slide:function(b,d){a.apply(this,f.array(arguments))},fadeslide:function(b,d){a.apply(this,f.array(arguments).concat([!0]))},doorslide:function(b,d){a.apply(this,f.array(arguments).concat([!1,!0]))}}}();Galleria=function(){var a=this;this._theme=void 0;this._options={};this._playing=!1;this._playtime=5E3;this._active=null;this._queue={length:0};
+this._data=[];this._dom={};this._thumbnails=[];this._layers=[];this._firstrun=this._initialized=!1;this._stageHeight=this._stageWidth=0;this._target=void 0;this._id=Math.random();e.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(b,c){a._dom[c]=f.create("galleria-"+c)});e.each("current total".split(" "),function(b,
+c){a._dom[c]=f.create("galleria-"+c,"span")});var b=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(c){var d=c.keyCode||c.which;d in b.map&&typeof b.map[d]==="function"&&b.map[d].call(a,c)},attach:function(a){var c,d;for(c in a)a.hasOwnProperty(c)&&(d=c.toUpperCase(),d in b.keys?b.map[b.keys[d]]=a[c]:b.map[d]=a[c]);if(!b.bound)b.bound=!0,H.bind("keydown",b.press)},detach:function(){b.bound=!1;b.map={};H.unbind("keydown",
+b.press)}},d=this._controls={0:void 0,1:void 0,active:0,swap:function(){d.active=d.active?0:1},getActive:function(){return d[d.active]},getNext:function(){return d[1-d.active]}},c=this._carousel={next:a.$("thumb-nav-right"),prev:a.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var b=0,d=0,f=[0];e.each(a._thumbnails,function(a,c){c.ready&&(b+=c.outerWidth||e(c.container).outerWidth(!0),f[a+1]=b,d=Math.max(d,c.outerHeight||e(c.container).outerHeight(!0)))});a.$("thumbnails").css({width:b,
+height:d});c.max=b;c.hooks=f;c.width=a.$("thumbnails-list").width();c.setClasses();a.$("thumbnails-container").toggleClass("galleria-carousel",b>c.width);c.width=a.$("thumbnails-list").width()},bindControls:function(){var b;c.next.bind("click",function(d){d.preventDefault();if(a._options.carouselSteps==="auto")for(b=c.current;b<c.hooks.length;b++){if(c.hooks[b]-c.hooks[c.current]>c.width){c.set(b-2);break}}else c.set(c.current+a._options.carouselSteps)});c.prev.bind("click",function(d){d.preventDefault();
+if(a._options.carouselSteps==="auto")for(b=c.current;b>=0;b--)if(c.hooks[c.current]-c.hooks[b]>c.width){c.set(b+2);break}else{if(b===0){c.set(0);break}}else c.set(c.current-a._options.carouselSteps)})},set:function(a){for(a=Math.max(a,0);c.hooks[a-1]+c.width>=c.max&&a>=0;)a--;c.current=a;c.animate()},getLast:function(a){return(a||c.current)-1},follow:function(a){if(a===0||a===c.hooks.length-2)c.set(a);else{for(var b=c.current;c.hooks[b]-c.hooks[c.current]<c.width&&b<=c.hooks.length;)b++;a-1<c.current?
+c.set(a-1):a+2>b&&c.set(a-b+c.current+2)}},setClasses:function(){c.prev.toggleClass("disabled",!c.current);c.next.toggleClass("disabled",c.hooks[c.current]+c.width>=c.max)},animate:function(){c.setClasses();var b=c.hooks[c.current]*-1;isNaN(b)||f.animate(a.get("thumbnails"),{left:b},{duration:a._options.carouselSpeed,easing:a._options.easing,queue:!1})}},i=this._tooltip={initialized:!1,open:!1,init:function(){i.initialized=!0;f.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}");
+a.$("tooltip").css("opacity",0.8);f.hide(a.get("tooltip"))},move:function(b){var c=a.getMousePosition(b).x,b=a.getMousePosition(b).y,d=a.$("tooltip"),e=b,f=d.outerHeight(!0)+1,i=d.outerWidth(!0),g=f+15,i=a.$("container").width()-i-2,f=a.$("container").height()-f-2;!isNaN(c)&&!isNaN(e)&&(c+=10,e-=30,c=Math.max(0,Math.min(i,c)),e=Math.max(0,Math.min(f,e)),b<g&&(e=g),d.css({left:c,top:e}))},bind:function(b,c){if(!Galleria.TOUCH){i.initialized||i.init();var d=function(b,c){i.define(b,c);e(b).hover(function(){f.clearTimer("switch_tooltip");
+a.$("container").unbind("mousemove",i.move).bind("mousemove",i.move).trigger("mousemove");i.show(b);Galleria.utils.addTimer("tooltip",function(){a.$("tooltip").stop().show().animate({opacity:1});i.open=!0},i.open?0:500)},function(){a.$("container").unbind("mousemove",i.move);f.clearTimer("tooltip");a.$("tooltip").stop().animate({opacity:0},200,function(){a.$("tooltip").hide();f.addTimer("switch_tooltip",function(){i.open=!1},1E3)})})};typeof c==="string"?d(b in a._dom?a.get(b):b,c):e.each(b,function(b,
+c){d(a.get(b),c)})}},show:function(b){var b=e(b in a._dom?a.get(b):b),c=b.data("tt"),d=function(a){l.setTimeout(function(a){return function(){i.move(a)}}(a),10);b.unbind("mouseup",d)};if(c=typeof c==="function"?c():c)a.$("tooltip").html(c.replace(/\s/,"&nbsp;")),b.bind("mouseup",d)},define:function(b,c){if(typeof c!=="function")var d=c,c=function(){return d};b=e(b in a._dom?a.get(b):b).data("tt",c);i.show(b)}},j=this._fullscreen={scrolled:0,crop:a._options.imageCrop,active:!1,keymap:a._keyboard.map,
+enter:function(b){j.active=!0;f.hide(a.getActiveImage());a.$("container").addClass("fullscreen");j.scrolled=t.scrollTop();f.forceStyles(a.get("container"),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1E4});var c={height:"100%",overflow:"hidden",margin:0,padding:0},d=a.getData();f.forceStyles(u().html,c);f.forceStyles(u().body,c);j.keymap=e.extend({},a._keyboard.map);a.attachKeyboard({escape:a.exitFullscreen,right:a.next,left:a.prev});if(a._options.fullscreenCrop!==void 0)a._options.imageCrop=
+a._options.fullscreenCrop;if(d&&d.big&&d.image!==d.big){var c=new Galleria.Picture,i=c.isCached(d.big),g=a.getIndex(),h=a._thumbnails[g];a.trigger({type:Galleria.LOADSTART,cached:i,rewind:!1,index:g,imageTarget:a.getActiveImage(),thumbTarget:h});c.load(d.big,function(b){a._scaleImage(b,{complete:function(b){a.trigger({type:Galleria.LOADFINISH,cached:i,index:g,rewind:!1,imageTarget:b.image,thumbTarget:h});var c=a._controls.getActive().image;c&&e(c).width(b.image.width).height(b.image.height).attr("style",
+e(b.image).attr("style")).attr("src",b.image.src)}})})}a.rescale(function(){f.addTimer("fullscreen_enter",function(){f.show(a.getActiveImage());typeof b==="function"&&b.call(a)},100);a.trigger(Galleria.FULLSCREEN_ENTER)});t.resize(function(){j.scale()})},scale:function(){a.rescale()},exit:function(b){j.active=!1;f.hide(a.getActiveImage());a.$("container").removeClass("fullscreen");f.revertStyles(a.get("container"),u().html,u().body);l.scrollTo(0,j.scrolled);a.detachKeyboard();a.attachKeyboard(j.keymap);
+if(a._options.fullscreenCrop!==void 0)a._options.imageCrop=j.crop;a.rescale(function(){f.addTimer("fullscreen_exit",function(){f.show(a.getActiveImage());typeof b==="function"&&b.call(a)},50);a.trigger(Galleria.FULLSCREEN_EXIT)});t.unbind("resize",j.scale)}},h=this._idle={trunk:[],bound:!1,add:function(a,b){if(a){h.bound||h.addEvent();var a=e(a),c={},d;for(d in b)b.hasOwnProperty(d)&&(c[d]=a.css(d));a.data("idle",{from:c,to:b,complete:!0,busy:!1});h.addTimer();h.trunk.push(a)}},remove:function(b){b=
+jQuery(b);e.each(h.trunk,function(c,d){d.length&&!d.not(b).length&&(a._idle.show(b),a._idle.trunk.splice(c,1))});h.trunk.length||(h.removeEvent(),f.clearTimer("idle"))},addEvent:function(){h.bound=!0;a.$("container").bind("mousemove click",h.showAll)},removeEvent:function(){h.bound=!1;a.$("container").unbind("mousemove click",h.showAll)},addTimer:function(){f.addTimer("idle",function(){a._idle.hide()},a._options.idleTime)},hide:function(){a._options.idleMode&&(a.trigger(Galleria.IDLE_ENTER),e.each(h.trunk,
+function(b,c){var d=c.data("idle");if(d)c.data("idle").complete=!1,f.animate(c,d.to,{duration:a._options.idleSpeed})}))},showAll:function(){f.clearTimer("idle");e.each(a._idle.trunk,function(b,c){a._idle.show(c)})},show:function(b){var c=b.data("idle");if(!c.busy&&!c.complete)c.busy=!0,a.trigger(Galleria.IDLE_EXIT),f.clearTimer("idle"),f.animate(b,c.from,{duration:a._options.idleSpeed/2,complete:function(){e(this).data("idle").busy=!1;e(this).data("idle").complete=!0}});h.addTimer()}},g=this._lightbox=
+{width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){a.trigger(Galleria.LIGHTBOX_OPEN);if(!g.initialized){g.initialized=!0;var b={},c=a._options,d="",c={overlay:"position:fixed;display:none;opacity:"+c.overlayOpacity+";filter:alpha(opacity="+c.overlayOpacity*100+");top:0;left:0;width:100%;height:100%;background:"+c.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",
+shadow:"position:absolute;background:#000;width:100%;height:100%;",content:"position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:"position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:"position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:"position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",
+prevholder:"position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:"position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",
+title:"float:left",counter:"float:right;margin-left:8px;"},i={};m===8&&(c.nextholder+="background:#000;filter:alpha(opacity=0);",c.prevholder+="background:#000;filter:alpha(opacity=0);");e.each(c,function(a,b){d+=".galleria-lightbox-"+a+"{"+b+"}"});f.insertStyleTag(d);e.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),function(c,d){a.addElement("lightbox-"+d);b[d]=g.elems[d]=a.get("lightbox-"+d)});g.image=new Galleria.Picture;e.each({box:"shadow content close prevholder nextholder",
+info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(a,b){var c=[];e.each(b.split(" "),function(a,b){c.push("lightbox-"+b)});i["lightbox-"+a]=c});a.append(i);e(b.image).append(g.image.container);e(u().body).append(b.overlay,b.box);f.optimizeTouch(b.box);(function(a){return a.hover(function(){e(this).css("color","#bbb")},function(){e(this).css("color","#444")})})(e(b.close).bind("click",g.hide).html("&#215;"));e.each(["Prev","Next"],function(a,c){var d=e(b[c.toLowerCase()]).html(/v/.test(c)?
+"&#8249;&nbsp;":"&nbsp;&#8250;"),f=e(b[c.toLowerCase()+"holder"]);f.bind("click",function(){g["show"+c]()});m<8||Galleria.TOUCH?d.show():f.hover(function(){d.show()},function(){d.stop().fadeOut(200)})});e(b.overlay).bind("click",g.hide);if(Galleria.IPAD)a._options.lightboxTransitionSpeed=0}},rescale:function(b){var c=Math.min(t.width()-40,g.width),d=Math.min(t.height()-60,g.height),d=Math.min(c/g.width,d/g.height),c=Math.round(g.width*d)+40,d=Math.round(g.height*d)+60,c={width:c,height:d,"margin-top":Math.ceil(d/
+2)*-1,"margin-left":Math.ceil(c/2)*-1};b?e(g.elems.box).css(c):e(g.elems.box).animate(c,{duration:a._options.lightboxTransitionSpeed,easing:a._options.easing,complete:function(){var b=g.image,c=a._options.lightboxFadeSpeed;a.trigger({type:Galleria.LIGHTBOX_IMAGE,imageTarget:b.image});e(b.container).show();f.show(b.image,c);f.show(g.elems.info,c)}})},hide:function(){g.image.image=null;t.unbind("resize",g.rescale);e(g.elems.box).hide();f.hide(g.elems.info);a.detachKeyboard();a.attachKeyboard(g.keymap);
+g.keymap=!1;f.hide(g.elems.overlay,200,function(){e(this).hide().css("opacity",a._options.overlayOpacity);a.trigger(Galleria.LIGHTBOX_CLOSE)})},showNext:function(){g.show(a.getNext(g.active))},showPrev:function(){g.show(a.getPrev(g.active))},show:function(b){g.active=b=typeof b==="number"?b:a.getIndex();g.initialized||g.init();if(!g.keymap)g.keymap=e.extend({},a._keyboard.map),a.attachKeyboard({escape:g.hide,right:g.showNext,left:g.showPrev});t.unbind("resize",g.rescale);var c=a.getData(b),d=a.getDataLength();
+f.hide(g.elems.info);g.image.load(c.big||c.image,function(a){g.width=a.original.width;g.height=a.original.height;e(a.image).css({width:"100.5%",height:"100.5%",top:0,zIndex:99998});f.hide(a.image);g.elems.title.innerHTML=c.title||"";g.elems.counter.innerHTML=b+1+" / "+d;t.resize(g.rescale);g.rescale()});e(g.elems.overlay).show();e(g.elems.box).show()}};return this};Galleria.prototype={constructor:Galleria,init:function(a,b){b=K(b);this._original={target:a,options:b,data:null};this._target=this._dom.target=
+a.nodeName?a:e(a).get(0);y.push(this);if(this._target){this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dataConfig:function(){return{}},dataSelector:"img",dataSource:this._target,debug:void 0,dummy:void 0,easing:"galleria",extend:function(){},fullscreenCrop:void 0,fullscreenDoubleTap:!0,fullscreenTransition:void 0,height:"auto",idleMode:!0,idleTime:3E3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",
+imageTimeout:void 0,initialTransition:void 0,keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:void 0,minScaleRatio:void 0,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,queue:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:!0,thumbCrop:!0,thumbEventType:"click",thumbFit:!0,thumbMargin:0,thumbQuality:"auto",thumbnails:!0,touchTransition:void 0,transition:"fade",transitionInitial:void 0,
+transitionSpeed:400,useCanvas:!1,width:"auto"};this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial;b&&b.debug===!1&&(A=!1);if(b&&typeof b.imageTimeout==="number")B=b.imageTimeout;if(b&&typeof b.dummy==="string")C=b.dummy;e(this._target).children().hide();typeof Galleria.theme==="object"?this._init():M.push(this);return this}else Galleria.raise("Target not found.",!0)},_init:function(){var a=this;if(this._initialized)return Galleria.raise("Init failed: Gallery instance already initialized."),
+this;this._initialized=!0;if(!Galleria.theme)return Galleria.raise("Init failed: No theme found."),this;e.extend(!0,this._options,Galleria.theme.defaults,this._original.options);(function(a){"getContext"in a&&(s=s||{elem:a,context:a.getContext("2d"),cache:{},length:0})})(n.createElement("canvas"));this.bind(Galleria.DATA,function(){this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var b=this.$("container"),d={width:0,height:0},j=function(){return a.$("stage").height()};
+f.wait({until:function(){e.each(["width","height"],function(e,g){d[g]=a._options[g]&&typeof a._options[g]==="number"?a._options[g]:Math.max(f.parseValue(b.css(g)),f.parseValue(a.$("target").css(g)),b[g](),a.$("target")[g]());b[g](d[g])});return j()&&d.width&&d.height>10},success:function(){Galleria.WEBKIT?l.setTimeout(function(){a._run()},1):a._run()},error:function(){j()?Galleria.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+d.width+"px, height: "+
+d.height+"px.",!0):Galleria.raise("Could not extract a stage height from the CSS. Traced height: "+j()+"px.",!0)},timeout:2E3})});this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});f.hide(this.$("counter").append(this.get("current"),
+" / ",this.get("total")));this.setCounter("&#8211;");f.hide(a.get("tooltip"));this.$("container").addClass(Galleria.TOUCH?"touch":"notouch");e.each(Array(2),function(b){var d=new Galleria.Picture;e(d.container).css({position:"absolute",top:0,left:0}).prepend(a._layers[b]=e(f.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]);a.$("images").append(d.container);a._controls[b]=d});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});
+this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"});this.$("image-nav-right, image-nav-left").bind("click",function(b){a._options.clicknext&&b.stopPropagation();a._options.pauseOnInteraction&&a.pause();b=/right/.test(this.className)?"next":"prev";a[b]()});e.each(["info","counter","image-nav"],function(b,d){a._options["show"+d.substr(0,1).toUpperCase()+d.substr(1).replace(/-/,"")]===!1&&f.moveOut(a.get(d.toLowerCase()))});this.load();if(!this._options.keep_source&&!m)this._target.innerHTML=
+"";this.get("errors")&&this.appendChild("target","errors");this.appendChild("target","container");if(this._options.carousel){var b=0,d=this._options.show;this.bind(Galleria.THUMBNAIL,function(){this.updateCarousel();++b==this.getDataLength()&&typeof d=="number"&&d>0&&this._carousel.follow(d)})}this._options.swipe&&(function(b){var d=[0,0],e=[0,0],h=!1,g=0,k,p={start:"touchstart",move:"touchmove",stop:"touchend"},l=function(a){a.originalEvent.touches&&a.originalEvent.touches.length>1||(k=a.originalEvent.touches?
+a.originalEvent.touches[0]:a,e=[k.pageX,k.pageY],d[0]||(d=e),Math.abs(d[0]-e[0])>10&&a.preventDefault())},m=function(k){b.unbind(p.move,l);k.originalEvent.touches&&k.originalEvent.touches.length||h?h=!h:(f.timestamp()-g<1E3&&Math.abs(d[0]-e[0])>30&&Math.abs(d[1]-e[1])<100&&(k.preventDefault(),a[d[0]>e[0]?"next":"prev"]()),d=e=[0,0])};b.bind(p.start,function(a){a.originalEvent.touches&&a.originalEvent.touches.length>1||(k=a.originalEvent.touches?a.originalEvent.touches[0]:a,g=f.timestamp(),d=e=[k.pageX,
+k.pageY],b.bind(p.move,l).one(p.stop,m))})}(a.$("images")),this._options.fullscreenDoubleTap&&this.$("stage").bind("touchstart",function(){var b,d,e,f,g,k;return function(p){k=Galleria.utils.timestamp();d=(p.originalEvent.touches?p.originalEvent.touches[0]:p).pageX;e=(p.originalEvent.touches?p.originalEvent.touches[0]:p).pageY;k-b<500&&d-f<20&&e-g<20?(a.toggleFullscreen(),p.preventDefault(),a.$("stage").unbind("touchend",arguments.callee)):(b=k,f=d,g=e)}}()));f.optimizeTouch(this.get("container"));
+return this},_createThumbnails:function(){this.get("total").innerHTML=this.getDataLength();var a,b,d,c,i,j=this,h=this._options,g=function(){var a=j.$("thumbnails").find(".active");return!a.length?!1:a.find("img").attr("src")}(),k=typeof h.thumbnails==="string"?h.thumbnails.toLowerCase():null,p=function(a){return n.defaultView&&n.defaultView.getComputedStyle?n.defaultView.getComputedStyle(d.container,null)[a]:i.css(a)},w=function(a,b,c){return function(){e(c).append(a);j.trigger({type:Galleria.THUMBNAIL,
+thumbTarget:a,index:b})}},m=function(a){h.pauseOnInteraction&&j.pause();var b=e(a.currentTarget).data("index");j.getIndex()!==b&&j.show(b);a.preventDefault()},o=function(a){a.scale({width:a.data.width,height:a.data.height,crop:h.thumbCrop,margin:h.thumbMargin,canvas:h.useCanvas,complete:function(a){var b=["left","top"],c,d;e.each(["Width","Height"],function(f,g){c=g.toLowerCase();if((h.thumbCrop!==!0||h.thumbCrop===c)&&h.thumbFit)d={},d[c]=a[c],e(a.container).css(d),d={},d[b[f]]=0,e(a.image).css(d);
+a["outer"+g]=e(a.container)["outer"+g](!0)});f.toggleQuality(a.image,h.thumbQuality===!0||h.thumbQuality==="auto"&&a.original.width<a.width*3);j.trigger({type:Galleria.THUMBNAIL,thumbTarget:a.image,index:a.data.order})}})};this._thumbnails=[];this.$("thumbnails").empty();for(a=0;this._data[a];a++)c=this._data[a],h.thumbnails===!0?(d=new Galleria.Picture(a),b=c.thumb||c.image,this.$("thumbnails").append(d.container),i=e(d.container),d.data={width:f.parseValue(p("width")),height:f.parseValue(p("height")),
+order:a},h.thumbFit&&h.thumbCrop!==!0?i.css({width:0,height:0}):i.css({width:d.data.width,height:d.data.height}),d.load(b,o),h.preload==="all"&&d.preload(c.image)):k==="empty"||k==="numbers"?(d={container:f.create("galleria-image"),image:f.create("img","span"),ready:!0},k==="numbers"&&e(d.image).text(a+1),this.$("thumbnails").append(d.container),l.setTimeout(w(d.image,a,d.container),50+a*20)):d={container:null,image:null},e(d.container).add(h.keepSource&&h.linkSourceImages?c.original:null).data("index",
+a).bind(h.thumbEventType,m),g===b&&e(d.container).addClass("active"),this._thumbnails.push(d)},_run:function(){var a=this;a._createThumbnails();f.wait({until:function(){Galleria.OPERA&&a.$("stage").css("display","inline-block");a._stageWidth=a.$("stage").width();a._stageHeight=a.$("stage").height();return a._stageWidth&&a._stageHeight>50},success:function(){z.push(a);f.show(a.get("counter"));a._options.carousel&&a._carousel.bindControls();if(a._options.autoplay){a.pause();if(typeof a._options.autoplay===
+"number")a._playtime=a._options.autoplay;a.trigger(Galleria.PLAY);a._playing=!0}a._firstrun?typeof a._options.show==="number"&&a.show(a._options.show):(a._firstrun=!0,a._options.clicknext&&!Galleria.TOUCH&&(e.each(a._data,function(a,d){delete d.link}),a.$("stage").css({cursor:"pointer"}).bind("click",function(){a._options.pauseOnInteraction&&a.pause();a.next()})),Galleria.History&&Galleria.History.change(function(b){isNaN(b)?l.history.go(-1):a.show(b,void 0,!0)}),e.each(Galleria.ready.callbacks,function(){this.call(a,
+a._options)}),a.trigger(Galleria.READY),Galleria.theme.init.call(a,a._options),a._options.extend.call(a,a._options),/^[0-9]{1,4}$/.test(I)&&Galleria.History?a.show(I,void 0,!0):a._data[a._options.show]&&a.show(a._options.show))},error:function(){Galleria.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+a._stageWidth+"px, height: "+a._stageHeight+"px.",!0)}})},load:function(a,b,d){var c=this;this._data=[];this._thumbnails=[];this.$("thumbnails").empty();typeof b===
+"function"&&(d=b,b=null);a=a||this._options.dataSource;b=b||this._options.dataSelector;d=d||this._options.dataConfig;/^function Object/.test(a.constructor)&&(a=[a]);if(a.constructor===Array)return this.validate(a)?(this._data=a,this._parseData().trigger(Galleria.DATA)):Galleria.raise("Load failed: JSON Array not valid."),this;e(a).find(b).each(function(a,b){var b=e(b),f={},g=b.parent(),k=g.attr("href"),g=g.attr("rel");if(k)f.image=f.big=k;if(g)f.big=g;c._data.push(e.extend({title:b.attr("title")||
+"",thumb:b.attr("src"),image:b.attr("src"),big:b.attr("src"),description:b.attr("alt")||"",link:b.attr("longdesc"),original:b.get(0)},f,d(b)))});this.getDataLength()?this.trigger(Galleria.DATA):Galleria.raise("Load failed: no data found.");return this},_parseData:function(){var a=this;e.each(this._data,function(b,d){if("thumb"in d===!1)a._data[b].thumb=d.image;if(!1 in d)a._data[b].big=d.image});return this},splice:function(){Array.prototype.splice.apply(this._data,f.array(arguments));return this._parseData()._createThumbnails()},
+push:function(){Array.prototype.push.apply(this._data,f.array(arguments));return this._parseData()._createThumbnails()},_getActive:function(){return this._controls.getActive()},validate:function(){return!0},bind:function(a,b){a=D(a);this.$("container").bind(a,this.proxy(b));return this},unbind:function(a){a=D(a);this.$("container").unbind(a);return this},trigger:function(a){a=typeof a==="object"?e.extend(a,{scope:this}):{type:D(a),scope:this};this.$("container").trigger(a);return this},addIdleState:function(a,
+b){this._idle.add.apply(this._idle,f.array(arguments));return this},removeIdleState:function(a){this._idle.remove.apply(this._idle,f.array(arguments));return this},enterIdleMode:function(){this._idle.hide();return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(a){this._fullscreen.enter.apply(this,f.array(arguments));return this},exitFullscreen:function(a){this._fullscreen.exit.apply(this,f.array(arguments));return this},toggleFullscreen:function(a){this._fullscreen[this.isFullscreen()?
+"exit":"enter"].apply(this,f.array(arguments));return this},bindTooltip:function(a,b){this._tooltip.bind.apply(this._tooltip,f.array(arguments));return this},defineTooltip:function(a,b){this._tooltip.define.apply(this._tooltip,f.array(arguments));return this},refreshTooltip:function(a){this._tooltip.show.apply(this._tooltip,f.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,f.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,
+f.array(arguments));return this},getActiveImage:function(){return this._getActive().image||void 0},getActiveThumb:function(){return this._thumbnails[this._active].image||void 0},getMousePosition:function(a){return{x:a.pageX-this.$("container").offset().left,y:a.pageY-this.$("container").offset().top}},addPan:function(a){if(this._options.imageCrop!==!1){var a=e(a||this.getActiveImage()),b=this,d=a.width()/2,c=a.height()/2,i=parseInt(a.css("left"),10),j=parseInt(a.css("top"),10),h=i||0,g=j||0,k=0,p=
+0,l=!1,n=f.timestamp(),o=0,q=0,r=function(b,c,d){if(b>0&&(q=Math.round(Math.max(b*-1,Math.min(0,c))),o!==q))if(o=q,m===8)a.parent()["scroll"+d](q*-1);else b={},b[d.toLowerCase()]=q,a.css(b)},N=function(a){if(!(f.timestamp()-n<50))l=!0,d=b.getMousePosition(a).x,c=b.getMousePosition(a).y};m===8&&(a.parent().scrollTop(g*-1).scrollLeft(h*-1),a.css({top:0,left:0}));this.$("stage").unbind("mousemove",N).bind("mousemove",N);f.addTimer("pan",function(){l&&(k=a.width()-b._stageWidth,p=a.height()-b._stageHeight,
+i=d/b._stageWidth*k*-1,j=c/b._stageHeight*p*-1,h+=(i-h)/b._options.imagePanSmoothness,g+=(j-g)/b._options.imagePanSmoothness,r(p,g,"Top"),r(k,h,"Left"))},50,!0);return this}},proxy:function(a,b){if(typeof a!=="function")return function(){};b=b||this;return function(){return a.apply(b,f.array(arguments))}},removePan:function(){this.$("stage").unbind("mousemove");f.clearTimer("pan");return this},addElement:function(a){var b=this._dom;e.each(f.array(arguments),function(a,c){b[c]=f.create("galleria-"+
+c)});return this},attachKeyboard:function(a){this._keyboard.attach.apply(this._keyboard,f.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,f.array(arguments));return this},appendChild:function(a,b){this.$(a).append(this.get(b)||b);return this},prependChild:function(a,b){this.$(a).prepend(this.get(b)||b);return this},remove:function(a){this.$(f.array(arguments).join(",")).remove();return this},append:function(a){var b,d;for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===
+Array)for(d=0;a[b][d];d++)this.appendChild(b,a[b][d]);else this.appendChild(b,a[b]);return this},_scaleImage:function(a,b){var a=a||this._controls.getActive(),d,c=function(a){e(a.container).children(":first").css({top:Math.max(0,f.parseValue(a.image.style.top)),left:Math.max(0,f.parseValue(a.image.style.left)),width:f.parseValue(a.image.width),height:f.parseValue(a.image.height)})},b=e.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,
+min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition},b);this._options.layerFollow&&this._options.imageCrop!==!0?typeof b.complete=="function"?(d=b.complete,b.complete=function(){d.call(a,a);c(a)}):b.complete=c:e(a.container).children(":first").css({top:0,left:0});a.scale(b);return this},updateCarousel:function(){this._carousel.update();return this},rescale:function(a,b,d){var c=this;typeof a==="function"&&(d=a,a=void 0);var e=function(){c._stageWidth=
+a||c.$("stage").width();c._stageHeight=b||c.$("stage").height();c._scaleImage();c._options.carousel&&c.updateCarousel();c.trigger(Galleria.RESCALE);typeof d==="function"&&d.call(c)};Galleria.WEBKIT&&!a&&!b?f.addTimer("scale",e,10):e.call(c);return this},refreshImage:function(){this._scaleImage();this._options.imagePan&&this.addPan();return this},show:function(a,b,d){if(!(a===!1||!this._options.queue&&this._queue.stalled))if(a=Math.max(0,Math.min(parseInt(a,10),this.getDataLength()-1)),b=typeof b!==
+"undefined"?!!b:a<this.getIndex(),!d&&Galleria.History)Galleria.History.set(a.toString());else return this._active=a,Array.prototype.push.call(this._queue,{index:a,rewind:b}),this._queue.stalled||this._show(),this},_show:function(){var a=this,b=this._queue[0],d=this.getData(b.index);if(d){var c=this.isFullscreen()&&"big"in d?d.big:d.image,i=this._controls.getActive(),j=this._controls.getNext(),h=j.isCached(c),g=this._thumbnails[b.index],k=function(b,c,d,g,h){return function(){a._queue.stalled=!1;
+f.toggleQuality(c.image,a._options.imageQuality);a._layers[a._controls.active].innerHTML="";e(d.container).css({zIndex:0,opacity:0}).show();e(c.container).css({zIndex:1}).show();a._controls.swap();a._options.imagePan&&a.addPan(c.image);(b.link||a._options.lightbox)&&e(c.image).css({cursor:"pointer"}).bind("mouseup",function(){b.link?a._options.popupLinks?l.open(b.link,"_blank"):l.location.href=b.link:a.openLightbox()});Array.prototype.shift.call(a._queue);a._queue.length&&a._show();a._playCheck();
+a.trigger({type:Galleria.IMAGE,index:g.index,imageTarget:c.image,thumbTarget:h.image})}}(d,j,i,b,g);this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(b.index);if(this._options.preload){var p,m,n=this.getNext(),o;try{for(m=this._options.preload;m>0;m--)p=new Galleria.Picture,o=a.getData(n),p.preload(this.isFullscreen()&&"big"in o?o.big:o.image),n=a.getNext(n)}catch(q){}}f.show(j.container);e(a._thumbnails[b.index].container).addClass("active").siblings(".active").removeClass("active");
+a.trigger({type:Galleria.LOADSTART,cached:h,index:b.index,rewind:b.rewind,imageTarget:j.image,thumbTarget:g.image});j.load(c,function(c){e(a._layers[1-a._controls.active]).html(d.layer||"").hide();a._scaleImage(c,{complete:function(c){"image"in i&&f.toggleQuality(i.image,!1);f.toggleQuality(c.image,!1);a._queue.stalled=!0;a.removePan();a.setInfo(b.index);a.setCounter(b.index);d.layer&&e(a._layers[1-a._controls.active]).show();a.trigger({type:Galleria.LOADFINISH,cached:h,index:b.index,rewind:b.rewind,
+imageTarget:c.image,thumbTarget:a._thumbnails[b.index].image});var g=a._options.transition;e.each({initial:i.image===null,touch:Galleria.TOUCH,fullscreen:a.isFullscreen()},function(b,c){if(c&&a._options[b+"Transition"]!==void 0)return g=a._options[b+"Transition"],!1});g in G===!1?k():G[g].call(a,{prev:i.container,next:c.container,rewind:b.rewind,speed:a._options.transitionSpeed||400},k)}})})}},getNext:function(a){a=typeof a==="number"?a:this.getIndex();return a===this.getDataLength()-1?0:a+1},getPrev:function(a){a=
+typeof a==="number"?a:this.getIndex();return a===0?this.getDataLength()-1:a-1},next:function(){this.getDataLength()>1&&this.show(this.getNext(),!1);return this},prev:function(){this.getDataLength()>1&&this.show(this.getPrev(),!0);return this},get:function(a){return a in this._dom?this._dom[a]:null},getData:function(a){return a in this._data?this._data[a]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return typeof this._active==="number"?this._active:
+!1},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(a){return typeof a==="undefined"?this._options:this._options[a]},setOptions:function(a,b){typeof a==="object"?e.extend(this._options,a):this._options[a]=b;return this},play:function(a){this._playing=!0;this._playtime=a||this._playtime;this._playCheck();this.trigger(Galleria.PLAY);return this},pause:function(){this._playing=!1;this.trigger(Galleria.PAUSE);return this},playToggle:function(a){return this._playing?
+this.pause():this.play(a)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var a=this,b=0,d=f.timestamp(),c="play"+this._id;if(this._playing){f.clearTimer(c);var e=function(){b=f.timestamp()-d;b>=a._playtime&&a._playing?(f.clearTimer(c),a.next()):a._playing&&(a.trigger({type:Galleria.PROGRESS,percent:Math.ceil(b/a._playtime*100),seconds:Math.floor(b/1E3),milliseconds:b}),f.addTimer(c,e,20))};f.addTimer(c,e,20)}},setPlaytime:function(a){this._playtime=
+a;return this},setIndex:function(a){this._active=a;return this},setCounter:function(a){typeof a==="number"?a++:typeof a==="undefined"&&(a=this.getIndex()+1);this.get("current").innerHTML=a;if(m){var a=this.$("counter"),b=a.css("opacity");parseInt(b,10)===1?f.removeAlpha(a[0]):this.$("counter").css("opacity",b)}return this},setInfo:function(a){var b=this,d=this.getData(a);e.each(["title","description"],function(a,e){var f=b.$("info-"+e);d[e]?f[d[e].length?"show":"hide"]().html(d[e]):f.empty().hide()});
+return this},hasInfo:function(a){var b="title description".split(" "),d;for(d=0;b[d];d++)if(this.getData(a)[b[d]])return!0;return!1},jQuery:function(a){var b=this,d=[];e.each(a.split(","),function(a,c){c=e.trim(c);b.get(c)&&d.push(c)});var c=e(b.get(d.shift()));e.each(d,function(a,d){c=c.add(b.get(d))});return c},$:function(a){return this.jQuery.apply(this,f.array(arguments))}};e.each(J,function(a,b){var d=/_/.test(b)?b.replace(/_/g,""):b;Galleria[b.toUpperCase()]="galleria."+d});e.extend(Galleria,
+{IE9:m===9,IE8:m===8,IE7:m===7,IE6:m===6,IE:m,WEBKIT:/webkit/.test(x),SAFARI:/safari/.test(x),CHROME:/chrome/.test(x),QUIRK:m&&n.compatMode&&n.compatMode==="BackCompat",MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!l.opera,IPHONE:/iphone/.test(x),IPAD:/ipad/.test(x),ANDROID:/android/.test(x),TOUCH:"ontouchstart"in n});Galleria.addTheme=function(a){a.name||Galleria.raise("No theme name specified");a.defaults=typeof a.defaults!=="object"?{}:K(a.defaults);var b=!1,d;typeof a.css==="string"?
+(e("link").each(function(c,e){d=RegExp(a.css);if(d.test(e.href))return b=!0,E(a),!1}),b||e("script").each(function(c,e){d=RegExp("galleria\\."+a.name.toLowerCase()+"\\.");d.test(e.src)&&(b=e.src.replace(/[^\/]*$/,"")+a.css,f.addTimer("css",function(){f.loadCSS(b,"galleria-theme",function(){E(a)})},1))}),b||Galleria.raise("No theme CSS loaded")):E(a);return a};Galleria.loadTheme=function(a,b){var d=z.length,c=l.setTimeout(function(){Galleria.raise("Theme at "+a+" could not load, check theme path.",
+!0)},5E3);Galleria.theme=void 0;f.loadScript(a,function(){l.clearTimeout(c);if(d){var a=[];e.each(Galleria.get(),function(c,d){var f=e.extend(d._original.options,{data_source:d._data},b);d.$("container").remove();var k=new Galleria;k._id=d._id;k.init(d._original.target,f);a.push(k)});z=a}})};Galleria.get=function(a){if(y[a])return y[a];else if(typeof a!=="number")return y;else Galleria.raise("Gallery index "+a+" not found")};Galleria.addTransition=function(a,b){G[a]=b};Galleria.utils=f;Galleria.log=
+function(){return"console"in l&&"log"in l.console?l.console.log:function(){l.alert(f.array(arguments).join(", "))}}();Galleria.ready=function(a){e.each(z,function(b,d){a.call(d,d._options)});Galleria.ready.callbacks.push(a)};Galleria.ready.callbacks=[];Galleria.raise=function(a,b){var d=b?"Fatal error":"Error",c=function(a){var c='<div style="padding:4px;margin:0 0 2px;background:#'+(b?"811":"222")+'";>'+(b?"<strong>"+d+": </strong>":"")+a+"</div>";e.each(y,function(){var a=this.$("errors"),b=this.$("target");
+a.length||(b.css("position","relative"),a=this.addElement("errors").appendChild("target","errors").$("errors").css({color:"#fff",position:"absolute",top:0,left:0,zIndex:1E5}));a.append(c)})};if(A){if(c(a),b)throw Error(d+": "+a);}else b&&!L&&(L=!0,b=!1,c("Image gallery could not load."))};Galleria.version=1.25;Galleria.requires=function(a,b){Galleria.version<a&&Galleria.raise(b||"You need to upgrade Galleria to version "+a+" to use one or more components.",!0)};Galleria.Picture=function(a){this.id=
+a||null;this.image=null;this.container=f.create("galleria-image");e(this.container).css({overflow:"hidden",position:"relative"});this.original={width:0,height:0};this.ready=!1;this.tid=null};Galleria.Picture.prototype={cache:{},show:function(){f.show(this.image)},hide:function(){f.moveOut(this.image)},clear:function(){this.image=null},isCached:function(a){return!!this.cache[a]},preload:function(a){e(new Image).load(function(a,d){return function(){d[a]=a}}(a,this.cache)).attr("src",a)},load:function(a,
+b){this.tid=l.setTimeout(function(a){return function(){Galleria.raise("Image not loaded in "+Math.round(B/1E3)+" seconds: "+a)}}(a),B);this.image=new Image;var d=!1,c=e(this.container),i=e(this.image),j=function(a,b,c){return function(){var d=function(){a.original={height:this.height,width:this.width};a.cache[c]=c;l.clearTimeout(a.tid);typeof b=="function"&&l.setTimeout(function(){b.call(a,a)},1)};!this.width||!this.height?l.setTimeout(function(a){return function(){a.width&&a.height?d.call(a):Galleria.raise("Could not extract width/height from image: "+
+a.src+". Traced measures: width:"+a.width+"px, height: "+a.height+"px.")}}(this),2):d.call(this)}}(this,b,a);c.find("img").remove();i.css("display","block").appendTo(this.container);f.hide(this.image);if(this.cache[a])return this.image.src=a,j.call(this.image),this.container;e(this.image).load(j).error(function(){d?C?e(this).attr("src",C):Galleria.raise("Image not found: "+a):(d=!0,l.setTimeout(function(a,b){return function(){a.attr("src",b+"?"+f.timestamp())}}(e(this),a),50))}).attr("src",a);return this.container},
+scale:function(a){a=e.extend({width:0,height:0,min:void 0,max:void 0,margin:0,complete:function(){},position:"center",crop:!1,canvas:!1},a);if(!this.image)return this.container;var b,d,c=this,i=e(c.container),j;f.wait({until:function(){b=a.width||i.width()||f.parseValue(i.css("width"));d=a.height||i.height()||f.parseValue(i.css("height"));return b&&d},success:function(){var h=(b-a.margin*2)/c.original.width,g=(d-a.margin*2)/c.original.height,i={"true":Math.max(h,g),width:h,height:g,"false":Math.min(h,
+g)}[a.crop.toString()],h="";a.max&&(i=Math.min(a.max,i));a.min&&(i=Math.max(a.min,i));e.each(["width","height"],function(a,b){e(c.image)[b](c[b]=c.image[b]=Math.round(c.original[b]*i))});e(c.container).width(b).height(d);if(a.canvas&&s)s.elem.width=c.width,s.elem.height=c.height,h=c.image.src+":"+c.width+"x"+c.height,c.image.src=s.cache[h]||function(a){s.context.drawImage(c.image,0,0,c.original.width*i,c.original.height*i);try{return j=s.elem.toDataURL(),s.length+=j.length,s.cache[a]=j}catch(b){return c.image.src}}(h);
+var l={},m={},h=function(a,b,d){var g=0;/\%/.test(a)?(a=parseInt(a,10)/100,b=c.image[b]||e(c.image)[b](),g=Math.ceil(b*-1*a+d*a)):g=f.parseValue(a);return g},n={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};e.each(a.position.toLowerCase().split(" "),function(a,b){b==="center"&&(b="50%");l[a?"top":"left"]=b});e.each(l,function(a,b){n.hasOwnProperty(b)&&e.extend(m,n[b])});l=l.top?e.extend(l,m):m;l=e.extend({top:"50%",left:"50%"},l);e(c.image).css({position:"absolute",top:h(l.top,
+"height",d),left:h(l.left,"width",b)});c.show();c.ready=!0;a.complete.call(c,c)},error:function(){Galleria.raise("Could not scale image: "+c.image.src)},timeout:1E3});return this}};e.extend(e.easing,{galleria:function(a,b,d,c,e){return(b/=e/2)<1?c/2*b*b*b+d:c/2*((b-=2)*b*b+2)+d},galleriaIn:function(a,b,d,c,e){return c*(b/=e)*b+d},galleriaOut:function(a,b,d,c,e){return-c*(b/=e)*(b-2)+d}});e.fn.galleria=function(a){return this.each(function(){e(this).data("galleria",(new Galleria).init(this,a))})}})(jQuery);

File static_files/galleria/plugins/flickr/flickr-demo.html

+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+        <title>Galleria Flickr Plugin</title>
+        <style>
+        
+            /* Demo styles */
+            html,body{background:#222;margin:0;}
+            body{border-top:4px solid #000;}
+            .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;}
+            h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;}
+            p{margin:0 0 20px}
+            a {color:#22BCB9;text-decoration:none;}
+            .cred{margin-top:20px;font-size:11px;}
+            
+            /* This rule is read by Galleria to define the gallery height: */
+            #galleria{height:320px;}
+            
+        </style>
+        
+        <!-- load jQuery -->
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
+        
+        <!-- load Galleria -->
+        <script src="../../galleria.js"></script>
+        
+        <!-- load flickr plugin -->
+        <script src="galleria.flickr.js"></script>
+
+    </head>
+<body>
+    <div class="content">
+        <h1>Galleria Flickr Plugin Demo</h1>
+        <p>Demonstrating a basic gallery example with a Flickr search.</p>
+        
+        <!-- Adding gallery images. This is just a container for the dynamic flickr images -->
+        
+        <div id="galleria"></div>
+        
+        <p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p>
+    </div>
+    <script>
+
+    // Load the classic theme
+    Galleria.loadTheme('../../themes/classic/galleria.classic.js');
+    
+    // Initialize Galleria
+    $('#galleria').galleria({
+        flickr: 'search:cityscape',
+        flickrOptions: {
+            sort: 'interestingness-desc'
+        }
+    });
+
+    </script>
+    </body>
+</html>

File static_files/galleria/plugins/flickr/flickr-loader.gif

Added
New image

File static_files/galleria/plugins/flickr/galleria.flickr.js

+/**
+ * @preserve Galleria Flickr Plugin 2011-08-01
+ * http://galleria.aino.se
+ *
+ * Copyright 2011, Aino
+ * Licensed under the MIT license.
+ */
+
+/*global jQuery, Galleria, window */
+
+Galleria.requires(1.25, 'The Flickr Plugin requires Galleria version 1.2.5 or later.');
+
+(function($) {
+
+// The script path
+var PATH = Galleria.utils.getScriptPath();
+
+/**
+
+    @class
+    @constructor
+
+    @example var flickr = new Galleria.Flickr();
+
+    @author http://aino.se
+
+    @requires jQuery
+    @requires Galleria
+
+    @param {String} [api_key] Flickr API key to be used, defaults to the Galleria key
+
+    @returns Instance
+*/
+
+Galleria.Flickr = function( api_key ) {
+
+    this.api_key = api_key || '2a2ce06c15780ebeb0b706650fc890b2';
+
+    this.options = {
+        max: 30,                       // photos to return
+        imageSize: 'medium',           // photo size ( thumb,small,medium,big,original )
+        thumbSize: 'thumb',            // thumbnail size ( thumb,small,medium,big,original )
+        sort: 'interestingness-desc',  // sort option ( date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, relevance )
+        description: false,            // set this to true to get description as caption
+        complete: function(){},        // callback to be called inside the Galleria.prototype.load
+        backlink: false                // set this to true if you want to pass a link back to the original image
+    };
+};
+
+Galleria.Flickr.prototype = {
+
+    // bring back the constructor reference
+
+    constructor: Galleria.Flickr,
+
+    /**
+        Search for anything at Flickr
+
+        @param {String} phrase The string to search for
+        @param {Function} [callback] The callback to be called when the data is ready
+
+        @returns Instance
+    */
+
+    search: function( phrase, callback ) {
+        return this._find({
+            text: phrase
+        }, callback );
+    },
+
+    /**
+        Search for anything at Flickr by tag
+
+        @param {String} tag The tag(s) to search for
+        @param {Function} [callback] The callback to be called when the data is ready
+
+        @returns Instance
+    */
+
+    tags: function( tag, callback ) {
+        return this._find({
+            tags: tag
+        }, callback);
+    },
+
+    /**
+        Get a user's public photos
+
+        @param {String} username The username as shown in the URL to fetch
+        @param {Function} [callback] The callback to be called when the data is ready
+
+        @returns Instance
+    */
+
+    user: function( username, callback ) {
+        return this._call({
+            method: 'flickr.urls.lookupUser',
+            url: 'flickr.com/photos/' + username
+        }, function( data ) {
+            this._find({
+                user_id: data.user.id,
+                method: 'flickr.people.getPublicPhotos'
+            }, callback);
+        });
+    },
+
+    /**
+        Get photos from a photoset by ID
+
+        @param {String|Number} photoset_id The photoset id to fetch
+        @param {Function} [callback] The callback to be called when the data is ready
+
+        @returns Instance
+    */
+
+    set: function( photoset_id, callback ) {
+        return this._find({
+            photoset_id: photoset_id,
+            method: 'flickr.photosets.getPhotos'
+        }, callback);
+    },
+
+    /**
+        Get photos from a gallery by ID
+
+