/**************************
 * TAUSCH.COM
 *************************/
 
/**************************
 * PNG fix for IE6
 *************************/
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))

/**************************
 * Popup box
 *************************/
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(p($){$.q.1Q=p(){J O.2n(p(){n b=$(O).u(\'2o\');8(b.1d(/^3i\\(["\']?(.*\\.2p)["\']?\\)$/i)){b=3j.$1;$(O).u({\'2o\':\'3k\',\'1e\':"3l:3m.3n.3o(3p=D, 3q="+($(O).u(\'3r\')==\'2q-3s\'?\'3t\':\'3u\')+", 13=\'"+b+"\')"}).2n(p(){n a=$(O).u(\'1u\');8(a!=\'2r\'&&a!=\'2s\')$(O).u(\'1u\',\'2s\')})}})};n l,4,1f=F,X=1v 1w,1x,1y=1,1z=/\\.(3v|3w|2p|3x|3y)(.*)?$/i;n m=1A,18=$.14.1g&&$.14.2t.1R(0,1)==6&&!19.3z,1S=18||($.14.1g&&$.14.2t.1R(0,1)==7);$.q.r=p(o){n j=$.2u({},$.q.r.2v,o);n k=O;p 2w(){l=O;4=$.2u({},j);2x();J F};p 2x(){8(1f)J;8($.1T(4.1U)){4.1U()}4.v=[];4.t=0;8(j.v.Y>0){4.v=j.v}C{n a={};8(!l.1B||l.1B==\'\'){n a={K:l.K,G:l.G};8($(l).1C("1l:1D").Y){a.S=$(l).1C("1l:1D")}C{a.S=$(l)}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}C{n b=$(k).1e("a[1B="+l.1B+"]");n a={};3A(n i=0;i<b.Y;i++){a={K:b[i].K,G:b[i].G};8($(b[i]).1C("1l:1D").Y){a.S=$(b[i]).1C("1l:1D")}C{a.S=$(b[i])}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}}}3B(4.v[4.t].K!=l.K){4.t++}8(4.1E){8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'3C\');$("#T").u(\'A\',$(U).A())}$("#T").u({\'3D-3E\':4.2A,\'22\':4.2B}).Z()}$(19).11("23.L 24.L",$.q.r.2C);1h()};p 1h(){$("#1n, #1o, #1i, #H").1a();n b=4.v[4.t].K;8(b.1d("1j")||l.3F.2D("1j")>=0){$.q.r.1F();1p(\'<1j s="2E" 3G="2F.q.r.2G()" 3H="3I\'+P.1b(P.3J()*3K)+\'" 2H="0" 3L="0" 13="\'+b+\'"></1j>\',4.1G,4.1H)}C 8(b.1d(/#/)){n c=19.3M.K.3N(\'#\')[0];c=b.3O(c,\'\');c=c.1R(c.2D(\'#\'));1p(\'<9 s="3P">\'+$(c).2I()+\'</9>\',4.1G,4.1H)}C 8(b.1d(1z)){X=1v 1w;X.13=b;8(X.3Q){25()}C{$.q.r.1F();$(X).Q().11(\'3R\',p(){$("#M").1a();25()})}}C{$.q.r.1F();$.3S(b,p(a){$("#M").1a();1p(\'<9 s="3T">\'+a+\'</9>\',4.1G,4.1H)})}};p 25(){n a=X.E;n b=X.A;n c=(4.N*2)+40;n d=(4.N*2)+26;n w=$.q.r.1q();8(4.2J&&(a>(w[0]-c)||b>(w[1]-d))){n e=P.28(P.28(w[0]-c,a)/a,P.28(w[1]-d,b)/b);a=P.1b(e*a);b=P.1b(e*b)}1p(\'<1l 1W="" s="3U" 13="\'+X.13+\'" />\',a,b)};p 2K(){8((4.v.Y-1)>4.t){n a=4.v[4.t+1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}8(4.t>0){n a=4.v[4.t-1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}};p 1p(a,b,c){1f=D;n d=4.N;8(1S||m){$("#y")[0].15.2L("A");$("#y")[0].15.2L("E")}8(d>0){b+=d*2;c+=d*2;$("#y").u({\'z\':d+\'R\',\'2M\':d+\'R\',\'2N\':d+\'R\',\'B\':d+\'R\',\'E\':\'2O\',\'A\':\'2O\'});8(1S||m){$("#y")[0].15.2P(\'A\',\'(O.2Q.3V - \'+d*2+\')\');$("#y")[0].15.2P(\'E\',\'(O.2Q.3W - \'+d*2+\')\')}}C{$("#y").u({\'z\':0,\'2M\':0,\'2N\':0,\'B\':0,\'E\':\'2R%\',\'A\':\'2R%\'})}8($("#x").16(":V")&&b==$("#x").E()&&c==$("#x").A()){$("#y").1J(\'29\',p(){$("#y").1r().1K($(a)).2a("1L",p(){1s()})});J}n w=$.q.r.1q();n e=(c+26)>w[1]?w[3]:(w[3]+P.1b((w[1]-c-26)*0.5));n f=(b+40)>w[0]?w[2]:(w[2]+P.1b((w[0]-b-40)*0.5));n g={\'B\':f,\'z\':e,\'E\':b+\'R\',\'A\':c+\'R\'};8($("#x").16(":V")){$("#y").1J("1L",p(){$("#y").1r();$("#x").2b(g,4.2S,4.2T,p(){$("#y").1K($(a)).2a("1L",p(){1s()})})})}C{8(4.2c>0&&4.v[4.t].S!==1m){$("#y").1r().1K($(a));n h=4.v[4.t].S;n i=$.q.r.2d(h);$("#x").u({\'B\':(i.B-20-4.N)+\'R\',\'z\':(i.z-20-4.N)+\'R\',\'E\':$(h).E()+(4.N*2),\'A\':$(h).A()+(4.N*2)});8(4.2e){g.22=\'Z\'}$("#x").2b(g,4.2c,4.2U,p(){1s()})}C{$("#y").1a().1r().1K($(a)).Z();$("#x").u(g).2a("1L",p(){1s()})}}};p 2V(){8(4.t!==0){$("#1o, #2W").Q().11("17",p(e){e.2X();4.t--;1h();J F});$("#1o").Z()}8(4.t!=(4.v.Y-1)){$("#1n, #2Y").Q().11("17",p(e){e.2X();4.t++;1h();J F});$("#1n").Z()}};p 1s(){8($.14.1g){$("#y")[0].15.1M(\'1e\');$("#x")[0].15.1M(\'1e\')}2V();2K();$(U).11("1N.L",p(e){8(e.2f==27&&4.2Z){$.q.r.1c()}C 8(e.2f==37&&4.t!==0){$(U).Q("1N.L");4.t--;1h()}C 8(e.2f==39&&4.t!=(4.v.Y-1)){$(U).Q("1N.L");4.t++;1h()}});8(4.30){$("#y").17($.q.r.1c)}8(4.1E&&4.31){$("#T").11("17",$.q.r.1c)}8(4.33){$("#1i").11("17",$.q.r.1c).Z()}8(1V 4.v[4.t].G!==\'1m\'&&4.v[4.t].G.Y>0){n a=$("#x").1u();$(\'#H 9\').3X(4.v[4.t].G).2I();$(\'#H\').u({\'z\':a.z+$("#x").34()-32,\'B\':a.B+(($("#x").35()*0.5)-($(\'#H\').E()*0.5))}).Z()}8(4.1E&&18){$(\'1X, 1Y, 1Z\',$(\'#y\')).u(\'21\',\'V\')}8($.1T(4.2g)){4.2g(4.v[4.t])}8($.14.1g){$("#x")[0].15.1M(\'1e\');$("#y")[0].15.1M(\'1e\')}1f=F};J O.Q(\'17.L\').11(\'17.L\',2w)};$.q.r.2C=p(){n w=$.q.r.1q();8(4.2h&&$("#x").16(\':V\')){n a=$("#x").35();n b=$("#x").34();n c={\'z\':(b>w[1]?w[3]:w[3]+P.1b((w[1]-b)*0.5)),\'B\':(a>w[0]?w[2]:w[2]+P.1b((w[0]-a)*0.5))};$("#x").u(c);$(\'#H\').u({\'z\':c.z+b-32,\'B\':c.B+((a*0.5)-($(\'#H\').E()*0.5))})}8(18&&$("#T").16(\':V\')){$("#T").u({\'A\':$(U).A()})}8($("#M").16(\':V\')){$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])})}};$.q.r.1t=p(a,b){J 3Y($.3Z(a.41?a[0]:a,b,D))||0};$.q.r.2d=p(a){n b=a.42();b.z+=$.q.r.1t(a,\'43\');b.z+=$.q.r.1t(a,\'44\');b.B+=$.q.r.1t(a,\'45\');b.B+=$.q.r.1t(a,\'46\');J b};$.q.r.2G=p(){$("#M").1a();$("#2E").Z()};$.q.r.1q=p(){J[$(19).E(),$(19).A(),$(U).47(),$(U).48()]};$.q.r.36=p(){8(!$("#M").16(\':V\')){38(1x);J}$("#M > 9").u(\'z\',(1y*-40)+\'R\');1y=(1y+1)%12};$.q.r.1F=p(){38(1x);n w=$.q.r.1q();$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])}).Z();$("#M").11(\'17\',$.q.r.1c);1x=49($.q.r.36,4a)};$.q.r.1c=p(){1f=D;$(X).Q();$(U).Q("1N.L");$(19).Q("23.L 24.L");$("#T, #y, #1i").Q();$("#1i, #M, #1o, #1n, #H").1a();1O=p(){8($("#T").16(\':V\')){$("#T").1J("29")}$("#y").1r();8(4.2h){$(19).Q("23.L 24.L")}8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'V\')}8($.1T(4.2i)){4.2i()}1f=F};8($("#x").16(":V")!==F){8(4.2j>0&&4.v[4.t].S!==1m){n a=4.v[4.t].S;n b=$.q.r.2d(a);n c={\'B\':(b.B-20-4.N)+\'R\',\'z\':(b.z-20-4.N)+\'R\',\'E\':$(a).E()+(4.N*2),\'A\':$(a).A()+(4.N*2)};8(4.2e){c.22=\'1a\'}$("#x").3a(F,D).2b(c,4.2j,4.3b,1O)}C{$("#x").3a(F,D).1J(\'29\',1O)}}C{1O()}J F};$.q.r.3c=p(){n a=\'\';a+=\'<9 s="T"></9>\';a+=\'<9 s="M"><9></9></9>\';a+=\'<9 s="x">\';a+=\'<9 s="3d">\';a+=\'<9 s="1i"></9>\';a+=\'<9 s="W"><9 I="W" s="4b"></9><9 I="W" s="4c"></9><9 I="W" s="4d"></9><9 I="W" s="4e"></9><9 I="W" s="4f"></9><9 I="W" s="4g"></9><9 I="W" s="4h"></9><9 I="W" s="4i"></9></9>\';a+=\'<a K="2k:;" s="1o"><1P I="2l" s="2W"></1P></a><a K="2k:;" s="1n"><1P I="2l" s="2Y"></1P></a>\';a+=\'<9 s="y"></9>\';a+=\'</9>\';a+=\'</9>\';a+=\'<9 s="H"></9>\';$(a).3e("4j");$(\'<3f 4k="0" 4l="0" 4m="0"><3g><1k I="H" s="4n"></1k><1k I="H" s="4o"><9></9></1k><1k I="H" s="4p"></1k></3g></3f>\').3e(\'#H\');8($.14.1g){$(".W").1Q()}8(18){$("9#T").u("1u","2r");$("#M 9, #1i, .H, .2l").1Q();$("#3d").4q(\'<1j s="3h" 13="2k:F;" 4r="2q" 2H="0"></1j>\');n b=$(\'#3h\')[0].4s.U;b.4t();b.1c()}};$.q.r.2v={N:10,2J:D,2e:D,2c:0,2j:0,2S:4u,2U:\'2m\',3b:\'2m\',2T:\'2m\',1G:4v,1H:4w,1E:D,2B:0.3,2A:\'#4x\',2Z:D,33:D,31:D,30:D,2h:D,v:[],1U:1A,2g:1A,2i:1A};$(U).4y(p(){m=$.14.1g&&!$.4z;8($("#x").Y<1){$.q.r.3c()}})})(2F);',62,284,'||||opts||||if|div||||||||||||||var||function|fn|tauschbox|id|itemCurrent|css|itemArray||tausch_outer|tausch_content|top|height|left|else|true|width|false|title|tausch_title|class|return|href|fb|tausch_loading|padding|this|Math|unbind|px|orig|tausch_overlay|document|visible|tausch_bg|imagePreloader|length|show||bind||src|browser|style|is|click|IE6|window|hide|round|close|match|filter|busy|msie|_change_item|tausch_close|iframe|td|img|undefined|tausch_right|tausch_left|_set_content|getViewport|empty|_finish|getNumeric|position|new|Image|loadingTimer|loadingFrame|imageRegExp|null|rel|children|first|overlayShow|showLoading|frameWidth|frameHeight|objNext|fadeOut|append|normal|removeAttribute|keydown|__cleanup|span|fixPNG|substr|oldIE|isFunction|callbackOnStart|typeof|alt|embed|object|select||visibility|opacity|resize|scroll|_proceed_image|60||min|fast|fadeIn|animate|zoomSpeedIn|getPosition|zoomOpacity|keyCode|callbackOnShow|centerOnScroll|callbackOnClose|zoomSpeedOut|javascript|tausch_ico|swing|each|backgroundImage|png|no|absolute|relative|version|extend|defaults|_initialize|_start|attr|push|overlayColor|overlayOpacity|scrollBox|indexOf|tausch_frame|jQuery|showIframe|frameborder|html|imageScale|_preload_neighbor_images|removeExpression|right|bottom|auto|setExpression|parentNode|100|zoomSpeedChange|easingChange|easingIn|_set_navigation|tausch_left_ico|stopPropagation|tausch_right_ico|enableEscapeButton|hideOnContentClick|hideOnOverlayClick||showCloseButton|outerHeight|outerWidth|animateLoading||clearInterval||stop|easingOut|build|tausch_inner|appendTo|table|tr|tausch_bigIframe|url|RegExp|none|progid|DXImageTransform|Microsoft|AlphaImageLoader|enabled|sizingMethod|backgroundRepeat|repeat|crop|scale|jpg|gif|bmp|jpeg|XMLHttpRequest|for|while|hidden|background|color|className|onload|name|tausch_iframe|random|1000|hspace|location|split|replace|tausch_div|complete|load|get|tausch_ajax|tausch_img|clientHeight|clientWidth|text|parseInt|curCSS||jquery|offset|paddingTop|borderTopWidth|paddingLeft|borderLeftWidth|scrollLeft|scrollTop|setInterval|66|tausch_bg_n|tausch_bg_ne|tausch_bg_e|tausch_bg_se|tausch_bg_s|tausch_bg_sw|tausch_bg_w|tausch_bg_nw|body|cellspacing|cellpadding|border|tausch_title_left|tausch_title_main|tausch_title_right|prepend|scrolling|contentWindow|open|300|560|340|666|ready|boxModel'.split('|'),0,{}));

/**************************
 * Showcase gallery TODO: compress
 *************************/
															;(function($){

															var $$;

															$$ = $.fn.galleria = function($options) {
																
																// check for basic CSS support
																if (!$$.hasCSS()) { return false; }
																
																// init the modified history object
																$.historyInit($$.onPageLoad);
																
																// set default options
																var $defaults = {
																	insert      : '.galleria_container',
																	history     : true,
																	clickNext   : true,
																	onImage     : function(image,caption,thumb) {},
																	onThumb     : function(thumb) {}
																};
																
																var $opts = $.extend($defaults, $options);
																
																// bring the options to the galleria object
																for (var i in $opts) {
																	$.galleria[i]  = $opts[i];
																}
																
																// if no insert selector, create a new division and insert it before the ul
																var _insert = ( $($opts.insert).is($opts.insert) ) ? 
																	$($opts.insert) : 
																	jQuery(document.createElement('div')).insertBefore(this);
																	
																// create a wrapping div for the image
																var _div = $(document.createElement('div')).addClass('galleria_wrapper');
																
																// create a caption span
																var _span = $(document.createElement('span')).addClass('caption');
																
																// inject the wrapper in in the insert selector
																_insert.addClass('galleria_container').append(_div).append(_span);
																
																//-------------
																
																return this.each(function(){
																	
																	// add the Galleria class
																	$(this).addClass('galleria');
																	
																	// loop through list
																	$(this).children('li').each(function(i) {
																		
																		// bring the scope
																		var _container = $(this);
																						
																		// build element specific options
																		var _o = $.meta ? $.extend({}, $opts, _container.data()) : $opts;
																		
																		// remove the clickNext if image is only child
																		_o.clickNext = $(this).is(':only-child') ? false : _o.clickNext;
																		
																		// try to fetch an anchor
																		var _a = $(this).find('a').is('a') ? $(this).find('a') : false;
																		
																		// reference the original image as a variable and hide it
																		var _img = $(this).children('img').css('display','none');
																		
																		// extract the original source
																		var _src = _a ? _a.attr('href') : _img.attr('src');
																		
																		// find a title
																		var _title = _a ? _a.attr('title') : _img.attr('title');
																		
																		// create loader image            
																		var _loader = new Image();
																		
																		// check url and activate container if match
																		if (_o.history && (window.location.hash && window.location.hash.replace(/\#/,'') == _src)) {
																			_container.siblings('.active').removeClass('active');
																			_container.addClass('active');
																		}
																	
																		// begin loader
																		$(_loader).load(function () {
																			
																			// try to bring the alt
																			$(this).attr('alt',_img.attr('alt'));
																			
																			//-----------------------------------------------------------------
																			// the image is loaded, let's create the thumbnail
																			
																			var _thumb = _a ? 
																				_a.find('img').addClass('thumb noscale').css('display','none') :
																				_img.clone(true).addClass('thumb').css('display','none');
																			
																			if (_a) { _a.replaceWith(_thumb); }
																			
																			if (!_thumb.hasClass('noscale')) { // scaled tumbnails!
																				var w = Math.ceil( _img.width() / _img.height() * _container.height() );
																				var h = Math.ceil( _img.height() / _img.width() * _container.width() );
																				if (w < h) {
																					_thumb.css({ height: 'auto', width: _container.width(), marginTop: -(h-_container.height())/2 });
																				} else {
																					_thumb.css({ width: 'auto', height: _container.height(), marginLeft: -(w-_container.width())/2 });
																				}
																			} else { // Center thumbnails.
																				// a tiny timer fixed the width/height
																				window.setTimeout(function() {
																					_thumb.css({
																						marginLeft: -( _thumb.width() - _container.width() )/2, 
																						marginTop:  -( _thumb.height() - _container.height() )/2
																					});
																				}, 1);
																			}
																			
																			// add the rel attribute
																			_thumb.attr('rel',_src);
																			
																			// add the title attribute
																			_thumb.attr('title',_title);
																			
																			// add the click functionality to the _thumb
																			_thumb.click(function() {
																				$.galleria.activate(_src);
																			});
																			
																			// hover classes for IE6
																			_thumb.hover(
																				function() { $(this).addClass('hover'); },
																				function() { $(this).removeClass('hover'); }
																			);
																			_container.hover(
																				function() { _container.addClass('hover'); },
																				function() { _container.removeClass('hover'); }
																			);

																			// prepend the thumbnail in the container
																			_container.prepend(_thumb);
																			
																			// show the thumbnail
																			_thumb.css('display','block');
																			
																			// call the onThumb function
																			_o.onThumb(jQuery(_thumb));
																			
																			// check active class and activate image if match
																			if (_container.hasClass('active')) {
																				$.galleria.activate(_src);
																				//_span.text(_title);
																			}
																			
																			//-----------------------------------------------------------------
																			
																			// finally delete the original image
																			_img.remove();
																			
																		}).error(function () {
																			
																			// Error handling
																			_container.html('<span class="error" style="color:red">Error loading image: '+_src+'</span>');
																		
																		}).attr('src', _src);
																	});
																});
															};

															/**
															 *
															 * @name NextSelector
															 *
															 * @desc Returns the sibling sibling, or the first one
															 *
															**/

															$$.nextSelector = function(selector) {
																return $(selector).is(':last-child') ?
																	   $(selector).siblings(':first-child') :
																	   $(selector).next();
																	   
															};

															/**
															 *
															 * @name previousSelector
															 *
															 * @desc Returns the previous sibling, or the last one
															 *
															**/

															$$.previousSelector = function(selector) {
																return $(selector).is(':first-child') ?
																	   $(selector).siblings(':last-child') :
																	   $(selector).prev();
																	   
															};

															/**
															 *
															 * @name hasCSS
															 *
															 * @desc Checks for CSS support and returns a boolean value
															 *
															**/

															$$.hasCSS = function()  {
																$('body').append(
																	$(document.createElement('div')).attr('id','css_test')
																	.css({ width:'1px', height:'1px', display:'none' })
																);
																var _v = ($('#css_test').width() != 1) ? false : true;
																$('#css_test').remove();
																return _v;
															};

															/**
															 *
															 * @name onPageLoad
															 *
															 * @desc The function that displays the image and alters the active classes
															 *
															 * Note: This function gets called when:
															 * 1. after calling $.historyInit();
															 * 2. after calling $.historyLoad();
															 * 3. after pushing "Go Back" button of a browser
															 *
															**/

															$$.onPageLoad = function(_src) {	
																
																// get the wrapper
																var _wrapper = $('.galleria_wrapper');
																
																// get the thumb
																var _thumb = $('.galleria img[rel="'+_src+'"]');
																
																if (_src) {
																	
																	// new hash location
																	if ($.galleria.history) {
																		window.location = window.location.href.replace(/\#.*/,'') + '#' + _src;
																	}
																	
																	// alter the active classes
																	_thumb.parents('li').siblings('.active').removeClass('active');
																	_thumb.parents('li').addClass('active');
																
																	// define a new image
																	$('img.remove').remove();
																	_wrapper.find('img.replaced').css('z-index', 100, 'position', 'absolute').fadeOut(600).addClass('remove');
				
																	var _img   = $(new Image()).attr('src',_src).addClass('replaced').fadeIn(600);

																	


																	// empty the wrapper and insert the new image
																	_wrapper.append(_img);

																	// insert the caption
																	_wrapper.siblings('.caption').text(_thumb.attr('title'));
																	
																	// fire the onImage function to customize the loaded image's features
																	$.galleria.onImage(_img,_wrapper.siblings('.caption'),_thumb);
																	// add clickable image helper
																	if($.galleria.clickNext) {
																		/*
																		_img.css('cursor','pointer').click(function() {
																		$('.imageZoom img').remove();
																		$('.imageZoom').append("<img src='" + _img.attr('src') + "' />");
																		$('.imageZoom').css('visibility','visible');
																		})
																		*/
																	}
																	
																} else {
																	
																	// clean up the container if none are active
																	_wrapper.siblings().andSelf().empty();
																	
																	// remove active classes
																	$('.galleria li.active').removeClass('active');
																}

																// place the source in the galleria.current variable
																$.galleria.current = _src;
																
															}

															/**
															 *
															 * @name jQuery.galleria
															 *
															 * @desc The global galleria object holds four constant variables and four public methods:
															 *       $.galleria.history = a boolean for setting the history object in action with named URLs
															 *       $.galleria.current = is the current source that's being viewed.
															 *       $.galleria.clickNext = boolean helper for adding a clickable image that leads to the next one in line
															 *       $.galleria.next() = displays the next image in line, returns to first image after the last.
															 *       $.galleria.prev() = displays the previous image in line, returns to last image after the first.
															 *       $.galleria.activate(_src) = displays an image from _src in the galleria container.
															 *       $.galleria.onImage(image,caption) = gets fired when the image is displayed.
															 *
															**/

															$.extend({galleria : {
																current : '',
																onImage : function(){},
																activate : function(_src) { 
																	if ($.galleria.history) {
																		$.historyLoad(_src);
																	} else {
																		$$.onPageLoad(_src);
																	}
																},
																next : function() {
																	var _next = $($$.nextSelector($('.galleria img[rel="'+$.galleria.current+'"]').parents('li'))).find('img').attr('rel');
																	$.galleria.activate(_next);
																},
																prev : function() {
																	var _prev = $($$.previousSelector($('.galleria img[rel="'+$.galleria.current+'"]').parents('li'))).find('img').attr('rel');
																	$.galleria.activate(_prev);
																}
															}
															});

															})(jQuery);

/**************************
 * History
 *************************/
jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyInit:function(callback){jQuery.historyCallback=callback;var current_hash=location.hash;jQuery.historyCurrentHash=current_hash;if(jQuery.browser.msie){if(jQuery.historyCurrentHash==''){jQuery.historyCurrentHash='#'}$("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=current_hash}else if($.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.isFirst=true}jQuery.historyCallback(current_hash.replace(/^#/,''));setInterval(jQuery.historyCheck,100)},historyAddHistory:function(hash){jQuery.historyBackStack.push(hash);jQuery.historyForwardStack.length=0;this.isFirst=true},historyCheck:function(){if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;var current_hash=iframe.location.hash;if(current_hash!=jQuery.historyCurrentHash){location.hash=current_hash;jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''))}}else if($.browser.safari){if(!jQuery.dontCheck){var historyDelta=history.length-jQuery.historyBackStack.length;if(historyDelta){jQuery.isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop())}else{for(var i=0;i<historyDelta;i++)jQuery.historyBackStack.push(jQuery.historyForwardStack.shift())}var cachedHash=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(cachedHash!=undefined){jQuery.historyCurrentHash=location.hash;jQuery.historyCallback(cachedHash)}}else if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]==undefined&&!jQuery.isFirst){if(document.URL.indexOf('#')>=0){jQuery.historyCallback(document.URL.split('#')[1])}else{var current_hash=location.hash;jQuery.historyCallback('')}jQuery.isFirst=true}}}else{var current_hash=location.hash;if(current_hash!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''))}}},historyLoad:function(hash){var newhash;if(jQuery.browser.safari){newhash=hash}else{newhash='#'+hash;location.hash=newhash}jQuery.historyCurrentHash=newhash;if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;jQuery.historyCallback(hash)}else if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(hash);var fn=function(){jQuery.dontCheck=false};window.setTimeout(fn,200);jQuery.historyCallback(hash);location.hash=newhash}else{jQuery.historyCallback(hash)}}});

/**************************
 * Timeout
 *************************/
(function($){if(typeof $.timeout!="undefined")return;$.extend({timeout:function(func,delay){if(typeof $.timeout.count=="undefined")$.timeout.count=0;if(typeof $.timeout.funcs=="undefined")$.timeout.funcs=new Array();if(typeof func=='string')return setTimeout(func,delay);if(typeof func=='function'){$.timeout.count++;$.timeout.funcs[$.timeout.count]=func;return setTimeout("$.timeout.funcs['"+$.timeout.count+"']();",delay)}},interval:function(func,delay){if(typeof $.interval.count=="undefined")$.interval.count=0;if(typeof $.interval.funcs=="undefined")$.interval.funcs=new Array();if(typeof func=='string')return setInterval(func,delay);if(typeof func=='function'){$.interval.count++;$.interval.funcs[$.interval.count]=func;return setInterval("$.interval.funcs['"+$.interval.count+"']();",delay)}},idle:function(func,delay){if(typeof $.idle.lasttimeout=="undefined")$.idle.lasttimeout=null;if(typeof $.idle.lastfunc=="undefined")$.idle.lastfunc=null;if($.idle.timeout){clearTimeout($.idle.timeout);$.idle.timeout=null;$.idle.lastfunc=null}if(typeof(func)=='string'){$.idle.timeout=setTimeout(func,delay);return $.idle.timeout}if(typeof(func)=='function'){$.idle.lastfunc=func;$.idle.timeout=setTimeout("$.idle.lastfunc();",delay);return $.idle.timeout}},clear:function(countdown){clearInterval(countdown);clearTimeout(countdown)}})})(jQuery);

/**************************
 * Document Ready
 *************************/
	$(document).ready(function(){
		$(document).pngFix();
		
		/**************************
		 * Menu
		 *************************/
		$('#menu ul li ul li.active').parent().parent().removeClass('active');


		$("a#route").tauschbox({
			'hideOnContentClick': false,
			'frameWidth': 900,
			'frameHeight': 480
		});


		$('.gallery_unstyled').addClass('gallery'); // adds new class name to maintain degradability
		$('.nav').css('display','none'); // hides the nav initially
		$('ul.gallery').galleria({
			history   : false, // deactivates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable. Let's not have that in this example.
			insert    : undefined, // the containing selector for our main image. 
								   // If not found or undefined (like here), galleria will create a container 
								   // before the ul with the class .galleria_container (see CSS)
			onImage   : function() { $('.nav').css('display','block'); } // shows the nav when the image is showing
		});
		
/*
		$('.imageZoom .close').click(function() {
			$('.imageZoom').css('visibility', 'hidden');
		});
*/
	});

function startAutoPlay() {
	$(document).ready(function(){
		function autoplay() {
			$.galleria.next();
			return false;
		}
		setInterval(autoplay, 9000);
	});
}