



/* #### http://devkick.com/lab/galleria/ - jquery.galleria.pack.js - used for gallery realized with zms specObj minifiedGallery #### */
(function($){var $$;$$=$.fn.galleria=function($options){if(!$$.hasCSS()){return false;}$.historyInit($$.onPageLoad);var $defaults={insert:'.galleria_container',history:true,clickNext:true,onImage:function(image,caption,thumb){},onThumb:function(thumb){}};var $opts=$.extend($defaults,$options);for(var i in $opts){if(i){$.galleria[i]=$opts[i];}}var _insert=($($opts.insert).is($opts.insert))?$($opts.insert):jQuery(document.createElement('div')).insertBefore(this);var _div=$(document.createElement('div')).addClass('galleria_wrapper');var _span=$(document.createElement('span')).addClass('caption');_insert.addClass('galleria_container').append(_div).append(_span);return this.each(function(){$(this).addClass('galleria');$(this).children('li').each(function(i){var _container=$(this);var _o=$.meta?$.extend({},$opts,_container.data()):$opts;_o.clickNext=$(this).is(':only-child')?false:_o.clickNext;var _a=$(this).find('a').is('a')?$(this).find('a'):false;var _img=$(this).children('img').css('display','none');var _src=_a?_a.attr('href'):_img.attr('src');var _title=_a?_a.attr('title'):_img.attr('title');var _loader=new Image();if(_o.history&&(window.location.hash&&window.location.hash.replace(/\#/,'')==_src)){_container.siblings('.active').removeClass('active');_container.addClass('active');}$(_loader).load(function(){$(this).attr('alt',_img.attr('alt'));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')){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{window.setTimeout(function(){_thumb.css({marginLeft:-(_thumb.width()-_container.width())/2,marginTop:-(_thumb.height()-_container.height())/2});},1);}_thumb.attr('rel',_src);_thumb.attr('title',_title);_thumb.click(function(){$.galleria.activate(_src);});_thumb.hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});_container.hover(function(){_container.addClass('hover');},function(){_container.removeClass('hover');});_container.prepend(_thumb);_thumb.css('display','block');_o.onThumb(jQuery(_thumb));if(_container.hasClass('active')){$.galleria.activate(_src);}_img.remove();}).error(function(){_container.html('<span class="error" style="color:red">Error loading image: '+_src+'</span>');}).attr('src',_src);});});};$$.nextSelector=function(selector){return $(selector).is(':last-child')?$(selector).siblings(':first-child'):$(selector).next();};$$.previousSelector=function(selector){return $(selector).is(':first-child')?$(selector).siblings(':last-child'):$(selector).prev();};$$.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;};$$.onPageLoad=function(_src){var _wrapper=$('.galleria_wrapper');var _thumb=$('.galleria img[@rel="'+_src+'"]');if(_src){if($.galleria.history){window.location=window.location.href.replace(/\#.*/,'')+'#'+_src;}_thumb.parents('li').siblings('.active').removeClass('active');_thumb.parents('li').addClass('active');var _img=$(new Image()).attr('src',_src).addClass('replaced');_wrapper.empty().append(_img);_wrapper.siblings('.caption').text(_thumb.attr('title'));$.galleria.onImage(_img,_wrapper.siblings('.caption'),_thumb);if($.galleria.clickNext){_img.css('cursor','pointer').click(function(){$.galleria.next();});}}else{_wrapper.siblings().andSelf().empty();$('.galleria li.active').removeClass('active');}$.galleria.current=_src;};$.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);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;var i;if(historyDelta<0){for(i=0;i<Math.abs(historyDelta);i++){jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop());}}else{for(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{current_hash=location.hash;jQuery.historyCallback('');}jQuery.isFirst=true;}}}else{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);}}});
/* #### jquery.dimensions.js - used for fancyzoom realized with zms specObj fancyZoom #### */

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 15:43:48 +0100 (Do, 20 Dez 2007) $
 * $Rev: 4257 $
 *
 * Version: @VERSION
 *
 * Requires: jQuery 1.2+
 */

(function($){
	
$.dimensions = {
	version: '@VERSION'
};

// Create innerHeight, innerWidth, outerHeight and outerWidth methods
$.each( [ 'Height', 'Width' ], function(i, name){
	
	// innerHeight and innerWidth
	$.fn[ 'inner' + name ] = function() {
		if (!this[0]) return;
		
		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
		
		return this.is(':visible') ? this[0]['client' + name] : num( this, name.toLowerCase() ) + num(this, 'padding' + torl) + num(this, 'padding' + borr);
	};
	
	// outerHeight and outerWidth
	$.fn[ 'outer' + name ] = function(options) {
		if (!this[0]) return;
		
		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
		
		options = $.extend({ margin: false }, options || {});
		
		var val = this.is(':visible') ? 
				this[0]['offset' + name] : 
				num( this, name.toLowerCase() )
					+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')
					+ num(this, 'padding' + torl) + num(this, 'padding' + borr);
		
		return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
	};
});

// Create scrollLeft and scrollTop methods
$.each( ['Left', 'Top'], function(i, name) {
	$.fn[ 'scroll' + name ] = function(val) {
		if (!this[0]) return;
		
		return val != undefined ?
		
			// Set the scroll offset
			this.each(function() {
				this == window || this == document ?
					window.scrollTo( 
						name == 'Left' ? val : $(window)[ 'scrollLeft' ](),
						name == 'Top'  ? val : $(window)[ 'scrollTop'  ]()
					) :
					this[ 'scroll' + name ] = val;
			}) :
			
			// Return the scroll offset
			this[0] == window || this[0] == document ?
				self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||
					$.boxModel && document.documentElement[ 'scroll' + name ] ||
					document.body[ 'scroll' + name ] :
				this[0][ 'scroll' + name ];
	};
});

$.fn.extend({
	position: function() {
		var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
		
		if (elem) {
			// Get *real* offsetParent
			offsetParent = this.offsetParent();
			
			// Get correct offsets
			offset       = this.offset();
			parentOffset = offsetParent.offset();
			
			// Subtract element margins
			offset.top  -= num(elem, 'marginTop');
			offset.left -= num(elem, 'marginLeft');
			
			// Add offsetParent borders
			parentOffset.top  += num(offsetParent, 'borderTopWidth');
			parentOffset.left += num(offsetParent, 'borderLeftWidth');
			
			// Subtract the two offsets
			results = {
				top:  offset.top  - parentOffset.top,
				left: offset.left - parentOffset.left
			};
		}
		
		return results;
	},
	
	offsetParent: function() {
		var offsetParent = this[0].offsetParent;
		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
			offsetParent = offsetParent.offsetParent;
		return $(offsetParent);
	}
});

function num(el, prop) {
	return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
};

})(jQuery);

/* #### jquery.fancyzoom.pack.js - used for fancyzoom realized with zms specObj fancyZoom #### */
/**
* jQuery fancyzoom plugin.
* This is an adaptation of the fancyzoom effect as a jQuery plugin
*
* Author: Mathieu Vilaplana <mvilaplana@df-e.com>
* Date: March 2008
* rev 1.0
* rev: 1.1
* Add title if alt in the img
*/
(function($){var s='common/scripts/jquery/resources/fancyZoom/';var t=$('<div>');var u=$('<img>').css({position:'absolute',top:0,left:0,cursor:'pointer',zIndex:102});$.fn.fancyzoom=function(q){var r=$('<div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,cursor:"wait"});function openZoomBox(a,o){if(o.showoverlay){r.appendTo('body').click(function(){closeZoomBox(o)})}pos=a.offset();o=$.extend(o,{dimOri:{width:a.outerWidth(),height:a.outerHeight(),left:pos.left,top:pos.top,'opacity':0}});var b=$('img',t);t.css({'opacity':0,'text-align':'center','border':'0px solid red'}).appendTo('body');var c=t.outerWidth();var d=t.outerHeight();dimBoxTarget=$.extend({},{width:c,height:d,'opacity':1},__posCenter((c+15),(d+30)));u.css({left:(dimBoxTarget.left+dimBoxTarget.width-22-(dimBoxTarget.width-b.width())/2),top:dimBoxTarget.top});var e=function(){if($.fn.shadow&&!$.browser.msie){$('img:first',t).shadow(o.shadowOpts)}if(o.Speed>0&&!$.browser.msie){u.fadeIn('slow');$('div',t).fadeIn('slow')}else{u.show();$('div',t).show()}};$('div',t).hide();if(o.Speed>0){t.css(o.dimOri).animate(dimBoxTarget,o.Speed,e)}else{t.css(dimBoxTarget);e()}}function closeZoomBox(o){u.remove();if(o.Speed>0){t.animate(o.dimOri,o.Speed,function(){$(this).empty().remove()});if(o.showoverlay){r.animate({'opacity':0},o.Speed,function(){$(this).empty().remove()})}}else{t.empty().remove();if(o.showoverlay){r.empty().remove()}}}return this.each(function(){var l=$(this);var m=l.is('img')?l:$('img:first',l);var n=null;if(l.attr('href')){n=l.attr('href')}if(l.is('img')){n=l.attr('src');l.css('cursor','pointer')}var p=$.extend({},$.fn.fancyzoom.defaultsOptions,q||{},{dimOri:{},oImgZoomBoxProp:{position:'absolute',left:0,top:0}});r.css({opacity:p.overlay,background:p.overlayColor});if(!/\.jpg|\.png|\.gif/i.test(n)||($('img',l).size()===0&&!l.is('img'))){return}l.click(function(){if(v&&v.is(':visible')||x){if(t&&$('img:first',t).attr('src')!=n){__cancelLoading()}else{return false}}var o=$.extend({},p,q);if(t&&t.parent().size()>0){var b=$('img:first',t);if(n==b.attr('src')){pos=m.offset();o=$.extend(o,{dimOri:{width:m.outerWidth(),height:m.outerHeight(),left:pos.left,top:pos.top,'opacity':0}});closeZoomBox(o);return false}else{u.remove();t.empty().remove()}}if(o.showoverlay&&r){r.empty().remove().css({'opacity':o.overlay})}u.attr('src',o.imgDir+'closebox.png').appendTo('body').hide();if($.fn.ifixpng){$.ifixpng(o.imgDir+'blank.gif');u.ifixpng(o.imgDir+'blank.gif')}u.unbind('click').click(function(){closeZoomBox(o)});t=$('<div>').empty().css(o.oImgZoomBoxProp);var c=m.attr('alt');if(c){var d=$('<div><center><table height=0 border="0" cellspacing=0 cellpadding=0><tr><td></td><td class="fancyTitle">'+c+'</td><td></td></table></center></div>').css({marginTop:10,marginRight:15});var e=d.find('td:first').css({'background':'url('+o.imgDir+'zoom-caption-l.png)',width:'13px',height:'26px'});var f=d.find('td:last').css({'background':'url('+o.imgDir+'zoom-caption-r.png)',width:'13px',height:'26px'});var g=$('.fancyTitle',d).css({'background':'url('+o.imgDir+'zoom-caption-fill.png)','padding':'0px 20px',color:'#FFF','font-size':'14px'});if($.fn.ifixpng){e.ifixpng(o.imgDir+'blank.gif');f.ifixpng(o.imgDir+'blank.gif');g.ifixpng(o.imgDir+'blank.gif')}d.appendTo(t)}var h=$('<img />').attr('src',n).css({zIndex:100,marginTop:15,marginRight:15}).click(function(){closeZoomBox(o)}).prependTo(t);var i=new Image();i.src=n;var j=function(){if(w){w=false}else{if(__getFileName(i.src)==__getFileName($('img:first',t).attr('src'))){k();openZoomBox(m,o);__stoploading()}}};var k=function(){var a=$('<div></div>').css({position:'absolute','top':0,'left':0,opacity:0,'border':'0px solid red'});h.appendTo(a);a.appendTo('body');imWidth=h.width();imHeight=h.height();maxWidth=$(window).width()*0.9;maxHeight=$(window).height()*0.8;if(maxHeight<imHeight){h.css('height',maxHeight)}else if(maxWidth<imWidth){h.css('width',maxWidth)}a.remove();h.prependTo(t)};if(i.complete){k();openZoomBox(m,o)}else{__displayLoading();i.onload=function(){j()}}return false})})};$.fn.fancyzoom.defaultsOptions={overlayColor:'#000',overlay:0.6,showoverlay:false,Speed:400,shadowOpts:{color:"#000",offset:4,opacity:0.2},imgDir:s};function __posCenter(a,b){var c=($(window).width()-a)/2+$(window).scrollLeft();var d=($(window).height()-b)/2+$(window).scrollTop();c=(c<0)?0:c;d=(d<0)?0:d;return{left:c,top:d}}var v=null;var w=false;var x=null;function __displayLoading(){if(!v){v=$('<div></div>').css({width:50,height:50,position:'absolute','background':'transparent',opacity:8/10,color:'#FFF',padding:'5px','font-size':'10px'})}v.css(__posCenter(50,50)).html('<img src="'+$.fn.fancyzoom.defaultsOptions.imgDir+'blank.gif" />').click(function(){__cancelLoading()}).appendTo('body').show();x=setTimeout(__changeimageLoading,400)}function __cancelLoading(){w=true;__stoploading()}function __stoploading(){v.hide().remove();if(x){clearTimeout(x);x=null}}function __changeimageLoading(){if(!v.is(':visible')){x=null;return}var a=$('img',v);if(!a.attr('src')||/blank\.gif/.test(a.attr('src'))){strImgSrc=$.fn.fancyzoom.defaultsOptions.imgDir+"zoom-spin-1.png"}else{tab=a.attr('src').split(/[- .]+/);iImg=parseInt(tab[2]);iImg=(iImg<12)?(iImg+1):1;strImgSrc=tab[0]+"-"+tab[1]+"-"+iImg+"."+tab[3]}var b=new Image();b.src=strImgSrc;var c=function(){v.css(__posCenter(50,50));a.attr('src',strImgSrc);x=setTimeout(__changeimageLoading,100)};if(b.complete){c()}else{b.onload=c}}function __getFileName(a){if(!a){return false}var b=a.split('/');return((b.length<1)?a:b[(b.length-1)])}})(jQuery);

/* #### jquery Customizations #### */

/*  --- fancyzoom for zms specobj fancyZoom*/
$(function(){
	$('#web div.fancyZoomWrapper> a').fancyzoom({Speed:800,showoverlay:false});
	$('#nooverlay').fancyzoom({Speed:0,showoverlay:true,overlay:4/10});
	$('img.fancyzoom').fancyzoom();
	});



/*  --- fancyzoom for zms specobj minifiedGallery */
jQuery(function($) {

	$('.audifGallery').addClass('gallery_audif'); // adds new class name to maintain degradability
	$('.nav').css('display','none'); // hides the nav initially

	$('ul.gallery_audif').galleria({
		history   : false, // deactivates the history object for bookmarking, back-button etc.
		clickNext : false, // 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
	});
});



