jQuery.noConflict( );
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */


jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
/* Copyright (c) 2006 Brandon Aaron (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-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2447 $
 *
 * Version 2.1.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
/* 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-08-17 13:14:11 -0500 (Fri, 17 Aug 2007) $
 * $Rev: 2759 $
 *
 * Version: 1.1.2
 *
 * Requires: jQuery 1.1.3+
 */
(function($){var height=$.fn.height,width=$.fn.width;$.fn.extend({height:function(){if(!this[0])error();if(this[0]==window)if($.browser.opera||($.browser.safari&&parseInt($.browser.version)>520))return self.innerHeight-(($(document).height()>self.innerHeight)?getScrollbarWidth():0);else if($.browser.safari)return self.innerHeight;else
return $.boxModel&&document.documentElement.clientHeight||document.body.clientHeight;if(this[0]==document)return Math.max(($.boxModel&&document.documentElement.scrollHeight||document.body.scrollHeight),document.body.offsetHeight);return height.apply(this,arguments);},width:function(){if(!this[0])error();if(this[0]==window)if($.browser.opera||($.browser.safari&&parseInt($.browser.version)>520))return self.innerWidth-(($(document).width()>self.innerWidth)?getScrollbarWidth():0);else if($.browser.safari)return self.innerWidth;else
return $.boxModel&&document.documentElement.clientWidth||document.body.clientWidth;if(this[0]==document)if($.browser.mozilla){var scrollLeft=self.pageXOffset;self.scrollTo(99999999,self.pageYOffset);var scrollWidth=self.pageXOffset;self.scrollTo(scrollLeft,self.pageYOffset);return document.body.offsetWidth+scrollWidth;}else
return Math.max((($.boxModel&&!$.browser.safari)&&document.documentElement.scrollWidth||document.body.scrollWidth),document.body.offsetWidth);return width.apply(this,arguments);},innerHeight:function(){if(!this[0])error();return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight-num(this,'borderTopWidth')-num(this,'borderBottomWidth'):this.height()+num(this,'paddingTop')+num(this,'paddingBottom');},innerWidth:function(){if(!this[0])error();return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth-num(this,'borderLeftWidth')-num(this,'borderRightWidth'):this.width()+num(this,'paddingLeft')+num(this,'paddingRight');},outerHeight:function(options){if(!this[0])error();options=$.extend({margin:false},options||{});return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight+(options.margin?(num(this,'marginTop')+num(this,'marginBottom')):0):this.height()+num(this,'borderTopWidth')+num(this,'borderBottomWidth')+num(this,'paddingTop')+num(this,'paddingBottom')+(options.margin?(num(this,'marginTop')+num(this,'marginBottom')):0);},outerWidth:function(options){if(!this[0])error();options=$.extend({margin:false},options||{});return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth+(options.margin?(num(this,'marginLeft')+num(this,'marginRight')):0):this.width()+num(this,'borderLeftWidth')+num(this,'borderRightWidth')+num(this,'paddingLeft')+num(this,'paddingRight')+(options.margin?(num(this,'marginLeft')+num(this,'marginRight')):0);},scrollLeft:function(val){if(!this[0])error();if(val!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo(val,$(window).scrollTop());else
this.scrollLeft=val;});if(this[0]==window||this[0]==document)return self.pageXOffset||$.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;return this[0].scrollLeft;},scrollTop:function(val){if(!this[0])error();if(val!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo($(window).scrollLeft(),val);else
this.scrollTop=val;});if(this[0]==window||this[0]==document)return self.pageYOffset||$.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;return this[0].scrollTop;},position:function(returnObject){return this.offset({margin:false,scroll:false,relativeTo:this.offsetParent()},returnObject);},offset:function(options,returnObject){if(!this[0])error();var x=0,y=0,sl=0,st=0,elem=this[0],parent=this[0],op,parPos,elemPos=$.css(elem,'position'),mo=$.browser.mozilla,ie=$.browser.msie,oa=$.browser.opera,sf=$.browser.safari,sf3=$.browser.safari&&parseInt($.browser.version)>520,absparent=false,relparent=false,options=$.extend({margin:true,border:false,padding:false,scroll:true,lite:false,relativeTo:document.body},options||{});if(options.lite)return this.offsetLite(options,returnObject);if(options.relativeTo.jquery)options.relativeTo=options.relativeTo[0];if(elem.tagName=='BODY'){x=elem.offsetLeft;y=elem.offsetTop;if(mo){x+=num(elem,'marginLeft')+(num(elem,'borderLeftWidth')*2);y+=num(elem,'marginTop')+(num(elem,'borderTopWidth')*2);}else
if(oa){x+=num(elem,'marginLeft');y+=num(elem,'marginTop');}else
if((ie&&jQuery.boxModel)){x+=num(elem,'borderLeftWidth');y+=num(elem,'borderTopWidth');}else
if(sf3){x+=num(elem,'marginLeft')+num(elem,'borderLeftWidth');y+=num(elem,'marginTop')+num(elem,'borderTopWidth');}}else{do{parPos=$.css(parent,'position');x+=parent.offsetLeft;y+=parent.offsetTop;if((mo&&!parent.tagName.match(/^t[d|h]$/i))||ie||sf3){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');if(mo&&parPos=='absolute')absparent=true;if(ie&&parPos=='relative')relparent=true;}op=parent.offsetParent||document.body;if(options.scroll||mo){do{if(options.scroll){sl+=parent.scrollLeft;st+=parent.scrollTop;}if(oa&&($.css(parent,'display')||'').match(/table-row|inline/)){sl=sl-((parent.scrollLeft==parent.offsetLeft)?parent.scrollLeft:0);st=st-((parent.scrollTop==parent.offsetTop)?parent.scrollTop:0);}if(mo&&parent!=elem&&$.css(parent,'overflow')!='visible'){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');}parent=parent.parentNode;}while(parent!=op);}parent=op;if(parent==options.relativeTo&&!(parent.tagName=='BODY'||parent.tagName=='HTML')){if(mo&&parent!=elem&&$.css(parent,'overflow')!='visible'){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');}if(((sf&&!sf3)||oa)&&parPos!='static'){x-=num(op,'borderLeftWidth');y-=num(op,'borderTopWidth');}break;}if(parent.tagName=='BODY'||parent.tagName=='HTML'){if(((sf&&!sf3)||(ie&&$.boxModel))&&elemPos!='absolute'&&elemPos!='fixed'){x+=num(parent,'marginLeft');y+=num(parent,'marginTop');}if(sf3||(mo&&!absparent&&elemPos!='fixed')||(ie&&elemPos=='static'&&!relparent)){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');}break;}}while(parent);}var returnValue=handleOffsetReturn(elem,options,x,y,sl,st);if(returnObject){$.extend(returnObject,returnValue);return this;}else{return returnValue;}},offsetLite:function(options,returnObject){if(!this[0])error();var x=0,y=0,sl=0,st=0,parent=this[0],offsetParent,options=$.extend({margin:true,border:false,padding:false,scroll:true,relativeTo:document.body},options||{});if(options.relativeTo.jquery)options.relativeTo=options.relativeTo[0];do{x+=parent.offsetLeft;y+=parent.offsetTop;offsetParent=parent.offsetParent||document.body;if(options.scroll){do{sl+=parent.scrollLeft;st+=parent.scrollTop;parent=parent.parentNode;}while(parent!=offsetParent);}parent=offsetParent;}while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML'&&parent!=options.relativeTo);var returnValue=handleOffsetReturn(this[0],options,x,y,sl,st);if(returnObject){$.extend(returnObject,returnValue);return this;}else{return returnValue;}},offsetParent:function(){if(!this[0])error();var offsetParent=this[0].offsetParent;while(offsetParent&&(offsetParent.tagName!='BODY'&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});var error=function(){throw"Dimensions: jQuery collection is empty";};var num=function(el,prop){return parseInt($.css(el.jquery?el[0]:el,prop))||0;};var handleOffsetReturn=function(elem,options,x,y,sl,st){if(!options.margin){x-=num(elem,'marginLeft');y-=num(elem,'marginTop');}if(options.border&&(($.browser.safari&&parseInt($.browser.version)<520)||$.browser.opera)){x+=num(elem,'borderLeftWidth');y+=num(elem,'borderTopWidth');}else if(!options.border&&!(($.browser.safari&&parseInt($.browser.version)<520)||$.browser.opera)){x-=num(elem,'borderLeftWidth');y-=num(elem,'borderTopWidth');}if(options.padding){x+=num(elem,'paddingLeft');y+=num(elem,'paddingTop');}if(options.scroll&&(!$.browser.opera||elem.offsetLeft!=elem.scrollLeft&&elem.offsetTop!=elem.scrollLeft)){sl-=elem.scrollLeft;st-=elem.scrollTop;}return options.scroll?{top:y-st,left:x-sl,scrollTop:st,scrollLeft:sl}:{top:y,left:x};};var scrollbarWidth=0;var getScrollbarWidth=function(){if(!scrollbarWidth){var testEl=$('<div>').css({width:100,height:100,overflow:'auto',position:'absolute',top:-1000,left:-1000}).appendTo('body');scrollbarWidth=100-testEl.append('<div>').find('div').css({width:'100%',height:200}).width();testEl.remove();}return scrollbarWidth;};})(jQuery);



/*
 * Tooltip - jQuery plugin  for styled tooltips
 *
 * Copyright (c) 2006 J???rn Zaefferer, Stefan Petre
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id$
 *
 */

/**
 * Display a customized tooltip instead of the default one
 * for every selected element. The tooltip behaviour mimics
 * the default one, but lets you style the tooltip and
 * specify the delay before displaying it.
 *
 * In addition, it displays the href value, if it is available.
 *
 * To style the tooltip, use these selectors in your stylesheet:
 *
 * #tooltip - The tooltip container
 *
 * #tooltip h3 - The tooltip title
 *
 * #tooltip p.body - The tooltip body, shown when using showBody
 *
 * #tooltip p.url - The tooltip url, shown when using showURL
 *
 * @example $('a, input, img').Tooltip();
 * @desc Shows tooltips for anchors, inputs and images, if they have a title
 *
 * @example $('label').Tooltip({
 *   delay: 0,
 *   track: true,
 *   event: "click"
 * });
 * @desc Shows tooltips for labels with no delay, tracking mousemovement, displaying the tooltip when the label is clicked.
 *
 * @example // modify global settings
 * $.extend($.fn.Tooltip.defaults, {
 * 	track: true,
 * 	delay: 0,
 * 	showURL: false,
 * 	showBody: " - ",
 *  fixPNG: true
 * });
 * // setup fancy tooltips
 * $('a.pretty').Tooltip({
 * 	 extraClass: "fancy"
 * });
 $('img.pretty').Tooltip({
 * 	 extraClass: "fancy-img",
 * });
 * @desc This example starts with modifying the global settings, applying them to all following Tooltips; Afterwards, Tooltips for anchors with class pretty are created with an extra class for the Tooltip: "fancy" for anchors, "fancy-img" for images
 *
 * @param Object settings (optional) Customize your Tooltips
 * @option Number delay The number of milliseconds before a tooltip is display, default is 250
 * @option String event The event on which the tooltip is displayed, default is "mouseover", "click" works fine, too
 * @option Boolean track If true, let the tooltip track the mousemovement, default is false
 * @option Boolean showURL If true, shows the href or src attribute within p.url, default is true
 * @option String showBody If specified, uses the String to split the title, displaying the first part in the h3 tag, all following in the p.body tag, separated with <br/>s, default is null
 * @option String extraClass If specified, adds the class to the tooltip helper, default is null
 * @option Boolean fixPNG If true, fixes transparent PNGs in IE, default is false
 *
 * @name Tooltip
 * @type jQuery
 * @cat Plugins/Tooltip
 * @author J???rn Zaefferer (http://bassistance.de)
 */
(function($) {
	// the tooltip element
	var helper,
		// it's title part
		tTitle,
		// it's body part
		tBody,
		// it's url part
		tUrl,
		// the current tooltipped element
		current,
		// the title of the current element, used for restoring
		oldTitle,
		// timeout id for delayed tooltips
		tID;

	// the public plugin method
	$.fn.Tooltip = function(settings) {
		// setup configuration
		settings = $.extend({}, arguments.callee.defaults, settings);

		// there can be only one tooltip helper
		if( !helper ) {
			// create the helper, h3 for title, div for url
			helper = $('<div id="tooltip"><span><h3></h3><div id="tooltip-icon"></div><p class="body"></p><p class="url"></p></span></div>')
				// hide it at first
				.hide()
				// move to top and position absolute, to let it follow the mouse
				// Temp display: 'block',  
				.css({ display: 'none', position: 'absolute', zIndex: "3000" })
				// add to document
				.appendTo('body');

			// save references to title and url elements
			tTitle = $('h3', helper);
			tBody = $('p.body', helper);
			tUrl = $('p.url', helper);
		}

		// bind events for every selected element with a title attribute
		$(this).filter('[@title]')
			// save settings into each element
			.each(function() {
				this.tSettings = settings;
			})
			// bind events
			.bind("mouseover", save)
            .bind("focus", save)
            .bind("focus", handle)
			.bind(settings.event, handle);
		return this;
	};

	// main event handler to start showing tooltips
	function handle(event) {
		// show helper, either with timeout or on instant
		if( this.tSettings.delay )
			tID = setTimeout(show, this.tSettings.delay);
		else
			show();

		// if selected, update the helper position when the mouse moves
		if(this.tSettings.track)
			$('body').bind('mousemove', update);

		// update at least once
		update(event);

		// hide the helper when the mouse moves out of the element
		$(this).bind('mouseout', hide);
        $(this).bind('blur', hide);
	}

	// save elements title before the tooltip is displayed
	function save() {
		// if this is the current source, or it has no title (occurs with click event), stop
		if(this == current || !this.title)
			return;
		// save current
		current = this;
		var source = $(this),
			settings = this.tSettings;

		// save title, remove from element and set to helper
		var title = oldTitle = source.attr('title');
		source.attr('title','');
		if(settings.showBody) {
			var parts = title.split(settings.showBody);
			tTitle.html(parts.shift());
			tBody.empty();
			for(var i = 0, part; part = parts[i]; i++) {
				if(i > 0)
					tBody.append("<br/>");
				tBody.append(part);
			}
			if(tBody.html())
				tBody.show();
			else
				tBody.hide();
		} else {
			tTitle.html(title);
			tBody.hide();
		}

		// if element has href or src, add and show it, otherwise hide it
		var href = (source.attr('href') || source.attr('src'));
		if( settings.showURL && href )
			tUrl.html(href.replace('http://', '')).show();
		else
			tUrl.hide();

		// add an optional class for this tip
		if( settings.extraClass ) {
			helper.addClass(settings.extraClass);
		}
		// fix PNG background for IE
		if (settings.fixPNG && $.browser.msie ) {
			helper.each(function () {
				if (this.currentStyle.backgroundImage != 'none') {
					var image = this.currentStyle.backgroundImage;
					image = image.substring(5, image.length - 2);
					$(this).css({
						'backgroundImage': 'none',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
					});
				}
			});
		}
	}

	// delete timeout and show helper
	function show() {
		tID = null;
		helper.show();
		update();
	}

	/**
	 * callback for mousemove
	 * updates the helper position
	 * removes itself when no current element
	 */
	function update(event)	{
		// if no current element is available, remove this listener
		if( current == null ) {
			$('body').unbind('mousemove', update);
			return;
		}

		var left = helper[0].offsetLeft;
		var top = helper[0].offsetTop;
		if(event) {
			/* start: 3867 */
			var $eTarget = $(event.target);
			var evTarget = $eTarget.get(0);
			if (evTarget) {
				var image = null;
				if (evTarget.nodeName.toLowerCase() == 'a') {
					image = $eTarget.children('img').get(0);
				} else 
				if (evTarget.nodeName.toLowerCase() == 'img') {
					image = evTarget;
				}
				if (image) {
					var regexp = /^.*\/([^/]+)\.[^.]+$/;
					regexp.exec(image.src);
					var className = RegExp.$1;
					if (className) {
						$('#tooltip-icon').attr('class', className);
					}
				}
				/* end: 3867 */
				
				var offset = $(event.target).offset();

				// position the helper to top left of target element
	            left = offset.left - 120;
				
				top  = offset.top - $(helper).height() - 30;
				
				// place the helper to the left if exceeds the viewport
				var vp = viewport();
				if ((left + helper[0].offsetWidth) > (vp.x + vp.cx)) {
					helper.addClass('tooltip-r');
					left -= (helper[0].offsetWidth - 4);
				} else {
					helper.removeClass('tooltip-r');
				}	
				helper.css({
					left: left + 'px',
					top: top + 'px'
				});
			}
		}
	}
	
	function viewport() {
		var e = document.documentElement || {},
			b = document.body || {},
			w = window;
		function min() {
			var v = Infinity;
			for( var i = 0;  i < arguments.length;  i++ ) {
				var n = arguments[i];
				if( n && n < v ) v = n;
			}
			return v;
		}
		return {
			x: w.pageXOffset || e.scrollLeft || b.scrollLeft || 0,
			y: w.pageYOffset || e.scrollTop || b.scrollTop || 0,
			cx: min( e.clientWidth, b.clientWidth, w.innerWidth ),
			cy: min( e.clientHeight, b.clientHeight, w.innerHeight )
		};
	}

	// hide helper and restore added classes and the title
	function hide() {
		// clear timeout if possible
		if(tID)
			clearTimeout(tID);
		// no more current element
		current = null;
		helper.hide();
		// remove optional class
		if( this.tSettings.extraClass ) {
			helper.removeClass( this.tSettings.extraClass);
		}

		// restore title and remove this listener
		$(this)
			.attr('title', oldTitle)
			.unbind('mouseout', hide);

		// remove PNG background fix for IE
		if( this.tSettings.fixPNG && $.browser.msie ) {
			helper.each(function () {
				$(this).css({'filter': '', backgroundImage: ''});
			});
		}
	}

	// define global defaults, editable by client
	$.fn.Tooltip.defaults = {
		delay: 250,
		event: "mouseover",
		track: false,
		showURL: false,
		showBody: null,
		extraClass: null,
		fixPNG: false
	};

})(jQuery);
/**
 * @author alexander.farkas
 */
var laufband = (function(){
	var $ = jQuery, animobj, len, now = 0, now2, end, stop = false, timer = null;
	$(function(){
		var $ = jQuery;
		animobj = $('#showcase ul');
		if(animobj[0]) {
			
			var $ = jQuery, liLength = $('li', animobj[0]).length;
			len = 130*liLength+'px';
			now2 = parseInt(len, 10);
			end = now2 * -1;
			animobj.css({width: len}).parent('div').hover(laufband.stop, laufband.start);
			animobj.clone().insertAfter(animobj[0]);
			var secAnim = animobj.next().css({left: len});
			animobj = [animobj[0],secAnim[0]];
			
			//$(window).load(function(){

				
			//});
			
			laufband.go();
		}
	});
	
	return {
		go: function(){
			now -= 1;
			now2 -= 1;
			animobj[0].style.left = now+'px';
			animobj[1].style.left = now2+'px';
			if(now < end){
				now = end*-1;
				animobj[0].style.left = now+'px';
			} else if(now2 < end){
				now2 = end*-1;
				animobj[0].style.left = now2+'px';
			}
			if(!stop){
				timer = setTimeout(laufband.go, 30);
			}
		},
		stop: function(){
			stop = true;
			clearTimeout(timer);
		},
		start: function(){
			stop = false;
			clearTimeout(timer);
			laufband.go();
		}
	};
})();
(function($) {
	$.extend({
         getIDformAnker: function($elm){
             var id = $elm.attr('href');
             var fund = id.indexOf('#');
             id = (fund != -1) ? id.substr(fund) : false;
             return id;
         }
    });
    $.fn.extend({
		
		clearFillInput: function(s) {
			s = $.extend({
                    focusAttr: {},
    				blurAttr: {},
					defVal: false
	            }, s);
			return this.each(function(){
                var $this = $(this);
				var defVal = (s.defVal)?s.defVal:$this.val();
                $.data(this,'cfiVal',defVal);
                $this.focus(function(){
                    if($(this).val() == $.data(this,'cfiVal')){
						$(this).val('').attr(s.focusAttr);
					}
						
				}).blur(function(){
					var test = $(this).val();
					if(test == $.data(this,'cfiVal') || test === '')
						$(this).attr(s.blurAttr).val($.data(this,'cfiVal'));
				});
			});
		},
		createLinkButton: function(s) {
			s = $.extend({
                    hiddenClass: 'aural',
    				focusClass: 'focused'
	            }, s);
			function filterOpacity(elm){
				var r = 1;
				if($.browser.msie){
					var f = /opacity=([\d]+)/.exec(elm.css('filter'));
					if(f && f[0] && f[1]){
						r = parseInt(f[1], 10) / 100;
					}
				} else {
					r = parseFloat( elm.css('opacity'), 10);
				}
				return r;
			}
			return this.each(function(){
                var $this =  $(this);
				var id = $this.attr('id');
                var $label = $('label[for='+id+']:first');
				var labelVal = $label.html();
				var classnames = this.className;
				$label.html('<span><span><span><span>'+labelVal+'</span></span></span></span>');
				if($this.is('[type=radio]')) {
					$this.addClass(s.hiddenClass).focus(function(){
						$label.addClass(s.focusClass);
					}).blur(function(){
						$label.removeClass(s.focusClass);
					});
					$label.click(function(){
                        var $this = $(this);
						var iID = $this.attr('for');
						$('#'+iID).attr({checked: 'checked'});
						$(this).parents('form:first').trigger('submit');
                        return false;
					}).addClass(classnames);
				} else {
                	$this.attr('id', '');
					var val = $this.val();
					id = (id)?'id='+id:'';
                    var name = $this.attr('name');
                    var link = $this.after('<a href="#" '+id+' class="'+classnames+'"><span><span><span><span>'+val+'</span></span></span></span></a>').next('a');
					$this.css({position: 'absolute', left: '-9999em', width:'0', overflow:'hidden'})
						.attr({tabindex: "-1"});
					link.click(function(){
                        var that = $(this);
                        if(filterOpacity(that) > 0.5){
                            if(link.is('.basket-submit')){
								if(!link.is('.submited')){
									$this.click();
								}
								link.addClass('submited');
							} else {
								$this.click();
							}
						}
						
                        return false;
					});
				}
                    
			});
		},
        heightOpacToggle: function(s){
            s = s || {};
            return this.each(function(){
                $(this).animate({
                    height: 'toggle',
                    opacity: 'toggle'
                },s);
            });
        },
		tab: function(s) {
			s = $.extend({
		        activeClass: 'on',
				controls: null,
                animationToggle: false
	        }, s);
            
            return this.each(function(){
                 var $this = $(this);
                 var curBlock = $($.getIDformAnker($this));
                 if(!$this.is('.'+s.activeClass)) {
                     curBlock.css({display: 'none'});
                 }
                 curBlock.attr({tabindex: '-1'}).css({outline: 'none'});
                 $this.bind('click.aperto', function(){
                     var curActive = $(s.controls+'.'+s.activeClass).removeClass(s.activeClass);
                     var $this = $(this);
                     
                     $this.addClass(s.activeClass);
                     var curID = $.getIDformAnker(curActive);
                     var newID = $.getIDformAnker($this);
                     if(curID != newID){
                         var curActiveBlock = $(curID);
                         var toActivateBlock = $(newID);
                         if(!s.animationToggle){
                             curActiveBlock.css({display: 'none'});
                             toActivateBlock.css({display: 'block'}).focus();
                         } else {
                             curActiveBlock[s.animationToggle](function(){
								 toActivateBlock[s.animationToggle](function(){
                                      this.focus();
                                 });
                             }); 
                             
                         }
                      }
                     return false;
                 });
			});
		},
        expandClickArea : function(settings) {
		    settings = $.extend({
		        refSource: 'a:first',
				refAttach: false,
				hoverClass:false//notAdded 2DO
		    }, settings || {});
			return this.each(function(){
				var teaseOBJ = (!settings.refAttach)?this:$(this).find(settings.refAttach);
				$(teaseOBJ).css('cursor','pointer').click(function(e){
					var $refSource = $(this).find(settings.refSource);
                    
                    if(e.target != $refSource.get(0) && $(e.target).parents(settings.refSource).get(0) != $refSource.get(0)) {
                        if($refSource.is('a'))
                            window.location = $refSource.attr('href');
                    } 
				});
			});
		},
        carousel : function(s) {
		    s = $.extend({
		        nextB: 'div.next',
                prevB: 'div.prev',
				atomDim: false,
				hoverClass:false, //notAdded 2DO
				rotate: false
		    }, s);
			return this.each(function(i){
                var lastShowed = parseInt($.cookie('carouselShow'+i), 10), 
					atom = $('li', this),
					nowshow = isFinite(lastShowed) ? atom.parent().is('.rotation') ? lastShowed+1 : lastShowed : 0,
				    atomShow = (nowshow >= atom.length) ? 0 : nowshow;
				$.cookie('carouselShow'+i, String(atomShow));
				
                $(this).parents('div.punkte-box-inner').find('ul li:eq('+atomShow+')').addClass('active');
				atom.each(function(i){
                   var bigCarousel = $(this).parents('div.punkte-box-inner').find('ul:first');
				   $(this).click(function(){
                       $(this).parents('div:first').find('li.on').removeClass('on').end().end().addClass('on');
                       var height = ($.browser.msie)? 142 : 140;
                       var top = i * height * -1;
					   
					   bigCarousel.find('li:eq('+i+'),li.active').animate({
                           opacity: 'toggle'
                       },function(){
							$(this).toggleClass('active');
						});
                       
                   }).hover(function(){
                     $(this).addClass('over');
                   },function(){
                     $(this).removeClass('over');
                   });
                })
					.removeClass('on')
					.filter(':eq('+atomShow+')')
					.addClass('on');
                var motionArea = $('ul',this);
                var moAWidth = atom.size()* s.atomDim;
               
                
                motionArea.css({width: moAWidth});//
                motionArea.clone(true).insertAfter(motionArea).css({left: moAWidth});
                motionArea.clone(true).insertBefore(motionArea).css({left: moAWidth*-1});

                motionArea = $('ul',this);
                
				motionArea.each(function(){
					var jElm = $(this),
						left = parseFloat(jElm.css('left'), 10);
					left = left ||
						0;
					jElm.css({
                       left: left - (s.atomDim * atomShow)
                    });
				});
                var speedMode = s.atomDim * 3;
                var mousedown = false;
                var checkedAreas = 0;
                function animCallback(){
                    
                    var $this = $(this);
                    
                    var leftPos = parseInt($.curCSS(this,'left'));
                    if(leftPos < (moAWidth * -1)){
                        var newLeft = (moAWidth * 3) - (leftPos * -1);
                        $this.css({left: newLeft});
                        
                    } else if(leftPos > moAWidth) {
                        var newLeft = leftPos - (moAWidth * 3);
                        $this.css({left: newLeft});
                    }
                    
                    checkedAreas++;
                    if(mousedown && checkedAreas == 3) {
                        checkedAreas = 0;
                        motionArea.animate({
                           left: mousedown+'='+speedMode
                        },{complete: animCallback, easing: 'linear', duration: 1000});
                        checkedAreas = 0;
                    }
                }
                $(s.nextB,this).mousedown(function(){
                    mousedown = '-';
                    checkedAreas = 0;                    
                    motionArea.animate({
                       left: '-='+s.atomDim
                    },animCallback);
                }).mouseup(function(){
                    mousedown = false;
                });
                
                $(s.prevB,this).mousedown(function(){
                    mousedown = '+';
                    checkedAreas = 0;
                    motionArea.animate({
                       left: '+='+s.atomDim
                    },animCallback);
                }).mouseup(function(){
                    mousedown = false;
                });
			});
		},
		checkAll: function(){
			var checkboxen,id, master;
			
			function mainCheckBoxChange(){
				var $this = $(this);
				id = $this.attr('id');
				setTimeout(function(){
					var status = $this[0].checked;
					checkboxen.each(function(){
						var obj = $(this);
						if(obj.is(':checked') != status && obj.not('#'+id)){
							obj.click();
						}
					});
				},9); 
			}
			
			function checkBoxChange(){
				var $this = $(this),
				revertMaster = true;
				
				setTimeout(function(){
					var status = $this[0].checked;
					
					if(status === master.checked){
						revertMaster = false;
						return false;
					}
					
					checkboxen.each(function(){
						var obj = $(this);
						if(status && this.checked !== status){
							revertMaster = false;
							return false;
						}
					});
					if(revertMaster) {
						if(status){
							$(master).attr({
								'checked': true
							});
							$('label[for='+id+']').addClass('checked');
						} else {
							$(master).attr({
								'checked': false
							});
							$('label[for='+id+']').removeClass('checked');
						}
					}
				},9); 
			}
			
			return this.each(function(){
				var $this = $(this);
				master = this;
				id = $this.attr('id');
				checkboxen = $this.parents('form').find('input[type=checkbox]').not('#'+id);
				checkboxen.bind('click.all',checkBoxChange);
				$this.bind('click.all',mainCheckBoxChange);
			});
		},
		checkBox: function(s) {
            s = $.extend({
		        checkedClass: 'checked',
				focusClass: 'focused',
				cBubble: true,
                hiddenClass: 'aural'
            }, s);
			function clickInput(){
                var $this = $(this);
				var id = $this.attr('id');
				setTimeout(function(){
					($this.is(':checked'))? 
	                    $('label[for='+id+']').addClass(s.checkedClass)
	                :
	                    $('label[for='+id+']').removeClass(s.checkedClass);
	                
				},2);
            }
			return this.each(function(){
                var $this = $(this);
                $this.addClass(s.hiddenClass);
                var id = $this.attr('id');
                var $label = $('label[for='+id+']');
                if($this.is(':checked'))
                    $label.addClass(s.checkedClass);
                $label.bind('click.checkBox', function(){
					var $curLabel = $(this);
                    $curLabel.toggleClass(s.checkedClass);
                    
					if($('#'+id).is(':checked') !== $curLabel.is('.'+s.checkedClass)){
						$('#'+id).click();
					}
                     return false;
                });
                
                $this.bind('click.checkBox',clickInput).bind('focus.checkBox', function(){
                    $('label[for='+id+']').addClass(s.focusClass);
                }).bind('blur.checkBox', function(){
                    $('label[for='+id+']').removeClass(s.focusClass);
                });
			});
		},
		accordion: function(){
			return this.each(function(){
				var accO = this;
				$(this).children('li').children('ul').hide().end(
				).children('a').addClass('collapsed').click(function(){
					var $this = $(this);
					if ($this.is('.collapsed')) {
						$('a.faq-section').not('.collapsed').toggleClass('collapsed').parent('li').children('ul').heightOpacToggle();
						$this.toggleClass('collapsed').parent('li').children('ul').heightOpacToggle();
					} else {
						$this.toggleClass('collapsed').parent('li').children('ul').heightOpacToggle();
					}
                    return false;
                });
			});
		},
		openPopup: function(s){
			s = $.extend(s, {
				winHeight: 500,
				winWidth: 575,
                center: true,
				winOptions: 'scrollbars=1'
			});
			return this.each(function(){
				s.winOptions += 'height='+s.winHeight+',width='+s.winWidth;
				if(s.center){
					var yPos = (screen.availHeight-s.winHeight) / 2;
					var xPos  = (screen.availWidth-s.winWidth) / 2;
					s.winOptions += ', left='+xPos+', top='+yPos;
				}
				var $this = $(this);
				$this.bind('click.openPopup',function(){
					var url = $(this).attr('href');
					var win = window.open(url, "newwindow", s.winOptions);
  					win.focus();
					return false;
				});

			});
		},
		uaagChange: function(func) {
			function reset(s,val){
				s.activeIndex = val;
			}
			return this.each(function(){
				var s = $(this);
				if(!s[0].activeIndex){
					s[0].activeIndex = s[0].selectedIndex;
				}
	            s[0].altPressed = 0;
				s.keydown(function(e){
					var keyCodeTab = "9";
					var keyCodeEnter = "13";
					var keyAlt = "18";
					var keyCodeEsc = "27";
					if(e.keyCode == keyCodeTab || e.keyCode == keyCodeEnter){
	                    func.apply(this,[this.selectedIndex]);
					}else if(e.keyCode == keyCodeEsc && this.altPressed != 1){
						this.selectedIndex = this.activeIndex;
	                    s.altPressed = 0;
					}else if(e.keyCode == keyAlt){
						this.altPressed = 1;
					}	
				});
	            s.change(function(e){
					if(this.altPressed && this.selectedIndex != this.activeIndex){
						func.apply(this,[this.selectedIndex]);
						reset(this,this.selectedIndex);
					}
						
	            });
				s.blur(function(e){
					if(this.selectedIndex != this.activeIndex){
						func.apply(this,[this.selectedIndex]);
						reset(this,this.selectedIndex);
					}
					this.altPressed = 0;
				});
				s.click(function(){
					if(this.selectedIndex != this.activeIndex){
						func.apply(this,[this.selectedIndex]);
						reset(this,this.selectedIndex);
					}
				});
				
			});
			
		},
		radioActive: function(){
			return this.each(function(){
				var accO = this;
				var $inputs = $('input[type=radio]',accO);

				$inputs.each(function(){

					var divC = $(this).bind('click',function(){
						var $this = $(this);
						var radioName = $this.attr('name');
						$('input[name='+radioName+']',accO).parents('td').children('div').removeClass('odd');

						var divContainer = $this.parents('td:first').children('div:first');

						if($this.is(':checked'))
							divContainer.addClass('odd');
						else
							divContainer.removeClass('odd');
					}).parents('td:first').children('div:first');

					if($(this).is(':checked'))
						divC.addClass('odd');
					else
						divC.removeClass('odd');
				});
			});
		}

	});
	
	if($.browser.msie && document.execCommand){
		document.execCommand('BackgroundImageCache', false, true);
	}
	
    $(function() {
		var b = $('body:first').addClass('js-enabeld');
		
		$('form.autoredirect').submit();
		
		$('#login-switch').click(
			function(){
				var altLogin = $('#alternate-login'), 
				jElm = $(this), 
				cache = {
					formRowContent: altLogin.html(),
					switcherText: jElm.html()
				};
				altLogin.html(loginSwitch.formRowContent);
				jElm.html(loginSwitch.switcherText);
				loginSwitch = cache;
				return false;
			}
		);
		if(nektarJSLang && b.is('.popup')){
			$('#main').prepend('<a id="close-popup" href="#">'+nektarJSLang.close+'</a>').find('#close-popup').click(
				function(){
					window.close();
					return false;
				}
			);
		}
		$('#showMorePartnerResults').click(function(){
			$('#morePartnerResults').removeClass('hidden')[0].focus();
			$(this).remove();
			return false;
		});
		$('#basket-summary a.del-prodct').click(function(){
			$(this).parents('tr:first').remove();
			return false;
		});
		$('a[rel=popup]').openPopup();
		
		if ($.fn.sifr) {
			var sifrHead = $('h1');
			
			if(!sifrHead.find('span').size()){
				sifrHead.css({height: 'auto'}).sifr({
					strSWF: (typeof g_flashTypoUrl != 'undefined') ? g_flashTypoUrl : 'img/swiss.swf',
					strColor: '#6B196B'
				});
			}
			$('p.subline').sifr({
				strSWF: (typeof g_flashTypoUrl != 'undefined') ? g_flashTypoUrl : 'img/swiss.swf',
				strColor: '#6B196B'
			});
		}
        $('#basket-form').radioActive();
		$('#faq').accordion();
        $('#tabs-select a').tab({controls: '#tabs-select a'});
        $('#punkte-box div.control-carousel').carousel({atomDim: 56});
		$('#pin').clearFillInput({focusAttr: {maxlength: '4'},blurAttr: {maxlength: '999'}});
		$('#gb_junior,#gb_senior').clearFillInput({defVal: 'JJJJ'});
        $('#member-id, #pin1, #member-id1, #tt, #mm, #j').clearFillInput();
        $('ul.box-list li').expandClickArea();
        $('input.button').createLinkButton();
	    $('#calc-route').css({opacity: '0.4'});
		var hiddenPoints = $('#hidden-point-level').val();
		if(hiddenPoints){
			$('#point-level').html(hiddenPoints);
		}
		/*
		if(nektarJSLang && nektarJSLang.print){
			$('#tools').append('<li class="print"><a href="javascript:window.print();">'+nektarJSLang.print+'</a></li>');
		}*/
		var helpTip = $('span.help').each(function(){
			var $this = $(this);
			var config = ($this.is('.credit-card'))?{extraClass: 'credit-tip', showBody: ": "}:($this.is('.cv-code'))?{extraClass: 'code-tip', showBody: ": "}:{showBody: ": "};
			$this.Tooltip(config);
			$('#tooltip').bgiframe();
		});
		
		$('#hood #all').checkAll();
        $('#bonus-search input[type=checkbox], #hood input[type=checkbox]').checkBox();
	    
		if($.fn.datepicker){
			$('#point-search input[type=text]').datepicker({closeAtTop: false, firstDay: 1, changeFirstDay: false, changeMonth: false, changeYear: false});
		    $('#contact-bonus input.date').datepicker({closeAtTop: false, firstDay: 1, changeFirstDay: false, changeMonth: false, changeYear: false});
			$('#contact-nopoints input.date').datepicker({closeAtTop: false, firstDay: 1, changeFirstDay: false, changeMonth: false, changeYear: false});
		}
		(function(){
			$('#product-views a').bind('click', function(){
				$('#product-views a.active').removeClass('active');
				
				var $this = $(this), $href = $this.attr('href');
				$this.addClass('active');
				var newPic = new Image();
				newPic.src = $href;
				$('#product-showcase img').animate({opacity: 'hide'},{
					complete: function(){
						$('#product-showcase img').remove();
						$('#product-showcase').append(newPic);
					}
				});
				return false;
			});
		})();
		function contactQuestionSelect(e){
			var val = $('#question').val();
			if(val === 'bonuses'){
				$('#contact-bonus').css({display: 'block'});
				$('#contact-nopoints').css({display: 'none'});
			} else if(val === 'nopoints'){
				$('#contact-nopoints').css({display: 'block'});
				$('#contact-bonus').css({display: 'none'});
			} else {
				$('#contact-bonus, #contact-nopoints').css({display: 'none'});
			}
		}
	
		var question = $('#question').uaagChange(function(e){
			contactQuestionSelect(e);
		}).each(function(){
			contactQuestionSelect(this.selectedIndex);
		});

		var mobileChanger = function(){
			var elem = $(this);
			$((elem.is('#mobile'))?'#mobile1':'#mobile').val(elem.val());
		}
		var mobile1 = $('#mobile').change(mobileChanger),
		mobile2 = $('#mobile1').change(mobileChanger), 
		moVal1 = mobile1.val(), 
		moVal2 = mobile2.val();
		if(moVal1 != moVal2){
			if(moVal1 !== '' && moVal1 !== ' '){
				mobile2.val(moVal1);
			} else if(moVal2 !== '' && moVal2 !== ' '){
				mobile1.val(moVal2);
			}
		}
		
        if($('#betrag-slide-filler').size() && $('#bonus-slide-filler').size()){
            (function(){
                //wir benutzen intern kein jQuery um so schnell wie möglich Zugriff auf das Objekt zu haben
				//$('#bonus-slider div.ui-slider-handle, #max-betrag div.ui-slider-handle').ifixpng();
                var $slideFillerStyle = $('#betrag-slide-filler').get(0).style;
                var maxInput = $('#max-betrag-input').get(0);
                var maxVal = $('#max-betrag-val');
				var maV = maxInput.value;
				$slideFillerStyle.width = (parseInt(maV)*1.9)+12+'px';
				var iVal = (maV == '100')?'&gt; 100 &euro;': maV+' &euro;';
				maxVal.html(iVal);
                function onslide(ui,e){
                    var iVal = (e.value == '100')?'&gt; 100 &euro;': e.value+' &euro;';
					maxVal.html(iVal);
                    maxInput.value = e.value;
                    $slideFillerStyle.width = e.pixel+9+'px';
                };
                $('#max-betrag').slider({slide: onslide, stepping: 20, startValue: parseInt(maxInput.value)});
            })();
            (function(){
                var $slideFillerStyle = $('#bonus-slide-filler').get(0).style;
                
                var minPunkte = $('#von-punkte').get(0);
                var maxPunkte = $('#bis-punkte').get(0);
                
                var minVal = $('#min-punkte-val');
                var maxVal = $('#max-punkte-val');
				
				var miV = minPunkte.value || 0;
				var maV = maxPunkte.value || 0;
				
				minVal.html(''+miV);
				var curmaV = (maV == '6000')?nektarJSLang.gt6000:maV;
				maxVal.html(''+curmaV);
				var cSVal = [parseInt(miV),parseInt(maV)];
				var abstand = (cSVal[1] - cSVal[0])/31.75;
				var pos = cSVal[0]/31.75;
				$slideFillerStyle.width = abstand+10+'px';
				$slideFillerStyle.left = pos+7+'px';
			   
                function onslide(ui,e){
                   var $handle = $(e.handle),curVal = parseInt(e.value),abstand;		
				   if($handle.is('.left-indicator')){
                       minPunkte.value = curVal;
                       minVal.html(''+curVal);
                       abstand = parseFloat($('.right-indicator', this).css('left'))-e.pixel+10;
                       $slideFillerStyle.width = abstand+'px';
                       $slideFillerStyle.left = e.pixel+7+'px';
                   } else {
                       maxPunkte.value = curVal;
					   curVal = (curVal == '6000')?nektarJSLang.gt6000:curVal;
                       maxVal.html(''+curVal);
                       var leftVal = parseFloat($('.left-indicator', this).css('left'));
                       abstand = e.pixel+10-leftVal;
                       $slideFillerStyle.width = abstand+'px';
                       $slideFillerStyle.left = leftVal+7+'px';
                   }
                };
				
                $('#bonus-slider').slider({slide: onslide, stepping: 200, maxValue: 6000, startValue: cSVal});
            })();
        }
		var mapViewer = $('#mapviewer.result');
		if(mapViewer.size()){
			$('#mapviewer.result').before('<p class="print-route"><a href="#" class="button route-back"><span><span><span><span>zur&uuml;ck</span></span></span></span></a> <a href="#" class="button print"><span><span><span><span>drucken</span></span></span></span></a></p>').prev('p')
			.find('a').click(function(){
				if($(this).is('.print')){
					window.print();
				} else {
					window.history.back();
				}
				
				return false;
			});
			$('#route-warranty').after('<p class="print-route"><a href="#" class="button"><span><span><span><span>drucken</span></span></span></span></a></p>').next('p')
			.find('a.button').click(function(){
				window.print();
				return false;
			});
		}
		var $sms = $('#sms');
        var $mobile = $('#mobile-wrapper');
		
		
		$('#gallery-stage img')
			.bind('contextmenu', function(e){
				e.preventDefault();
			});
		if($sms.size() && $mobile.size()){
			if(!$sms.is(':checked'))
				$mobile.css({display: 'none'});
			$sms.click(function(){
				$(this).is(':checked')?$mobile.animate({opacity:'show', height: 'show'}):$mobile.animate({opacity:'hide', height: 'hide'});
			});
		}
    });
})(jQuery);