/**
 * Znamenazor.cz v1.0 - da0af05f747ed0f128781bc73bd245ad1dad6e5a
 * --
 * copyright (c) 2010 - 2011 Tomas Flekna 
 * compiled: 06.09.2011 
 **/

/****
 * Plugin - Alphanumeric
 **/
(function($){$.fn.alphanumeric = function(p) {p = $.extend({ichars: "!@#$%^&*()+=[]\\\';,/{}|\":<>?~`.- ",nchars: "",allow: ""}, p);return this.each(function(){if (p.nocaps) p.nchars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";if (p.allcaps) p.nchars += "abcdefghijklmnopqrstuvwxyz";s = p.allow.split('');for ( i=0;i<s.length;i++) if (p.ichars.indexOf(s[i]) != -1) s[i] = "\\" + s[i];p.allow = s.join('|');var reg = new RegExp(p.allow,'gi');var ch = p.ichars + p.nchars;ch = ch.replace(reg,'');$(this).keypress(function (e){if (!e.charCode) k = String.fromCharCode(e.which);else k = String.fromCharCode(e.charCode);if (ch.indexOf(k) != -1) e.preventDefault();if (e.ctrlKey&&k=='v') e.preventDefault();});$(this).bind('contextmenu',function () {return false});});};$.fn.numeric = function(p) {var az = "abcdefghijklmnopqrstuvwxyz";az += az.toUpperCase();p = $.extend({nchars: az}, p);return this.each (function(){$(this).alphanumeric(p);});};$.fn.alpha = function(p) {var nm = "1234567890";p = $.extend({nchars: nm}, p);return this.each (function(){$(this).alphanumeric(p);});};})(jQuery);

/****
 * jQuery.ScrollTo (http://flesler.blogspot.com/2007/10/jqueryscrollto.html) - Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com, Dual licensed under MIT and GPL.
 **/
(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

/****
 * jQuery Image Cropping Plugin v0.9.8 - @author Kelly Hallman <khallman@gmail.com,released under MIT License
 **/
(function() {jQuery.Jcrop = function(obj,opt){var obj = obj, opt = opt;if (typeof(obj) !== 'object') obj = jQuery(obj)[0];if (typeof(opt) !== 'object') opt = { };if (!('trackDocument' in opt)){opt.trackDocument = jQuery.browser.msie ? false : true;if (jQuery.browser.msie && jQuery.browser.version.split('.')[0] == '8')opt.trackDocument = true;}if (!('keySupport' in opt))opt.keySupport = jQuery.browser.msie ? false : true;var defaults = {trackDocument:		false,baseClass:			'jcrop',addClass:			null,bgColor:			'black',bgOpacity:			.6,borderOpacity:		.4,handleOpacity:		.5,handlePad:			5,handleSize:			9,handleOffset:		5,edgeMargin:			14,aspectRatio:		0,keySupport:			true,cornerHandles:		true,sideHandles:		true,drawBorders:		true,dragEdges:			true,boxWidth:			0,boxHeight:			0,boundary:			8,animationDelay:		20,swingSpeed:			3,allowSelect:		true,allowMove:			true,allowResize:		true,minSelect:			[ 0, 0 ],maxSize:			[ 0, 0 ],minSize:			[ 0, 0 ],onChange: function() { },onSelect: function() { }};var options = defaults;setOptions(opt);var $origimg = jQuery(obj);var $img = $origimg.clone().removeAttr('id').css({ position: 'absolute' });$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx = $img.width(),boundy = $img.height(),$div = jQuery('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position: 'relative',backgroundColor: options.bgColor}).insertAfter($origimg).append($img);;if (options.addClass) $div.addClass(options.addClass);var $img2 = jQuery('<img />')/*{{{*/.attr('src',$img.attr('src')).css('position','absolute').width(boundx).height(boundy);/*}}}*/var $img_holder = jQuery('<div />')/*{{{*/.width(pct(100)).height(pct(100)).css({zIndex: 310,position: 'absolute',overflow: 'hidden'}).append($img2);/*}}}*/var $hdl_holder = jQuery('<div />')/*{{{*/.width(pct(100)).height(pct(100)).css('zIndex',320);/*}}}*/var $sel = jQuery('<div />')/*{{{*/.css({position: 'absolute',zIndex: 300}).insertBefore($img).append($img_holder,$hdl_holder);/*}}}*/var bound = options.boundary;var $trk = newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({ position: 'absolute', top: px(-bound), left: px(-bound), zIndex: 290 }).mousedown(newSelection);/* }}} */var xlimit, ylimit, xmin, ymin;var xscale, yscale, enabled = true;var docOffset = getPos($img),btndown, lastcurs, dimmed, animating,shift_down;var Coords = function()/*{{{*/{var x1 = 0, y1 = 0, x2 = 0, y2 = 0, ox, oy;function setPressed(pos)/*{{{*/{var pos = rebound(pos);x2 = x1 = pos[0];y2 = y1 = pos[1];};/*}}}*/function setCurrent(pos)/*{{{*/{var pos = rebound(pos);ox = pos[0] - x2;oy = pos[1] - y2;x2 = pos[0];y2 = pos[1];};/*}}}*/function getOffset()/*{{{*/{return [ ox, oy ];};/*}}}*/function moveOffset(offset)/*{{{*/{var ox = offset[0], oy = offset[1];if (0 > x1 + ox) ox -= ox + x1;if (0 > y1 + oy) oy -= oy + y1;if (boundy < y2 + oy) oy += boundy - (y2 + oy);if (boundx < x2 + ox) ox += boundx - (x2 + ox);x1 += ox;x2 += ox;y1 += oy;y2 += oy;};/*}}}*/function getCorner(ord)/*{{{*/{var c = getFixed();switch(ord){case 'ne': return [ c.x2, c.y ];case 'nw': return [ c.x, c.y ];case 'se': return [ c.x2, c.y2 ];case 'sw': return [ c.x, c.y2 ];}};/*}}}*/function getFixed()/*{{{*/{if (!options.aspectRatio) return getRect();var aspect = options.aspectRatio,min_x = options.minSize[0]/xscale,min_y = options.minSize[1]/yscale,max_x = options.maxSize[0]/xscale,max_y = options.maxSize[1]/yscale,rw = x2 - x1,rh = y2 - y1;var	rwa = rw < 0 ? -rw : rw;var	rha = rh < 0 ? -rh : rh;var	real_ratio = rwa / rha;var xx, yy, h, w;if (max_x == 0) { max_x = boundx * 10 }if (max_y == 0) { max_y = boundy * 10 }if (real_ratio < aspect){yy = y2;w = rha * aspect;xx = rw < 0 ? x1 - w : w + x1;if (xx < 0){xx = 0;h = Math.abs((xx - x1) / aspect);yy = rh < 0 ? y1 - h: h + y1;}else if (xx > boundx){xx = boundx;h = Math.abs((xx - x1) / aspect);yy = rh < 0 ? y1 - h : h + y1;}}else{xx = x2;h = rwa / aspect;yy = rh < 0 ? y1 - h : y1 + h;if (yy < 0){yy = 0;w = Math.abs((yy - y1) * aspect);xx = rw < 0 ? x1 - w : w + x1;}else if (yy > boundy){yy = boundy;w = Math.abs(yy - y1) * aspect;xx = rw < 0 ? x1 - w : w + x1;}}if(xx > x1) {if(xx - x1 < min_x) {xx = x1 + min_x;} else if (xx - x1 > max_x) {xx = x1 + max_x;}if(yy > y1) {yy = y1 + (xx - x1)/aspect;} else {yy = y1 - (xx - x1)/aspect;}} else if (xx < x1) {if(x1 - xx < min_x) {xx = x1 - min_x} else if (x1 - xx > max_x) {xx = x1 - max_x;}if(yy > y1) {yy = y1 + (x1 - xx)/aspect;} else {yy = y1 - (x1 - xx)/aspect;}}if(xx < 0) {x1 -= xx;xx = 0;} else  if (xx > boundx) {x1 -= xx - boundx;xx = boundx;}if(yy < 0) {y1 -= yy;yy = 0;} else  if (yy > boundy) {y1 -= yy - boundy;yy = boundy;}return makeObj(flipCoords(x1,y1,xx,yy));};/*}}}*/function rebound(p)/*{{{*/{if (p[0] < 0) p[0] = 0;if (p[1] < 0) p[1] = 0;if (p[0] > boundx) p[0] = boundx;if (p[1] > boundy) p[1] = boundy;return [ p[0], p[1] ];};/*}}}*/function flipCoords(x1,y1,x2,y2)/*{{{*/{var xa = x1, xb = x2, ya = y1, yb = y2;if (x2 < x1){xa = x2;xb = x1;}if (y2 < y1){ya = y2;yb = y1;}return [ Math.round(xa), Math.round(ya), Math.round(xb), Math.round(yb) ];};/*}}}*/function getRect()/*{{{*/{var xsize = x2 - x1;var ysize = y2 - y1;if (xlimit && (Math.abs(xsize) > xlimit))x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);if (ylimit && (Math.abs(ysize) > ylimit))y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);if (ymin && (Math.abs(ysize) < ymin))y2 = (ysize > 0) ? (y1 + ymin) : (y1 - ymin);if (xmin && (Math.abs(xsize) < xmin))x2 = (xsize > 0) ? (x1 + xmin) : (x1 - xmin);if (x1 < 0) { x2 -= x1; x1 -= x1; }if (y1 < 0) { y2 -= y1; y1 -= y1; }if (x2 < 0) { x1 -= x2; x2 -= x2; }if (y2 < 0) { y1 -= y2; y2 -= y2; }if (x2 > boundx) { var delta = x2 - boundx; x1 -= delta; x2 -= delta; }if (y2 > boundy) { var delta = y2 - boundy; y1 -= delta; y2 -= delta; }if (x1 > boundx) { var delta = x1 - boundy; y2 -= delta; y1 -= delta; }if (y1 > boundy) { var delta = y1 - boundy; y2 -= delta; y1 -= delta; }return makeObj(flipCoords(x1,y1,x2,y2));};/*}}}*/function makeObj(a)/*{{{*/{return { x: a[0], y: a[1], x2: a[2], y2: a[3], w: a[2] - a[0], h: a[3] - a[1] };};/*}}}*/return {flipCoords: flipCoords,setPressed: setPressed,setCurrent: setCurrent,getOffset: getOffset,moveOffset: moveOffset,getCorner: getCorner,getFixed: getFixed};}();/*}}}*/var Selection = function()/*{{{*/{var start, end, dragmode, awake, hdep = 370;var borders = { };var handle = { };var seehandles = false;var hhs = options.handleOffset;/* Insert draggable elements {{{*/if (options.drawBorders) {borders = {top: insertBorder('hline').css('top',jQuery.browser.msie?px(-1):px(0)),bottom: insertBorder('hline'),left: insertBorder('vline'),right: insertBorder('vline')};}if (options.dragEdges) {handle.t = insertDragbar('n');handle.b = insertDragbar('s');handle.r = insertDragbar('e');handle.l = insertDragbar('w');}options.sideHandles &&createHandles(['n','s','e','w']);options.cornerHandles &&createHandles(['sw','nw','ne','se']);/*}}}*/function insertBorder(type)/*{{{*/{var jq = jQuery('<div />').css({position: 'absolute', opacity: options.borderOpacity }).addClass(cssClass(type));$img_holder.append(jq);return jq;};/*}}}*/function dragDiv(ord,zi)/*{{{*/{var jq = jQuery('<div />').mousedown(createDragger(ord)).css({cursor: ord+'-resize',position: 'absolute',zIndex: zi});$hdl_holder.append(jq);return jq;};/*}}}*/function insertHandle(ord)/*{{{*/{return dragDiv(ord,hdep++).css({ top: px(-hhs+1), left: px(-hhs+1), opacity: options.handleOpacity }).addClass(cssClass('handle'));};/*}}}*/function insertDragbar(ord)/*{{{*/{var s = options.handleSize,o = hhs,h = s, w = s,t = o, l = o;switch(ord){case 'n': case 's': w = pct(100); break;case 'e': case 'w': h = pct(100); break;}return dragDiv(ord,hdep++).width(w).height(h).css({ top: px(-t+1), left: px(-l+1)});};/*}}}*/function createHandles(li)/*{{{*/{for(i in li) handle[li[i]] = insertHandle(li[i]);};/*}}}*/function moveHandles(c)/*{{{*/{var midvert  = Math.round((c.h / 2) - hhs),midhoriz = Math.round((c.w / 2) - hhs),north = west = -hhs+1,east = c.w - hhs,south = c.h - hhs,x, y;'e' in handle &&handle.e.css({ top: px(midvert), left: px(east) }) &&handle.w.css({ top: px(midvert) }) &&handle.s.css({ top: px(south), left: px(midhoriz) }) &&handle.n.css({ left: px(midhoriz) });'ne' in handle &&handle.ne.css({ left: px(east) }) &&handle.se.css({ top: px(south), left: px(east) }) &&handle.sw.css({ top: px(south) });'b' in handle &&handle.b.css({ top: px(south) }) &&handle.r.css({ left: px(east) });};/*}}}*/function moveto(x,y)/*{{{*/{$img2.css({ top: px(-y), left: px(-x) });$sel.css({ top: px(y), left: px(x) });};/*}}}*/function resize(w,h)/*{{{*/{$sel.width(w).height(h);};/*}}}*/function refresh()/*{{{*/{var c = Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();};/*}}}*/function updateVisible()/*{{{*/{ if (awake) return update(); };/*}}}*/function update()/*{{{*/{var c = Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders &&borders['right'].css({ left: px(c.w-1) }) &&borders['bottom'].css({ top: px(c.h-1) });seehandles && moveHandles(c);awake || show();options.onChange(unscale(c));};/*}}}*/function show()/*{{{*/{$sel.show();$img.css('opacity',options.bgOpacity);awake = true;};/*}}}*/function release()/*{{{*/{disableHandles();$sel.hide();$img.css('opacity',1);awake = false;};/*}}}*/function showHandles()/*{{{*/{if (seehandles){moveHandles(Coords.getFixed());$hdl_holder.show();}};/*}}}*/function enableHandles()/*{{{*/{seehandles = true;if (options.allowResize){moveHandles(Coords.getFixed());$hdl_holder.show();return true;}};/*}}}*/function disableHandles()/*{{{*/{seehandles = false;$hdl_holder.hide();};/*}}}*/function animMode(v)/*{{{*/{(animating = v) ? disableHandles(): enableHandles();};/*}}}*/function done()/*{{{*/{animMode(false);refresh();};/*}}}*/var $track = newTracker().mousedown(createDragger('move')).css({ cursor: 'move', position: 'absolute', zIndex: 360 });$img_holder.append($track);disableHandles();return {updateVisible: updateVisible,update: update,release: release,refresh: refresh,setCursor: function (cursor) { $track.css('cursor',cursor); },enableHandles: enableHandles,enableOnly: function() { seehandles = true; },showHandles: showHandles,disableHandles: disableHandles,animMode: animMode,done: done};}();/*}}}*/var Tracker = function()/*{{{*/{var onMove		= function() { },onDone		= function() { },trackDoc	= options.trackDocument;if (!trackDoc){$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}function toFront()/*{{{*/{$trk.css({zIndex:450});if (trackDoc){jQuery(document).mousemove(trackMove).mouseup(trackUp);}}/*}}}*/function toBack()/*{{{*/{$trk.css({zIndex:290});if (trackDoc){jQuery(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}}/*}}}*/function trackMove(e)/*{{{*/{onMove(mouseAbs(e));};/*}}}*/function trackUp(e)/*{{{*/{e.preventDefault();e.stopPropagation();if (btndown){btndown = false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove = function() { };onDone = function() { };}return false;};/*}}}*/function activateHandlers(move,done)/* {{{ */{btndown = true;onMove = move;onDone = done;toFront();return false;};/* }}} */function setCursor(t) { $trk.css('cursor',t); };$img.before($trk);return {activateHandlers: activateHandlers,setCursor: setCursor};}();/*}}}*/var KeyManager = function()/*{{{*/{var $keymgr = jQuery('<input type="radio" />').css({ position: 'absolute', left: '-30px' }).keypress(parseKey).blur(onBlur),$keywrap = jQuery('<div />').css({position: 'absolute',overflow: 'hidden'}).append($keymgr);function watchKeys()/*{{{*/{if (options.keySupport){$keymgr.show();$keymgr.focus();}};/*}}}*/function onBlur(e)/*{{{*/{$keymgr.hide();};/*}}}*/function doNudge(e,x,y)/*{{{*/{if (options.allowMove) {Coords.moveOffset([x,y]);Selection.updateVisible();};e.preventDefault();e.stopPropagation();};/*}}}*/function parseKey(e)/*{{{*/{if (e.ctrlKey) return true;shift_down = e.shiftKey ? true : false;var nudge = shift_down ? 10 : 1;switch(e.keyCode){case 37: doNudge(e,-nudge,0); break;case 39: doNudge(e,nudge,0); break;case 38: doNudge(e,0,-nudge); break;case 40: doNudge(e,0,nudge); break;case 27: Selection.release(); break;case 9: return true;}return nothing(e);};/*}}}*/if (options.keySupport) $keywrap.insertBefore($img);return {watchKeys: watchKeys};}();/*}}}*/function px(n) { return '' + parseInt(n) + 'px'; };function pct(n) { return '' + parseInt(n) + '%'; };function cssClass(cl) { return options.baseClass + '-' + cl; };function getPos(obj)/*{{{*/{var pos = jQuery(obj).offset();return [ pos.left, pos.top ];};/*}}}*/function mouseAbs(e)/*{{{*/{return [ (e.pageX - docOffset[0]), (e.pageY - docOffset[1]) ];};/*}}}*/function myCursor(type)/*{{{*/{if (type != lastcurs){Tracker.setCursor(type);lastcurs = type;}};/*}}}*/function startDragMode(mode,pos)/*{{{*/{docOffset = getPos($img);Tracker.setCursor(mode=='move'?mode:mode+'-resize');if (mode == 'move')return Tracker.activateHandlers(createMover(pos), doneSelect);var fc = Coords.getFixed();var opp = oppLockCorner(mode);var opc = Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);};/*}}}*/function dragmodeHandler(mode,f)/*{{{*/{return function(pos) {if (!options.aspectRatio) switch(mode){case 'e': pos[1] = f.y2; break;case 'w': pos[1] = f.y2; break;case 'n': pos[0] = f.x2; break;case 's': pos[0] = f.x2; break;}else switch(mode){case 'e': pos[1] = f.y+1; break;case 'w': pos[1] = f.y+1; break;case 'n': pos[0] = f.x+1; break;case 's': pos[0] = f.x+1; break;}Coords.setCurrent(pos);Selection.update();};};/*}}}*/function createMover(pos)/*{{{*/{var lloc = pos;KeyManager.watchKeys();return function(pos){Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]);lloc = pos;Selection.update();};};/*}}}*/function oppLockCorner(ord)/*{{{*/{switch(ord){case 'n': return 'sw';case 's': return 'nw';case 'e': return 'nw';case 'w': return 'ne';case 'ne': return 'sw';case 'nw': return 'se';case 'se': return 'nw';case 'sw': return 'ne';};};/*}}}*/function createDragger(ord)/*{{{*/{return function(e) {if (options.disabled) return false;if ((ord == 'move') && !options.allowMove) return false;btndown = true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};};/*}}}*/function presize($obj,w,h)/*{{{*/{var nw = $obj.width(), nh = $obj.height();if ((nw > w) && w > 0){nw = w;nh = (w/$obj.width()) * $obj.height();}if ((nh > h) && h > 0){nh = h;nw = (h/$obj.height()) * $obj.width();}xscale = $obj.width() / nw;yscale = $obj.height() / nh;$obj.width(nw).height(nh);};/*}}}*/function unscale(c)/*{{{*/{return {x: parseInt(c.x * xscale), y: parseInt(c.y * yscale),x2: parseInt(c.x2 * xscale), y2: parseInt(c.y2 * yscale),w: parseInt(c.w * xscale), h: parseInt(c.h * yscale)/*,myID: options.myBlockId*/};};/*}}}*/function doneSelect(pos)/*{{{*/{var c = Coords.getFixed();if (c.w > options.minSelect[0] && c.h > options.minSelect[1]){Selection.enableHandles();Selection.done();}else{Selection.release();}Tracker.setCursor( options.allowSelect?'crosshair':'default' );};/*}}}*/function newSelection(e)/*{{{*/{if (options.disabled) return false;if (!options.allowSelect) return false;btndown = true;docOffset = getPos($img);Selection.disableHandles();myCursor('crosshair');var pos = mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;};/*}}}*/function selectDrag(pos)/*{{{*/{Coords.setCurrent(pos);Selection.update();};/*}}}*/function newTracker(){var trk = jQuery('<div></div>').addClass(cssClass('tracker'));jQuery.browser.msie && trk.css({ opacity: 0, backgroundColor: 'white' });return trk;};function animateTo(a)/*{{{*/{var x1 = a[0] / xscale,y1 = a[1] / yscale,x2 = a[2] / xscale,y2 = a[3] / yscale;if (animating) return;var animto = Coords.flipCoords(x1,y1,x2,y2);var c = Coords.getFixed();var animat = initcr = [ c.x, c.y, c.x2, c.y2 ];var interv = options.animationDelay;var x = animat[0];var y = animat[1];var x2 = animat[2];var y2 = animat[3];var ix1 = animto[0] - initcr[0];var iy1 = animto[1] - initcr[1];var ix2 = animto[2] - initcr[2];var iy2 = animto[3] - initcr[3];var pcent = 0;var velocity = options.swingSpeed;Selection.animMode(true);var animator = function(){return function(){pcent += (100 - pcent) / velocity;animat[0] = x + ((pcent / 100) * ix1);animat[1] = y + ((pcent / 100) * iy1);animat[2] = x2 + ((pcent / 100) * ix2);animat[3] = y2 + ((pcent / 100) * iy2);if (pcent < 100) animateStart();else Selection.done();if (pcent >= 99.8) pcent = 100;setSelectRaw(animat);};}();function animateStart(){ window.setTimeout(animator,interv); };animateStart();};/*}}}*/function setSelect(rect)/*{{{*/{setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);};/*}}}*/function setSelectRaw(l) /*{{{*/{Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();};/*}}}*/function setOptions(opt)/*{{{*/{if (typeof(opt) != 'object') opt = { };options = jQuery.extend(options,opt);if (typeof(options.onChange)!=='function')options.onChange = function() { };if (typeof(options.onSelect)!=='function')options.onSelect = function() { };};/*}}}*/function tellSelect()/*{{{*/{return unscale(Coords.getFixed());};/*}}}*/function tellScaled()/*{{{*/{return Coords.getFixed();};/*}}}*/function setOptionsNew(opt)/*{{{*/{setOptions(opt);interfaceUpdate();};/*}}}*/function disableCrop()/*{{{*/{options.disabled = true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');};/*}}}*/function enableCrop()/*{{{*/{options.disabled = false;interfaceUpdate();};/*}}}*/function cancelCrop()/*{{{*/{Selection.done();Tracker.activateHandlers(null,null);};/*}}}*/function destroy()/*{{{*/{$div.remove();$origimg.show();};/*}}}*/function interfaceUpdate(alt)/*{{{*/{options.allowResize ?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor( options.allowSelect? 'crosshair': 'default' );Selection.setCursor( options.allowMove? 'move': 'default' );$div.css('backgroundColor',options.bgColor);if ('setSelect' in options) {setSelect(opt.setSelect);Selection.done();delete(options.setSelect);}if ('trueSize' in options) {xscale = options.trueSize[0] / boundx;yscale = options.trueSize[1] / boundy;}xlimit = options.maxSize[0] || 0;ylimit = options.maxSize[1] || 0;xmin = options.minSize[0] || 0;ymin = options.minSize[1] || 0;if ('outerImage' in options){$img.attr('src',options.outerImage);delete(options.outerImage);}Selection.refresh();};/*}}}*//*}}}*/$hdl_holder.hide();interfaceUpdate(true);var api = {animateTo: animateTo,setSelect: setSelect,setOptions: setOptionsNew,tellSelect: tellSelect,tellScaled: tellScaled,disable: disableCrop,enable: enableCrop,cancel: cancelCrop,focus: KeyManager.watchKeys,getBounds: function() { return [ boundx * xscale, boundy * yscale ]; },getWidgetSize: function() { return [ boundx, boundy ]; },release: Selection.release,destroy: destroy};$origimg.data('Jcrop',api);return api;};jQuery.fn.Jcrop = function(options)/*{{{*/{function attachWhenDone(from)/*{{{*/{var loadsrc = options.useImg || from.src;var img = new Image();img.onload = function() { jQuery.Jcrop(from,options); };img.src = loadsrc;};/*}}}*/if (typeof(options) !== 'object') options = { };this.each(function(){if (jQuery(this).data('Jcrop')){if (options == 'api') return jQuery(this).data('Jcrop');else jQuery(this).data('Jcrop').setOptions(options);}else attachWhenDone(this);});return this;};/*}}}*/})(jQuery);(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);

/****
 * Tooltips
 **/
this.tooltip = function(){/* CONFIG */xOffset = 10;yOffset = 27;/* IMG TOOLTIP */jQuery(".tooltip").hover(function(e){this.t = this.title;this.title = "";jQuery("body").append("<p id='tooltip'>"+ this.t +"</p>");jQuery("#tooltip").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn("fast");},function(){this.title = this.t;jQuery("#tooltip").remove();});jQuery(".tooltip").mousemove(function(e){jQuery("#tooltip").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");});};jQuery.noConflict();jQuery(document).ready(function(){tooltip();});

/****
 * CUFON script - Copyright (c) 2010 Simo Kinnunen., Licensed under the MIT license.
 **/
var Cufon = (function() {var api = function() {return api.replace.apply(null, arguments);};var DOM = api.DOM = {ready: (function() {var complete = false, readyStatus = { loaded: 1, complete: 1 };var queue = [], perform = function() {if (complete) return;complete = true;for (var fn; fn = queue.shift(); fn());};if (document.addEventListener) {document.addEventListener('DOMContentLoaded', perform, false);window.addEventListener('pageshow', perform, false);}if (!window.opera && document.readyState) (function() {readyStatus[document.readyState] ? perform() : setTimeout(arguments.callee, 10);})();if (document.readyState && document.createStyleSheet) (function() {try {document.body.doScroll('left');perform();}catch (e) {setTimeout(arguments.callee, 1);}})();addEvent(window, 'load', perform);return function(listener) {if (!arguments.length) perform();else complete ? listener() : queue.push(listener);};})(),root: function() {return document.documentElement || document.body;}};var CSS = api.CSS = {Size: function(value, base) {this.value = parseFloat(value);this.unit = String(value).match(/[a-z%]*$/)[0] || 'px';this.convert = function(value) {return value / base * this.value;};this.convertFrom = function(value) {return value / this.value * base;};this.toString = function() {return this.value + this.unit;};},addClass: function(el, className) {var current = el.className;el.className = current + (current && ' ') + className;return el;},color: cached(function(value) {var parsed = {};parsed.color = value.replace(/^rgba\((.*?),\s*([\d.]+)\)/, function($0, $1, $2) {parsed.opacity = parseFloat($2);return 'rgb(' + $1 + ')';});return parsed;}),fontStretch: cached(function(value) {if (typeof value == 'number') return value;if (/%$/.test(value)) return parseFloat(value) / 100;return {'ultra-condensed': 0.5,'extra-condensed': 0.625,condensed: 0.75,'semi-condensed': 0.875,'semi-expanded': 1.125,expanded: 1.25,'extra-expanded': 1.5,'ultra-expanded': 2}[value] || 1;}),getStyle: function(el) {var view = document.defaultView;if (view && view.getComputedStyle) return new Style(view.getComputedStyle(el, null));if (el.currentStyle) return new Style(el.currentStyle);return new Style(el.style);},gradient: cached(function(value) {var gradient = {id: value,type: value.match(/^-([a-z]+)-gradient\(/)[1],stops: []}, colors = value.substr(value.indexOf('(')).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for (var i = 0, l = colors.length, stop; i < l; ++i) {stop = colors[i].split('=', 2).reverse();gradient.stops.push([ stop[1] || i / (l - 1), stop[0] ]);}return gradient;}),quotedList: cached(function(value) {var list = [], re = /\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g, match;while (match = re.exec(value)) list.push(match[3] || match[1]);return list;}),recognizesMedia: cached(function(media) {var el = document.createElement('style'), sheet, container, supported;el.type = 'text/css';el.media = media;try {el.appendChild(document.createTextNode('/**/'));} catch (e) {}container = elementsByTagName('head')[0];container.insertBefore(el, container.firstChild);sheet = (el.sheet || el.styleSheet);supported = sheet && !sheet.disabled;container.removeChild(el);return supported;}),removeClass: function(el, className) {var re = RegExp('(?:^|\\s+)' + className +  '(?=\\s|$)', 'g');el.className = el.className.replace(re, '');return el;},supports: function(property, value) {var checker = document.createElement('span').style;if (checker[property] === undefined) return false;checker[property] = value;return checker[property] === value;},textAlign: function(word, style, position, wordCount) {if (style.get('textAlign') == 'right') {if (position > 0) word = ' ' + word;}else if (position < wordCount - 1) word += ' ';return word;},textShadow: cached(function(value) {if (value == 'none') return null;var shadows = [], currentShadow = {}, result, offCount = 0;var re = /(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while (result = re.exec(value)) {if (result[0] == ',') {shadows.push(currentShadow);currentShadow = {};offCount = 0;}else if (result[1]) {currentShadow.color = result[1];}else {currentShadow[[ 'offX', 'offY', 'blur' ][offCount++]] = result[2];}}shadows.push(currentShadow);return shadows;}),textTransform: (function() {var map = {uppercase: function(s) {return s.toUpperCase();},lowercase: function(s) {return s.toLowerCase();},capitalize: function(s) {return s.replace(/(?:^|\s)./g, function($0) {return $0.toUpperCase();});}};return function(text, style) {var transform = map[style.get('textTransform')];return transform ? transform(text) : text;};})(),whiteSpace: (function() {var ignore = {inline: 1,'inline-block': 1,'run-in': 1};var wsStart = /^\s+/, wsEnd = /\s+$/;return function(text, style, node, previousElement, simple) {if (simple) return text.replace(wsStart, '').replace(wsEnd, '');if (previousElement) {if (previousElement.nodeName.toLowerCase() == 'br') {text = text.replace(wsStart, '');}}if (ignore[style.get('display')]) return text;if (!node.previousSibling) text = text.replace(wsStart, '');if (!node.nextSibling) text = text.replace(wsEnd, '');return text;};})()};CSS.ready = (function() {var complete = !CSS.recognizesMedia('all'), hasLayout = false;var queue = [], perform = function() {complete = true;for (var fn; fn = queue.shift(); fn());};var links = elementsByTagName('link'), styles = elementsByTagName('style');function isContainerReady(el) {return el.disabled || isSheetReady(el.sheet, el.media || 'screen');}function isSheetReady(sheet, media) {if (!CSS.recognizesMedia(media || 'all')) return true;if (!sheet || sheet.disabled) return false;try {var rules = sheet.cssRules, rule;if (rules) {search: for (var i = 0, l = rules.length; rule = rules[i], i < l; ++i) {switch (rule.type) {case 2:break;case 3:if (!isSheetReady(rule.styleSheet, rule.media.mediaText)) return false;break;default:break search;}}}}catch (e) {}return true;}function allStylesLoaded() {if (document.createStyleSheet) return true;var el, i;for (i = 0; el = links[i]; ++i) {if (el.rel.toLowerCase() == 'stylesheet' && !isContainerReady(el)) return false;}for (i = 0; el = styles[i]; ++i) {if (!isContainerReady(el)) return false;}return true;}DOM.ready(function() {if (!hasLayout) hasLayout = CSS.getStyle(document.body).isUsable();if (complete || (hasLayout && allStylesLoaded())) perform();else setTimeout(arguments.callee, 10);});return function(listener) {if (complete) listener();else queue.push(listener);};})();function Font(data) {var face = this.face = data.face, wordSeparators = {'\u0020': 1,'\u00a0': 1,'\u3000': 1};this.glyphs = (function(glyphs) {var key, fallbacks = {'\u2011': '\u002d','\u00ad': '\u2011'};for (key in fallbacks) {if (!hasOwnProperty(fallbacks, key)) continue;if (!glyphs[key]) glyphs[key] = glyphs[fallbacks[key]];}return glyphs;})(data.glyphs);this.w = data.w;this.baseSize = parseInt(face['units-per-em'], 10);this.family = face['font-family'].toLowerCase();this.weight = face['font-weight'];this.style = face['font-style'] || 'normal';this.viewBox = (function () {var parts = face.bbox.split(/\s+/);var box = {minX: parseInt(parts[0], 10),minY: parseInt(parts[1], 10),maxX: parseInt(parts[2], 10),maxY: parseInt(parts[3], 10)};box.width = box.maxX - box.minX;box.height = box.maxY - box.minY;box.toString = function() {return [ this.minX, this.minY, this.width, this.height ].join(' ');};return box;})();this.ascent = -parseInt(face.ascent, 10);this.descent = -parseInt(face.descent, 10);this.height = -this.ascent + this.descent;this.spacing = function(chars, letterSpacing, wordSpacing) {var glyphs = this.glyphs, glyph,kerning, k,jumps = [],width = 0, w,i = -1, j = -1, chr;while (chr = chars[++i]) {glyph = glyphs[chr] || this.missingGlyph;if (!glyph) continue;if (kerning) {width -= k = kerning[chr] || 0;jumps[j] -= k;}w = glyph.w;if (isNaN(w)) w = +this.w;if (w > 0) {w += letterSpacing;if (wordSeparators[chr]) w += wordSpacing;}width += jumps[++j] = ~~w;kerning = glyph.k;}jumps.total = width;return jumps;};}function FontFamily() {var styles = {}, mapping = {oblique: 'italic',italic: 'oblique'};this.add = function(font) {(styles[font.style] || (styles[font.style] = {}))[font.weight] = font;};this.get = function(style, weight) {var weights = styles[style] || styles[mapping[style]]|| styles.normal || styles.italic || styles.oblique;if (!weights) return null;weight = {normal: 400,bold: 700}[weight] || parseInt(weight, 10);if (weights[weight]) return weights[weight];var up = {1: 1,99: 0}[weight % 100], alts = [], min, max;if (up === undefined) up = weight > 400;if (weight == 500) weight = 400;for (var alt in weights) {if (!hasOwnProperty(weights, alt)) continue;alt = parseInt(alt, 10);if (!min || alt < min) min = alt;if (!max || alt > max) max = alt;alts.push(alt);}if (weight < min) weight = min;if (weight > max) weight = max;alts.sort(function(a, b) {return (up? (a >= weight && b >= weight) ? a < b : a > b: (a <= weight && b <= weight) ? a > b : a < b) ? -1 : 1;});return weights[alts[0]];};}function HoverHandler() {function contains(node, anotherNode) {try {if (node.contains) return node.contains(anotherNode);return node.compareDocumentPosition(anotherNode) & 16;}catch(e) {}return false;}function onOverOut(e) {var related = e.relatedTarget;if (related && contains(this, related)) return;trigger(this, e.type == 'mouseover');}function onEnterLeave(e) {trigger(this, e.type == 'mouseenter');}function trigger(el, hoverState) {setTimeout(function() {var options = sharedStorage.get(el).options;api.replace(el, hoverState ? merge(options, options.hover) : options, true);}, 10);}this.attach = function(el) {if (el.onmouseenter === undefined) {addEvent(el, 'mouseover', onOverOut);addEvent(el, 'mouseout', onOverOut);}else {addEvent(el, 'mouseenter', onEnterLeave);addEvent(el, 'mouseleave', onEnterLeave);}};}function ReplaceHistory() {var list = [], map = {};function filter(keys) {var values = [], key;for (var i = 0; key = keys[i]; ++i) values[i] = list[map[key]];return values;}this.add = function(key, args) {map[key] = list.push(args) - 1;};this.repeat = function() {var snapshot = arguments.length ? filter(arguments) : list, args;for (var i = 0; args = snapshot[i++];) api.replace(args[0], args[1], true);};}function Storage() {var map = {}, at = 0;function identify(el) {return el.cufid || (el.cufid = ++at);}this.get = function(el) {var id = identify(el);return map[id] || (map[id] = {});};}function Style(style) {var custom = {}, sizes = {};this.extend = function(styles) {for (var property in styles) {if (hasOwnProperty(styles, property)) custom[property] = styles[property];}return this;};this.get = function(property) {return custom[property] != undefined ? custom[property] : style[property];};this.getSize = function(property, base) {return sizes[property] || (sizes[property] = new CSS.Size(this.get(property), base));};this.isUsable = function() {return !!style;};}function addEvent(el, type, listener) {if (el.addEventListener) {el.addEventListener(type, listener, false);}else if (el.attachEvent) {el.attachEvent('on' + type, function() {return listener.call(el, window.event);});}}function attach(el, options) {var storage = sharedStorage.get(el);if (storage.options) return el;if (options.hover && options.hoverables[el.nodeName.toLowerCase()]) {hoverHandler.attach(el);}storage.options = options;return el;}function cached(fun) {var cache = {};return function(key) {if (!hasOwnProperty(cache, key)) cache[key] = fun.apply(null, arguments);return cache[key];};}function getFont(el, style) {var families = CSS.quotedList(style.get('fontFamily').toLowerCase()), family;for (var i = 0; family = families[i]; ++i) {if (fonts[family]) return fonts[family].get(style.get('fontStyle'), style.get('fontWeight'));}return null;}function elementsByTagName(query) {return document.getElementsByTagName(query);}function hasOwnProperty(obj, property) {return obj.hasOwnProperty(property);}function merge() {var merged = {}, arg, key;for (var i = 0, l = arguments.length; arg = arguments[i], i < l; ++i) {for (key in arg) {if (hasOwnProperty(arg, key)) merged[key] = arg[key];}}return merged;}function process(font, text, style, options, node, el) {var fragment = document.createDocumentFragment(), processed;if (text === '') return fragment;var separate = options.separate;var parts = text.split(separators[separate]), needsAligning = (separate == 'words');if (needsAligning && HAS_BROKEN_REGEXP) {if (/^\s/.test(text)) parts.unshift('');if (/\s$/.test(text)) parts.push('');}for (var i = 0, l = parts.length; i < l; ++i) {processed = engines[options.engine](font,needsAligning ? CSS.textAlign(parts[i], style, i, l) : parts[i],style, options, node, el, i < l - 1);if (processed) fragment.appendChild(processed);}return fragment;}function replaceElement(el, options) {var name = el.nodeName.toLowerCase();if (options.ignore[name]) return;if (options.ignoreClass && options.ignoreClass.test(el.className)) return;if (options.onBeforeReplace) options.onBeforeReplace(el, options);var replace = !options.textless[name], simple = (options.trim === 'simple');var style = CSS.getStyle(attach(el, options)).extend(options);if (parseFloat(style.get('fontSize')) === 0) return;var font = getFont(el, style), node, type, next, anchor, text, lastElement;var isShy = options.softHyphens, anyShy = false, pos, shy, reShy = /\u00ad/g;var modifyText = options.modifyText;if (!font) return;for (node = el.firstChild; node; node = next) {type = node.nodeType;next = node.nextSibling;if (replace && type == 3) {if (isShy && el.nodeName.toLowerCase() != TAG_SHY) {pos = node.data.indexOf('\u00ad');if (pos >= 0) {node.splitText(pos);next = node.nextSibling;next.deleteData(0, 1);shy = document.createElement(TAG_SHY);shy.appendChild(document.createTextNode('\u00ad'));el.insertBefore(shy, next);next = shy;anyShy = true;}}if (anchor) {anchor.appendData(node.data);el.removeChild(node);}else anchor = node;if (next) continue;}if (anchor) {text = anchor.data;if (!isShy) text = text.replace(reShy, '');text = CSS.whiteSpace(text, style, anchor, lastElement, simple);if (modifyText) text = modifyText(text, anchor, el, options);el.replaceChild(process(font, text, style, options, node, el), anchor);anchor = null;}if (type == 1) {if (node.firstChild) {if (node.nodeName.toLowerCase() == 'cufon') {engines[options.engine](font, null, style, options, node, el);}else arguments.callee(node, options);}lastElement = node;}}if (isShy && anyShy) {updateShy(el);if (!trackingShy) addEvent(window, 'resize', updateShyOnResize);trackingShy = true;}if (options.onAfterReplace) options.onAfterReplace(el, options);}function updateShy(context) {var shys, shy, parent, glue, newGlue, next, prev, i;shys = context.getElementsByTagName(TAG_SHY);for (i = 0; shy = shys[i]; ++i) {shy.className = C_SHY_DISABLED;glue = parent = shy.parentNode;if (glue.nodeName.toLowerCase() != TAG_GLUE) {newGlue = document.createElement(TAG_GLUE);newGlue.appendChild(shy.previousSibling);parent.insertBefore(newGlue, shy);newGlue.appendChild(shy);}else {glue = glue.parentNode;if (glue.nodeName.toLowerCase() == TAG_GLUE) {parent = glue.parentNode;while (glue.firstChild) {parent.insertBefore(glue.firstChild, glue);}parent.removeChild(glue);}}}for (i = 0; shy = shys[i]; ++i) {shy.className = '';glue = shy.parentNode;parent = glue.parentNode;next = glue.nextSibling || parent.nextSibling;prev = (next.nodeName.toLowerCase() == TAG_GLUE) ? glue : shy.previousSibling;if (prev.offsetTop >= next.offsetTop) {shy.className = C_SHY_DISABLED;if (prev.offsetTop < next.offsetTop) {newGlue = document.createElement(TAG_GLUE);parent.insertBefore(newGlue, glue);newGlue.appendChild(glue);newGlue.appendChild(next);}}}}function updateShyOnResize() {if (ignoreResize) return;CSS.addClass(DOM.root(), C_VIEWPORT_RESIZING);clearTimeout(shyTimer);shyTimer = setTimeout(function() {ignoreResize = true;CSS.removeClass(DOM.root(), C_VIEWPORT_RESIZING);updateShy(document);ignoreResize = false;}, 100);}var HAS_BROKEN_REGEXP = ' '.split(/\s+/).length == 0;var TAG_GLUE = 'cufonglue';var TAG_SHY = 'cufonshy';var C_SHY_DISABLED = 'cufon-shy-disabled';var C_VIEWPORT_RESIZING = 'cufon-viewport-resizing';var sharedStorage = new Storage();var hoverHandler = new HoverHandler();var replaceHistory = new ReplaceHistory();var initialized = false;var trackingShy = false;var shyTimer;var ignoreResize = false;var engines = {}, fonts = {}, defaultOptions = {autoDetect: false,engine: null,forceHitArea: false,hover: false,hoverables: {a: true},ignore: {applet: 1,canvas: 1,col: 1,colgroup: 1,head: 1,iframe: 1,map: 1,noscript: 1,optgroup: 1,option: 1,script: 1,select: 1,style: 1,textarea: 1,title: 1,pre: 1},ignoreClass: null,modifyText: null,onAfterReplace: null,onBeforeReplace: null,printable: true,selector: (window.Sizzle||	(window.jQuery && function(query) { return jQuery(query); })||	(window.dojo && dojo.query)||	(window.glow && glow.dom && glow.dom.get)||	(window.Ext && Ext.query)||	(window.YAHOO && YAHOO.util && YAHOO.util.Selector && YAHOO.util.Selector.query)||	(window.$$ && function(query) { return $$(query); })||	(window.$ && function(query) { return $(query); })||	(document.querySelectorAll && function(query) { return document.querySelectorAll(query); })||	elementsByTagName),separate: 'words',softHyphens: true,textless: {dl: 1,html: 1,ol: 1,table: 1,tbody: 1,thead: 1,tfoot: 1,tr: 1,ul: 1},textShadow: 'none',trim: 'advanced'};var separators = {words: /\s/.test('\u00a0') ? /[^\S\u00a0]+/ : /\s+/,characters: '',none: /^/};api.now = function() {DOM.ready();return api;};api.refresh = function() {replaceHistory.repeat.apply(replaceHistory, arguments);return api;};api.registerEngine = function(id, engine) {if (!engine) return api;engines[id] = engine;return api.set('engine', id);};api.registerFont = function(data) {if (!data) return api;var font = new Font(data), family = font.family;if (!fonts[family]) fonts[family] = new FontFamily();fonts[family].add(font);return api.set('fontFamily', '"' + family + '"');};api.replace = function(elements, options, ignoreHistory) {options = merge(defaultOptions, options);if (!options.engine) return api;if (!initialized) {CSS.addClass(DOM.root(), 'cufon-active cufon-loading');CSS.ready(function() {CSS.addClass(CSS.removeClass(DOM.root(), 'cufon-loading'), 'cufon-ready');});initialized = true;}if (options.hover) options.forceHitArea = true;if (options.autoDetect) delete options.fontFamily;if (typeof options.ignoreClass == 'string') {options.ignoreClass = new RegExp('(?:^|\\s)(?:' + options.ignoreClass.replace(/\s+/, '|') + ')(?:\\s|$)');}if (typeof options.textShadow == 'string') {options.textShadow = CSS.textShadow(options.textShadow);}if (typeof options.color == 'string' && /^-/.test(options.color)) {options.textGradient = CSS.gradient(options.color);}else delete options.textGradient;if (!ignoreHistory) replaceHistory.add(elements, arguments);if (elements.nodeType || typeof elements == 'string') elements = [ elements ];CSS.ready(function() {for (var i = 0, l = elements.length; i < l; ++i) {var el = elements[i];if (typeof el == 'string') api.replace(options.selector(el), options, true);else replaceElement(el, options);}});return api;};api.set = function(option, value) {defaultOptions[option] = value;return api;};return api;})();Cufon.registerEngine('vml', (function() {var ns = document.namespaces;if (!ns) return;ns.add('cvml', 'urn:schemas-microsoft-com:vml');ns = null;var check = document.createElement('cvml:shape');check.style.behavior = 'url(#default#VML)';if (!check.coordsize) return;check = null;var HAS_BROKEN_LINEHEIGHT = (document.documentMode || 0) < 8;document.write(('<style type="text/css">' +'cufoncanvas{text-indent:0;}' +'@media screen{' +'cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}' +'cufoncanvas{position:absolute;text-align:left;}' +'cufon{display:inline-block;position:relative;vertical-align:' +(HAS_BROKEN_LINEHEIGHT? 'middle': 'text-bottom') +';}' +'cufon cufontext{position:absolute;left:-10000in;font-size:1px;text-align:left;}' +'cufonshy.cufon-shy-disabled,.cufon-viewport-resizing cufonshy{display:none;}' +'cufonglue{white-space:nowrap;display:inline-block;}' +'.cufon-viewport-resizing cufonglue{white-space:normal;}' +'a cufon{cursor:pointer}' +'}' +'@media print{' +'cufon cufoncanvas{display:none;}' +'}' +'</style>').replace(/;/g, '!important;'));function getFontSizeInPixels(el, value) {return getSizeInPixels(el, /(?:em|ex|%)$|^[a-z-]+$/i.test(value) ? '1em' : value);}function getSizeInPixels(el, value) {if (!isNaN(value) || /px$/i.test(value)) return parseFloat(value);var style = el.style.left, runtimeStyle = el.runtimeStyle.left;el.runtimeStyle.left = el.currentStyle.left;el.style.left = value.replace('%', 'em');var result = el.style.pixelLeft;el.style.left = style;el.runtimeStyle.left = runtimeStyle;return result;}function getSpacingValue(el, style, size, property) {var key = 'computed' + property, value = style[key];if (isNaN(value)) {value = style.get(property);style[key] = value = (value == 'normal') ? 0 : ~~size.convertFrom(getSizeInPixels(el, value));}return value;}var fills = {};function gradientFill(gradient) {var id = gradient.id;if (!fills[id]) {var stops = gradient.stops, fill = document.createElement('cvml:fill'), colors = [];fill.type = 'gradient';fill.angle = 180;fill.focus = '0';fill.method = 'none';fill.color = stops[0][1];for (var j = 1, k = stops.length - 1; j < k; ++j) {colors.push(stops[j][0] * 100 + '% ' + stops[j][1]);}fill.colors = colors.join(',');fill.color2 = stops[k][1];fills[id] = fill;}return fills[id];}return function(font, text, style, options, node, el, hasNext) {var redraw = (text === null);if (redraw) text = node.alt;var viewBox = font.viewBox;var size = style.computedFontSize || (style.computedFontSize = new Cufon.CSS.Size(getFontSizeInPixels(el, style.get('fontSize')) + 'px', font.baseSize));var wrapper, canvas;if (redraw) {wrapper = node;canvas = node.firstChild;}else {wrapper = document.createElement('cufon');wrapper.className = 'cufon cufon-vml';wrapper.alt = text;canvas = document.createElement('cufoncanvas');wrapper.appendChild(canvas);if (options.printable) {var print = document.createElement('cufontext');print.appendChild(document.createTextNode(text));wrapper.appendChild(print);}if (!hasNext) wrapper.appendChild(document.createElement('cvml:shape'));}var wStyle = wrapper.style;var cStyle = canvas.style;var height = size.convert(viewBox.height), roundedHeight = Math.ceil(height);var roundingFactor = roundedHeight / height;var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch'));var minX = viewBox.minX, minY = viewBox.minY;cStyle.height = roundedHeight;cStyle.top = Math.round(size.convert(minY - font.ascent));cStyle.left = Math.round(size.convert(minX));wStyle.height = size.convert(font.height) + 'px';var color = style.get('color');var chars = Cufon.CSS.textTransform(text, style).split('');var jumps = font.spacing(chars,getSpacingValue(el, style, size, 'letterSpacing'),getSpacingValue(el, style, size, 'wordSpacing'));if (!jumps.length) return null;var width = jumps.total;var fullWidth = -minX + width + (viewBox.width - jumps[jumps.length - 1]);var shapeWidth = size.convert(fullWidth * stretchFactor), roundedShapeWidth = Math.round(shapeWidth);var coordSize = fullWidth + ',' + viewBox.height, coordOrigin;var stretch = 'r' + coordSize + 'ns';var fill = options.textGradient && gradientFill(options.textGradient);var glyphs = font.glyphs, offsetX = 0;var shadows = options.textShadow;var i = -1, j = 0, chr;while (chr = chars[++i]) {var glyph = glyphs[chars[i]] || font.missingGlyph, shape;if (!glyph) continue;if (redraw) {shape = canvas.childNodes[j];while (shape.firstChild) shape.removeChild(shape.firstChild);}else {shape = document.createElement('cvml:shape');canvas.appendChild(shape);}shape.stroked = 'f';shape.coordsize = coordSize;shape.coordorigin = coordOrigin = (minX - offsetX) + ',' + minY;shape.path = (glyph.d ? 'm' + glyph.d + 'xe' : '') + 'm' + coordOrigin + stretch;shape.fillcolor = color;if (fill) shape.appendChild(fill.cloneNode(false));var sStyle = shape.style;sStyle.width = roundedShapeWidth;sStyle.height = roundedHeight;if (shadows) {var shadow1 = shadows[0], shadow2 = shadows[1];var color1 = Cufon.CSS.color(shadow1.color), color2;var shadow = document.createElement('cvml:shadow');shadow.on = 't';shadow.color = color1.color;shadow.offset = shadow1.offX + ',' + shadow1.offY;if (shadow2) {color2 = Cufon.CSS.color(shadow2.color);shadow.type = 'double';shadow.color2 = color2.color;shadow.offset2 = shadow2.offX + ',' + shadow2.offY;}shadow.opacity = color1.opacity || (color2 && color2.opacity) || 1;shape.appendChild(shadow);}offsetX += jumps[j++];}var cover = shape.nextSibling, coverFill, vStyle;if (options.forceHitArea) {if (!cover) {cover = document.createElement('cvml:rect');cover.stroked = 'f';cover.className = 'cufon-vml-cover';coverFill = document.createElement('cvml:fill');coverFill.opacity = 0;cover.appendChild(coverFill);canvas.appendChild(cover);}vStyle = cover.style;vStyle.width = roundedShapeWidth;vStyle.height = roundedHeight;}else if (cover) canvas.removeChild(cover);wStyle.width = Math.max(Math.ceil(size.convert(width * stretchFactor)), 0);if (HAS_BROKEN_LINEHEIGHT) {var yAdjust = style.computedYAdjust;if (yAdjust === undefined) {var lineHeight = style.get('lineHeight');if (lineHeight == 'normal') lineHeight = '1em';else if (!isNaN(lineHeight)) lineHeight += 'em';style.computedYAdjust = yAdjust = 0.5 * (getSizeInPixels(el, lineHeight) - parseFloat(wStyle.height));}if (yAdjust) {wStyle.marginTop = Math.ceil(yAdjust) + 'px';wStyle.marginBottom = yAdjust + 'px';}}return wrapper;};})());Cufon.registerEngine('canvas', (function() {var check = document.createElement('canvas');if (!check || !check.getContext || !check.getContext.apply) return;check = null;var HAS_INLINE_BLOCK = Cufon.CSS.supports('display', 'inline-block');var HAS_BROKEN_LINEHEIGHT = !HAS_INLINE_BLOCK && (document.compatMode == 'BackCompat' || /frameset|transitional/i.test(document.doctype.publicId));var styleSheet = document.createElement('style');styleSheet.type = 'text/css';styleSheet.appendChild(document.createTextNode(('cufon{text-indent:0;}' +'@media screen,projection{' +'cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;' +(HAS_BROKEN_LINEHEIGHT? '': 'font-size:1px;line-height:1px;') +'}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;text-align:left;text-indent:-10000in;}' +(HAS_INLINE_BLOCK? 'cufon canvas{position:relative;}': 'cufon canvas{position:absolute;}') +'cufonshy.cufon-shy-disabled,.cufon-viewport-resizing cufonshy{display:none;}' +'cufonglue{white-space:nowrap;display:inline-block;}' +'.cufon-viewport-resizing cufonglue{white-space:normal;}' +'}' +'@media print{' +'cufon{padding:0;}' +'cufon canvas{display:none;}' +'}').replace(/;/g, '!important;')));document.getElementsByTagName('head')[0].appendChild(styleSheet);function generateFromVML(path, context) {var atX = 0, atY = 0;var code = [], re = /([mrvxe])([^a-z]*)/g, match;generate: for (var i = 0; match = re.exec(path); ++i) {var c = match[2].split(',');switch (match[1]) {case 'v':code[i] = { m: 'bezierCurveTo', a: [ atX + ~~c[0], atY + ~~c[1], atX + ~~c[2], atY + ~~c[3], atX += ~~c[4], atY += ~~c[5] ] };break;case 'r':code[i] = { m: 'lineTo', a: [ atX += ~~c[0], atY += ~~c[1] ] };break;case 'm':code[i] = { m: 'moveTo', a: [ atX = ~~c[0], atY = ~~c[1] ] };break;case 'x':code[i] = { m: 'closePath' };break;case 'e':break generate;}context[code[i].m].apply(context, code[i].a);}return code;}function interpret(code, context) {for (var i = 0, l = code.length; i < l; ++i) {var line = code[i];context[line.m].apply(context, line.a);}}return function(font, text, style, options, node, el) {var redraw = (text === null);if (redraw) text = node.getAttribute('alt');var viewBox = font.viewBox;var size = style.getSize('fontSize', font.baseSize);var expandTop = 0, expandRight = 0, expandBottom = 0, expandLeft = 0;var shadows = options.textShadow, shadowOffsets = [];if (shadows) {for (var i = shadows.length; i--;) {var shadow = shadows[i];var x = size.convertFrom(parseFloat(shadow.offX));var y = size.convertFrom(parseFloat(shadow.offY));shadowOffsets[i] = [ x, y ];if (y < expandTop) expandTop = y;if (x > expandRight) expandRight = x;if (y > expandBottom) expandBottom = y;if (x < expandLeft) expandLeft = x;}}var chars = Cufon.CSS.textTransform(text, style).split('');var jumps = font.spacing(chars,~~size.convertFrom(parseFloat(style.get('letterSpacing')) || 0),~~size.convertFrom(parseFloat(style.get('wordSpacing')) || 0));if (!jumps.length) return null;var width = jumps.total;expandRight += viewBox.width - jumps[jumps.length - 1];expandLeft += viewBox.minX;var wrapper, canvas;if (redraw) {wrapper = node;canvas = node.firstChild;}else {wrapper = document.createElement('cufon');wrapper.className = 'cufon cufon-canvas';wrapper.setAttribute('alt', text);canvas = document.createElement('canvas');wrapper.appendChild(canvas);if (options.printable) {var print = document.createElement('cufontext');print.appendChild(document.createTextNode(text));wrapper.appendChild(print);}}var wStyle = wrapper.style;var cStyle = canvas.style;var height = size.convert(viewBox.height);var roundedHeight = Math.ceil(height);var roundingFactor = roundedHeight / height;var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch'));var stretchedWidth = width * stretchFactor;var canvasWidth = Math.ceil(size.convert(stretchedWidth + expandRight - expandLeft));var canvasHeight = Math.ceil(size.convert(viewBox.height - expandTop + expandBottom));canvas.width = canvasWidth;canvas.height = canvasHeight;cStyle.width = canvasWidth + 'px';cStyle.height = canvasHeight + 'px';expandTop += viewBox.minY;cStyle.top = Math.round(size.convert(expandTop - font.ascent)) + 'px';cStyle.left = Math.round(size.convert(expandLeft)) + 'px';var wrapperWidth = Math.max(Math.ceil(size.convert(stretchedWidth)), 0) + 'px';if (HAS_INLINE_BLOCK) {wStyle.width = wrapperWidth;wStyle.height = size.convert(font.height) + 'px';}else {wStyle.paddingLeft = wrapperWidth;wStyle.paddingBottom = (size.convert(font.height) - 1) + 'px';}var g = canvas.getContext('2d'), scale = height / viewBox.height;g.scale(scale, scale * roundingFactor);g.translate(-expandLeft, -expandTop);g.save();function renderText() {var glyphs = font.glyphs, glyph, i = -1, j = -1, chr;g.scale(stretchFactor, 1);while (chr = chars[++i]) {var glyph = glyphs[chars[i]] || font.missingGlyph;if (!glyph) continue;if (glyph.d) {g.beginPath();if (glyph.code) interpret(glyph.code, g);else glyph.code = generateFromVML('m' + glyph.d, g);g.fill();}g.translate(jumps[++j], 0);}g.restore();}if (shadows) {for (var i = shadows.length; i--;) {var shadow = shadows[i];g.save();g.fillStyle = shadow.color;g.translate.apply(g, shadowOffsets[i]);renderText();}}var gradient = options.textGradient;if (gradient) {var stops = gradient.stops, fill = g.createLinearGradient(0, viewBox.minY, 0, viewBox.maxY);for (var i = 0, l = stops.length; i < l; ++i) {fill.addColorStop.apply(fill, stops[i]);}g.fillStyle = fill;}else g.fillStyle = style.get('color');renderText();return wrapper;};})());

/****
 * FancyBox - jQuery Plugin
 **/
(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("<div/>")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r;w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+a+'</span><span id="fancybox-title-right"></span></span>'}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('<div id="fancybox-title" class="'+f+'" />').css({width:d,paddingLeft:c.padding,paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a=j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb",b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding-20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity=0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("<img />").attr({id:"fancybox-img",src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f="image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false;return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';w="";b.each(e.swf,function(r,R){t+='<param name="'+r+'" value="'+R+'"></param>';w+=" "+r+'="'+R+'"'});t+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";m.html(t);F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div",u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),u=b('<div id="fancybox-loading"><div></div></div>'),x=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);D.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),A=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),B=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]=="object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}if(p>q.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false}if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("<div style='overflow:auto'></div>").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery);

