/*navslide*/

var timerlen = 5;
var slideAniLen = 250;
var timerID = new Array();
var startTime = new Array();
var obj = new Array();
var endHeight = new Array();
var moving = new Array();
var dir = new Array();function slidedown(objname){if(moving[objname])return;if(document.getElementById(objname).style.display != "none")return;moving[objname] = true;dir[objname] = "down";startslide(objname);}function slideup(objname){if(moving[objname])return;if(document.getElementById(objname).style.display == "none")return;moving[objname] = true;dir[objname] = "up";startslide(objname);}function startslide(objname){obj[objname] = document.getElementById(objname);endHeight[objname] = parseInt(obj[objname].style.height);startTime[objname] = (new Date()).getTime();if(dir[objname] == "down"){obj[objname].style.height = "1px";}obj[objname].style.display = "block";timerID[objname] = setInterval('slidetick(\'' + objname + '\');',timerlen);}function slidetick(objname){var elapsed = (new Date()).getTime() - startTime[objname];if (elapsed > slideAniLen)endSlide(objname)
else {var d =Math.round(elapsed / slideAniLen * endHeight[objname]);if(dir[objname] == "up")d = endHeight[objname] - d;obj[objname].style.height = d + "px";}return;}
function endSlide(objname){clearInterval(timerID[objname]);if(dir[objname] == "up")obj[objname].style.display = "none";obj[objname].style.height = endHeight[objname] + "px";delete(moving[objname]);delete(timerID[objname]);delete(startTime[objname]);delete(endHeight[objname]);delete(obj[objname]);delete(dir[objname]);return;}
function toggleSlide(objname){if(document.getElementById(objname).style.display == "none"){slidedown(objname);
}else{
slideup(objname);}}
function nav(objname){var f=1
for (f=1;f<=60;f++){
slideup("form" + f);slidedown(objname);}}

/*rollover*/

$(document).ready(function() {
$("img.rollover").hover(
function() { this.src = this.src.replace("_off", "_on");},
function() { this.src = this.src.replace("_on", "_off");
});});

$(document).ready(function() {
$("input.rollover_button").hover(
function() { this.src = this.src.replace("_off", "_on");},
function() { this.src = this.src.replace("_on", "_off");
});});

/*slider*/

(function($) {var defaults = {vertical: false,rtl: false,start: 1,offset: 1,size: null,scroll: 1,visible: null,animation: 'normal',easing: 'swing',auto: 0,wrap: null,initCallback: null,setupCallback: null,reloadCallback: null,itemLoadCallback: null,itemFirstInCallback: null,itemFirstOutCallback: null,itemLastInCallback: null,itemLastOutCallback: null,itemVisibleInCallback: null,itemVisibleOutCallback: null,animationStepCallback: null,buttonNextHTML: '<div></div>',buttonPrevHTML: '<div></div>',buttonNextEvent: 'click',buttonPrevEvent: 'click',buttonNextCallback: null,buttonPrevCallback: null,itemFallbackDimension: null}, windowLoaded = false;$(window).bind('load.jcarousel', function() { windowLoaded = true; });$.jcarousel = function(e, o) {this.options    = $.extend({}, defaults, o || {});this.locked          = false;this.autoStopped     = false;this.container       = null;this.clip            = null;this.list            = null;this.buttonNext      = null;this.buttonPrev      = null;this.buttonNextState = null;this.buttonPrevState = null;if (!o || o.rtl === undefined) {this.options.rtl = ($(e).attr('dir') || $('html').attr('dir') || '').toLowerCase() == 'rtl';}this.wh = !this.options.vertical ? 'width' : 'height';this.lt = !this.options.vertical ? (this.options.rtl ? 'right' : 'left') : 'top';var skin = '', split = e.className.split(' ');for (var i = 0; i < split.length; i++) {if (split[i].indexOf('jcarousel-skin') != -1) {$(e).removeClass(split[i]);skin = split[i];break;}}if (e.nodeName.toUpperCase() == 'UL' || e.nodeName.toUpperCase() == 'OL') {this.list      = $(e);this.clip      = this.list.parents('.jcarousel-clip');this.container = this.list.parents('.jcarousel-container');} else {this.container = $(e);this.list      = this.container.find('ul,ol').eq(0);this.clip      = this.container.find('.jcarousel-clip');}if (this.clip.size() === 0) {this.clip = this.list.wrap('<div></div>').parent();}if (this.container.size() === 0) {this.container = this.clip.wrap('<div></div>').parent();}if (skin !== '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1) {this.container.wrap('<div class=" '+ skin + '"></div>');}this.buttonPrev = $('.jcarousel-prev', this.container);if (this.buttonPrev.size() === 0 && this.options.buttonPrevHTML !== null) {this.buttonPrev = $(this.options.buttonPrevHTML).appendTo(this.container);}this.buttonPrev.addClass(this.className('jcarousel-prev'));this.buttonNext = $('.jcarousel-next', this.container);if (this.buttonNext.size() === 0 && this.options.buttonNextHTML !== null) {this.buttonNext = $(this.options.buttonNextHTML).appendTo(this.container);}this.buttonNext.addClass(this.className('jcarousel-next'));this.clip.addClass(this.className('jcarousel-clip')).css({position: 'relative'});this.list.addClass(this.className('jcarousel-list')).css({overflow: 'hidden',position: 'relative',top: 0,margin: 0,padding: 0}).css((this.options.rtl ? 'right' : 'left'), 0);this.container.addClass(this.className('jcarousel-container')).css({position: 'relative'});if (!this.options.vertical && this.options.rtl) {this.container.addClass('jcarousel-direction-rtl').attr('dir', 'rtl');}var di = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null;var li = this.list.children('li');var self = this;if (li.size() > 0) {var wh = 0, j = this.options.offset;li.each(function() {self.format(this, j++);wh += self.dimension(this, di);});this.list.css(this.wh, (wh + 100) + 'px');if (!o || o.size === undefined) {this.options.size = li.size();}}this.container.css('display', 'block');this.buttonNext.css('display', 'block');this.buttonPrev.css('display', 'block');this.funcNext   = function() { self.next(); };this.funcPrev   = function() { self.prev(); };this.funcResize = function() { if (self.resizeTimer) {clearTimeout(self.resizeTimer);}self.resizeTimer = setTimeout(function() {self.reload();}, 100);};if (this.options.initCallback !== null) {this.options.initCallback(this, 'init');}if (!windowLoaded && $.browser.safari) {this.buttons(false, false);$(window).bind('load.jcarousel', function() { self.setup(); });} else {this.setup();}};var $jc = $.jcarousel;$jc.fn = $jc.prototype = {jcarousel: '0.2.8'};$jc.fn.extend = $jc.extend = $.extend;$jc.fn.extend({setup: function() {this.first       = null;this.last        = null;this.prevFirst   = null;this.prevLast    = null;this.animating   = false;this.timer       = null;this.resizeTimer = null;this.tail        = null;this.inTail      = false;if (this.locked) {return;}this.list.css(this.lt, this.pos(this.options.offset) + 'px');var p = this.pos(this.options.start, true);this.prevFirst = this.prevLast = null;this.animate(p, false);$(window).unbind('resize.jcarousel', this.funcResize).bind('resize.jcarousel', this.funcResize);if (this.options.setupCallback !== null) {this.options.setupCallback(this);}},reset: function() {this.list.empty();this.list.css(this.lt, '0px');this.list.css(this.wh, '10px');if (this.options.initCallback !== null) {this.options.initCallback(this, 'reset');}this.setup();},reload: function() {if (this.tail !== null && this.inTail) {this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);}this.tail   = null;this.inTail = false;if (this.options.reloadCallback !== null) {this.options.reloadCallback(this);}if (this.options.visible !== null) {var self = this;var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;this.list.children('li').each(function(i) {wh += self.dimension(this, di);if (i + 1 < self.first) {lt = wh;}});this.list.css(this.wh, wh + 'px');this.list.css(this.lt, -lt + 'px');}this.scroll(this.first, false);},lock: function() {this.locked = true;this.buttons();},unlock: function() {this.locked = false;this.buttons();},size: function(s) {if (s !== undefined) {this.options.size = s;if (!this.locked) {this.buttons();}}return this.options.size;},has: function(i, i2) {if (i2 === undefined || !i2) {i2 = i;}if (this.options.size !== null && i2 > this.options.size) {i2 = this.options.size;}for (var j = i; j <= i2; j++) {var e = this.get(j);if (!e.length || e.hasClass('jcarousel-item-placeholder')) {return false;}}return true;},get: function(i) {return $('>.jcarousel-item-' + i, this.list);},add: function(i, s) {var e = this.get(i), old = 0, n = $(s);if (e.length === 0) {var c, j = $jc.intval(i);e = this.create(i);while (true) {c = this.get(--j);if (j <= 0 || c.length) {if (j <= 0) {this.list.prepend(e);} else {c.after(e);}break;}}} else {old = this.dimension(e);}if (n.get(0).nodeName.toUpperCase() == 'LI') {e.replaceWith(n);e = n;} else {e.empty().append(s);}this.format(e.removeClass(this.className('jcarousel-item-placeholder')), i);var di = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null;var wh = this.dimension(e, di) - old;if (i > 0 && i < this.first) {this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');}this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');return e;},remove: function(i) {var e = this.get(i);if (!e.length || (i >= this.first && i <= this.last)) {return;}var d = this.dimension(e);if (i < this.first) {this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');}e.remove();this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');},next: function() {if (this.tail !== null && !this.inTail) {this.scrollTail(false);} else {this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size !== null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);}},prev: function() {if (this.tail !== null && this.inTail) {this.scrollTail(true);} else {this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size !== null && this.first == 1) ? this.options.size : this.first - this.options.scroll);}},scrollTail: function(b) {if (this.locked || this.animating || !this.tail) {return;}this.pauseAuto();var pos  = $jc.intval(this.list.css(this.lt));pos = !b ? pos - this.tail : pos + this.tail;this.inTail = !b;this.prevFirst = this.first;this.prevLast  = this.last;this.animate(pos);},scroll: function(i, a) {if (this.locked || this.animating) {return;}this.pauseAuto();this.animate(this.pos(i), a);},pos: function(i, fv) {var pos  = $jc.intval(this.list.css(this.lt));if (this.locked || this.animating) {return pos;}if (this.options.wrap != 'circular') {i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);}var back = this.first > i;var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;var c = back ? this.get(f) : this.get(this.last);var j = back ? f : f - 1;var e = null, l = 0, p = false, d = 0, g;while (back ? --j >= i : ++j < i) {e = this.get(j);p = !e.length;if (e.length === 0) {e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));c[back ? 'before' : 'after' ](e);if (this.first !== null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {g = this.get(this.index(j));if (g.length) {e = this.add(j, g.clone(true));}}}c = e;d = this.dimension(e);if (p) {l += d;}if (this.first !== null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size === null || j <= this.options.size)))) {pos = back ? pos + d : pos - d;}}var clipping = this.clipping(), cache = [], visible = 0, v = 0;c = this.get(i - 1);j = i;while (++visible) {e = this.get(j);p = !e.length;if (e.length === 0) {e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));if (c.length === 0) {this.list.prepend(e);} else {c[back ? 'before' : 'after' ](e);}if (this.first !== null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {g = this.get(this.index(j));if (g.length) {e = this.add(j, g.clone(true));}}}c = e;d = this.dimension(e);if (d === 0) {throw new Error('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');}if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size) {cache.push(e);} else if (p) {l += d;}v += d;if (v >= clipping) {break;}j++;}for (var x = 0; x < cache.length; x++) {cache[x].remove();}if (l > 0) {this.list.css(this.wh, this.dimension(this.list) + l + 'px');if (back) {pos -= l;this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');}}var last = i + visible - 1;if (this.options.wrap != 'circular' && this.options.size && last > this.options.size) {last = this.options.size;}if (j > last) {visible = 0;j = last;v = 0;while (++visible) {e = this.get(j--);if (!e.length) {break;}v += this.dimension(e);if (v >= clipping) {break;}}}var first = last - visible + 1;if (this.options.wrap != 'circular' && first < 1) {first = 1;}if (this.inTail && back) {pos += this.tail;this.inTail = false;}this.tail = null;if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {var m = $jc.intval(this.get(last).css(!this.options.vertical ? 'marginRight' : 'marginBottom'));if ((v - m) > clipping) {this.tail = v - clipping - m;}}if (fv && i === this.options.size && this.tail) {pos -= this.tail;this.inTail = true;}while (i-- > first) {pos += this.dimension(this.get(i));}this.prevFirst = this.first;this.prevLast  = this.last;this.first     = first;this.last      = last;return pos;},animate: function(p, a) {if (this.locked || this.animating) {return;}this.animating = true;var self = this;var scrolled = function() {self.animating = false;if (p === 0) {self.list.css(self.lt,  0);}if (!self.autoStopped && (self.options.wrap == 'circular' || self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size === null || self.last < self.options.size || (self.last == self.options.size && self.tail !== null && !self.inTail))) {self.startAuto();}self.buttons();self.notify('onAfterAnimation');if (self.options.wrap == 'circular' && self.options.size !== null) {for (var i = self.prevFirst; i <= self.prevLast; i++) {if (i !== null && !(i >= self.first && i <= self.last) && (i < 1 || i > self.options.size)) {self.remove(i);}}}};this.notify('onBeforeAnimation');if (!this.options.animation || a === false) {this.list.css(this.lt, p + 'px');scrolled();} else {var o = !this.options.vertical ? (this.options.rtl ? {'right': p} : {'left': p}) : {'top': p};var settings = {duration: this.options.animation,easing:   this.options.easing,complete: scrolled};if ($.isFunction(this.options.animationStepCallback)) {settings.step = this.options.animationStepCallback;}this.list.animate(o, settings);}},startAuto: function(s) {if (s !== undefined) {this.options.auto = s;}if (this.options.auto === 0) {return this.stopAuto();}if (this.timer !== null) {return;}this.autoStopped = false;var self = this;this.timer = window.setTimeout(function() { self.next(); }, this.options.auto * 1000);},stopAuto: function() {this.pauseAuto();this.autoStopped = true;},pauseAuto: function() {if (this.timer === null) {return;}window.clearTimeout(this.timer);this.timer = null;},buttons: function(n, p) {if (n == null) {n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size === null || this.last < this.options.size);if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size !== null && this.last >= this.options.size) {n = this.tail !== null && !this.inTail;}}if (p == null) {p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size !== null && this.first == 1) {p = this.tail !== null && this.inTail;}}var self = this;if (this.buttonNext.size() > 0) {this.buttonNext.unbind(this.options.buttonNextEvent + '.jcarousel', this.funcNext);if (n) {this.buttonNext.bind(this.options.buttonNextEvent + '.jcarousel', this.funcNext);}this.buttonNext[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);if (this.options.buttonNextCallback !== null && this.buttonNext.data('jcarouselstate') != n) {this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); }).data('jcarouselstate', n);}} else {if (this.options.buttonNextCallback !== null && this.buttonNextState != n) {this.options.buttonNextCallback(self, null, n);}}if (this.buttonPrev.size() > 0) {this.buttonPrev.unbind(this.options.buttonPrevEvent + '.jcarousel', this.funcPrev);if (p) {this.buttonPrev.bind(this.options.buttonPrevEvent + '.jcarousel', this.funcPrev);}this.buttonPrev[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);if (this.options.buttonPrevCallback !== null && this.buttonPrev.data('jcarouselstate') != p) {this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); }).data('jcarouselstate', p);}} else {if (this.options.buttonPrevCallback !== null && this.buttonPrevState != p) {this.options.buttonPrevCallback(self, null, p);}}this.buttonNextState = n;this.buttonPrevState = p;},notify: function(evt) {var state = this.prevFirst === null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');this.callback('itemLoadCallback', evt, state);if (this.prevFirst !== this.first) {this.callback('itemFirstInCallback', evt, state, this.first);this.callback('itemFirstOutCallback', evt, state, this.prevFirst);}if (this.prevLast !== this.last) {this.callback('itemLastInCallback', evt, state, this.last);this.callback('itemLastOutCallback', evt, state, this.prevLast);}this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);},callback: function(cb, evt, state, i1, i2, i3, i4) {if (this.options[cb] == null || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation')) {return;}var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];if (!$.isFunction(callback)) {return;}var self = this;if (i1 === undefined) {callback(self, state, evt);} else if (i2 === undefined) {this.get(i1).each(function() { callback(self, this, i1, state, evt); });} else {var call = function(i) {self.get(i).each(function() { callback(self, this, i, state, evt); });};for (var i = i1; i <= i2; i++) {if (i !== null && !(i >= i3 && i <= i4)) {call(i);}}}},create: function(i) {return this.format('<li></li>', i);},format: function(e, i) {e = $(e);var split = e.get(0).className.split(' ');for (var j = 0; j < split.length; j++) {if (split[j].indexOf('jcarousel-') != -1) {e.removeClass(split[j]);}}e.addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i)).css({'float': (this.options.rtl ? 'right' : 'left'),'list-style': 'none'}).attr('jcarouselindex', i);return e;},className: function(c) {return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');},dimension: function(e, d) {var el = $(e);if (d == null) {return !this.options.vertical ?(el.outerWidth(true) || $jc.intval(this.options.itemFallbackDimension)) :(el.outerHeight(true) || $jc.intval(this.options.itemFallbackDimension));} else {var w = !this.options.vertical ?d - $jc.intval(el.css('marginLeft')) - $jc.intval(el.css('marginRight')) :d - $jc.intval(el.css('marginTop')) - $jc.intval(el.css('marginBottom'));$(el).css(this.wh, w + 'px');return this.dimension(el);}},clipping: function() {return !this.options.vertical ?this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) :this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));},index: function(i, s) {if (s == null) {s = this.options.size;}return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;}});$jc.extend({defaults: function(d) {return $.extend(defaults, d || {});},intval: function(v) {v = parseInt(v, 10);return isNaN(v) ? 0 : v;},windowLoaded: function() {windowLoaded = true;}});$.fn.jcarousel = function(o) {if (typeof o == 'string') {var instance = $(this).data('jcarousel'), args = Array.prototype.slice.call(arguments, 1);return instance[o].apply(instance, args);} else {return this.each(function() {var instance = $(this).data('jcarousel');if (instance) {if (o) {$.extend(instance.options, o);}instance.reload();} else {$(this).data('jcarousel', new $jc(this, o));}});}};})(jQuery);

/*colorbox*/

// ColorBox v1.3.18 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function ($, document, window) {
var
defaults = {
transition: "elastic",
speed: 300,
width: false,
initialWidth: "600",
innerWidth: false,
maxWidth: false,
height: false,
initialHeight: "450",
innerHeight: false,
maxHeight: false,
scalePhotos: true,
scrolling: true,
inline: false,
html: false,
iframe: false,
fastIframe: true,
photo: false,
href: false,
title: false,
rel: false,
opacity: 0.9,
preloading: true,
current: "",
previous: "previous",
next: "next",
close: "close",
open: false,
returnFocus: true,
loop: true,
slideshow: false,
slideshowAuto: true,
slideshowSpeed: 2500,
slideshowStart: "start slideshow",
slideshowStop: "stop slideshow",
onOpen: false,
onLoad: false,
onComplete: false,
onCleanup: false,
onClosed: false,
overlayClose: true,		
escKey: true,
arrowKey: true,
top: false,
bottom: false,
left: false,
right: false,
fixed: false,
data: undefined},

colorbox = 'colorbox',prefix = 'cbox',boxElement = prefix + 'Element',event_open = prefix + '_open',event_load = prefix + '_load',event_complete = prefix + '_complete',event_cleanup = prefix + '_cleanup',event_closed = prefix + '_closed',event_purge = prefix + '_purge',isIE = $.browser.msie && !$.support.opacity,isIE6 = isIE && $.browser.version < 7,event_ie6 = prefix + '_IE6',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,photo,open,active,closing,loadingTimer,publicMethod,div = "div";

function $tag(tag, id, css) {var element = document.createElement(tag);if (id) {element.id = prefix + id;}if (css) {element.style.cssText = css;}return $(element);}
function getIndex(increment) {var max = $related.length, newIndex = (index + increment) % max;return (newIndex < 0) ? max + newIndex : newIndex;}
function setSize(size, dimension) {return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));}
function isImage(url) {return settings.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(url);}
function makeSettings() {var i;settings = $.extend({}, $.data(element, colorbox));for (i in settings) {if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { settings[i] = settings[i].call(element);}}settings.rel = settings.rel || element.rel || 'nofollow';settings.href = settings.href || $(element).attr('href');settings.title = settings.title || element.title;if (typeof settings.href === "string") {settings.href = $.trim(settings.href);}}
function trigger(event, callback) {$.event.trigger(event);if (callback) {callback.call(element);}}
function slideshow() {var
timeOut,className = prefix + "Slideshow_",click = "click." + prefix,start,stop,clear;if (settings.slideshow && $related[1]) {start = function () {$slideshow.text(settings.slideshowStop).unbind(click).bind(event_complete, function () {if (index < $related.length - 1 || settings.loop) {timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);}}).bind(event_load, function () {clearTimeout(timeOut);}).one(click + ' ' + event_cleanup, stop);$box.removeClass(className + "off").addClass(className + "on");timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);};stop = function () {clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind([event_complete, event_load, event_cleanup, click].join(' ')).one(click, function () {publicMethod.next();start();});$box.removeClass(className + "on").addClass(className + "off");};if (settings.slideshowAuto) {start();} else {stop();}} else {$box.removeClass(className + "off " + className + "on");}}function launch(target) {if (!closing) {element = target;makeSettings();$related = $(element);index = 0;if (settings.rel !== 'nofollow') {$related = $('.' + boxElement).filter(function () {var relRelated = $.data(this, colorbox).rel || this.rel;return (relRelated === settings.rel);});index = $related.index(element);if (index === -1) {$related = $related.add(element);index = $related.length - 1;}}if (!open) {open = active = true; $box.show();if (settings.returnFocus) {try {element.blur();$(element).one(event_closed, function () {try {this.focus();} catch (e) {}});} catch (e) {}}$overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();settings.w = setSize(settings.initialWidth, 'x');settings.h = setSize(settings.initialHeight, 'y');publicMethod.position();if (isIE6) {$window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {$overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});}).trigger('resize.' + event_ie6);}trigger(event_open, settings.onOpen);$groupControls.add($title).hide();$close.html(settings.close).show();}publicMethod.load(true);}}publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {var $this = this;options = options || {};publicMethod.init();if (!$this[0]) {if ($this.selector) { return $this;}$this = $('<a/>');options.open = true; }if (callback) {options.onComplete = callback;}$this.each(function () {$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));$(this).addClass(boxElement);});if (($.isFunction(options.open) && options.open.call($this)) || options.open) {launch($this[0]);}return $this;};publicMethod.init = function () {if (!$box) {if (!$('body')[0]) {$(publicMethod.init);return;}$window = $(window);$box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''});$overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();$wrap = $tag(div, "Wrapper");$content = $tag(div, "Content").append($loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),$loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")),$title = $tag(div, "Title"),$current = $tag(div, "Current"),$next = $tag(div, "Next"),$prev = $tag(div, "Previous"),$slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),$close = $tag(div, "Close"));$wrap.append($tag(div).append($tag(div, "TopLeft"),$topBorder = $tag(div, "TopCenter"),$tag(div, "TopRight")),$tag(div, false, 'clear:left').append($leftBorder = $tag(div, "MiddleLeft"),$content,$rightBorder = $tag(div, "MiddleRight")),$tag(div, false, 'clear:left').append($tag(div, "BottomLeft"),$bottomBorder = $tag(div, "BottomCenter"),$tag(div, "BottomRight"))).find('div div').css({'float': 'left'});$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');$('body').prepend($overlay, $box.append($wrap, $loadingBay));interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();loadedHeight = $loaded.outerHeight(true);loadedWidth = $loaded.outerWidth(true);$box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}).hide();$next.click(function () {publicMethod.next();});$prev.click(function () {publicMethod.prev();});$close.click(function () {publicMethod.close();});$groupControls = $next.add($prev).add($current).add($slideshow);$overlay.click(function () {if (settings.overlayClose) {publicMethod.close();}});$(document).bind('keydown.' + prefix, function (e) {var key = e.keyCode;if (open && settings.escKey && key === 27) {e.preventDefault();publicMethod.close();}if (open && settings.arrowKey && $related[1]) {if (key === 37) {e.preventDefault();$prev.click();} else if (key === 39) {e.preventDefault();$next.click();}}});}};publicMethod.remove = function () {$box.add($overlay).remove();$box = null;$('.' + boxElement).removeData(colorbox).removeClass(boxElement);};publicMethod.position = function (speed, loadedCallback) {var top = 0, left = 0, offset = $box.offset();$window.unbind('resize.' + prefix);$box.css({top: -99999, left: -99999});if (settings.fixed && !isIE6) {$box.css({position: 'fixed'});} else {top = $window.scrollTop();left = $window.scrollLeft();$box.css({position: 'absolute'});}if (settings.right !== false) {left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);} else if (settings.left !== false) {left += setSize(settings.left, 'x');} else {left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);}if (settings.bottom !== false) {top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);} else if (settings.top !== false) {top += setSize(settings.top, 'y');} else {top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);}$box.css({top: offset.top, left: offset.left});speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;$wrap[0].style.width = $wrap[0].style.height = "9999px";function modalDimensions(that) {$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;$loadingOverlay[0].style.height = $loadingOverlay[1].style.height = $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;}$box.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left}, {duration: speed,complete: function () {modalDimensions(this);active = false;$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";if (loadedCallback) {loadedCallback();}setTimeout(function () {  $window.bind('resize.' + prefix, publicMethod.position);}, 1);},step: function () {modalDimensions(this);}});};publicMethod.resize = function (options) {if (open) {options = options || {};if (options.width) {settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;}if (options.innerWidth) {settings.w = setSize(options.innerWidth, 'x');}$loaded.css({width: settings.w});if (options.height) {settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;}if (options.innerHeight) {settings.h = setSize(options.innerHeight, 'y');}if (!options.innerHeight && !options.height) {$loaded.css({height: "auto"});settings.h = $loaded.height();}$loaded.css({height: settings.h});publicMethod.position(settings.transition === "none" ? 0 : settings.speed);}};publicMethod.prep = function (object) {if (!open) {return;}var callback, speed = settings.transition === "none" ? 0 : settings.speed;$loaded.remove();$loaded = $tag(div, 'LoadedContent').append(object);function getWidth() {settings.w = settings.w || $loaded.width();settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;return settings.w;}function getHeight() {settings.h = settings.h || $loaded.height();settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;return settings.h;}$loaded.hide().appendTo($loadingBay.show()).css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'}).css({height: getHeight()}).prependTo($content);$loadingBay.hide();$(photo).css({'float': 'none'});if (isIE6) {$('select').not($box.find('select')).filter(function () {return this.style.visibility !== 'hidden';}).css({'visibility': 'hidden'}).one(event_cleanup, function () {this.style.visibility = 'inherit';});}callback = function () {var preload, i, total = $related.length, iframe, frameBorder = 'frameBorder', allowTransparency = 'allowTransparency', complete, src, img;if (!open) {return;}function removeFilter() {if (isIE) {$box[0].style.removeAttribute('filter');}}complete = function () {clearTimeout(loadingTimer);$loadingOverlay.hide();trigger(event_complete, settings.onComplete);};if (isIE) {if (photo) {$loaded.fadeIn(100);}}$title.html(settings.title).add($loaded).show();if (total > 1) {if (typeof settings.current === "string") {$current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();}$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);if (settings.slideshow) {$slideshow.show();}if (settings.preloading) {preload = [getIndex(-1),getIndex(1)];while ((i = $related[preload.pop()])) {src = $.data(i, colorbox).href || i.href;if ($.isFunction(src)) {src = src.call(i);}if (isImage(src)) {img = new Image();img.src = src;}}}} else {$groupControls.hide();}if (settings.iframe) {iframe = $tag('iframe')[0];if (frameBorder in iframe) {iframe[frameBorder] = 0;}if (allowTransparency in iframe) {iframe[allowTransparency] = "true";}iframe.name = prefix + (+new Date());if (settings.fastIframe) {complete();} else {$(iframe).one('load', complete);}iframe.src = settings.href;if (!settings.scrolling) {iframe.scrolling = "no";}$(iframe).addClass(prefix + 'Iframe').appendTo($loaded).one(event_purge, function () {iframe.src = "//about:blank";});} else {complete();}if (settings.transition === 'fade') {$box.fadeTo(speed, 1, removeFilter);} else {removeFilter();}};if (settings.transition === 'fade') {$box.fadeTo(speed, 0, function () {publicMethod.position(0, callback);});} else {publicMethod.position(speed, callback);}};publicMethod.load = function (launched) {var href, setResize, prep = publicMethod.prep;active = true;photo = false;element = $related[index];if (!launched) {makeSettings();}trigger(event_purge);trigger(event_load, settings.onLoad);settings.h = settings.height ?setSize(settings.height, 'y') - loadedHeight - interfaceHeight :settings.innerHeight && setSize(settings.innerHeight, 'y');settings.w = settings.width ?setSize(settings.width, 'x') - loadedWidth - interfaceWidth :settings.innerWidth && setSize(settings.innerWidth, 'x');settings.mw = settings.w;settings.mh = settings.h;if (settings.maxWidth) {settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;}if (settings.maxHeight) {settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;}href = settings.href;loadingTimer = setTimeout(function () {$loadingOverlay.show();}, 100);if (settings.inline) {$tag(div).hide().insertBefore($(href)[0]).one(event_purge, function () {$(this).replaceWith($loaded.children());});prep($(href));} else if (settings.iframe) {prep(" ");} else if (settings.html) {prep(settings.html);} else if (isImage(href)) {$(photo = new Image()).addClass(prefix + 'Photo').error(function () {settings.title = false;prep($tag(div, 'Error').text('This image could not be loaded'));}).load(function () {var percent;photo.onload = null;if (settings.scalePhotos) {setResize = function () {photo.height -= photo.height * percent;photo.width -= photo.width * percent;	};if (settings.mw && photo.width > settings.mw) {percent = (photo.width - settings.mw) / photo.width;setResize();}if (settings.mh && photo.height > settings.mh) {percent = (photo.height - settings.mh) / photo.height;setResize();}}if (settings.h) {photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';}if ($related[1] && (index < $related.length - 1 || settings.loop)) {photo.style.cursor = 'pointer';photo.onclick = function () {publicMethod.next();};}if (isIE) {photo.style.msInterpolationMode = 'bicubic';}setTimeout(function () { prep(photo);}, 1);});setTimeout(function () { photo.src = href;}, 1);} else if (href) {$loadingBay.load(href, settings.data, function (data, status, xhr) {prep(status === 'error' ? $tag(div, 'Error').text('Request unsuccessful: ' + xhr.statusText) : $(this).contents());});}};publicMethod.next = function () {if (!active && $related[1] && (index < $related.length - 1 || settings.loop)) {index = getIndex(1);publicMethod.load();}};publicMethod.prev = function () {if (!active && $related[1] && (index || settings.loop)) {index = getIndex(-1);publicMethod.load();}};publicMethod.close = function () {if (open && !closing) {closing = true;open = false;trigger(event_cleanup, settings.onCleanup);$window.unbind('.' + prefix + ' .' + event_ie6);$overlay.fadeTo(200, 0);$box.stop().fadeTo(300, 0, function () {$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();trigger(event_purge);$loaded.remove();setTimeout(function () {closing = false;trigger(event_closed, settings.onClosed);}, 1);});}};publicMethod.element = function () {return $(element);};publicMethod.settings = defaults;$('.' + boxElement, document).live('click', function (e) {if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {e.preventDefault();launch(this);}});publicMethod.init();}(jQuery, document, this));
