

/* ------------------------------------------------------------------------

(c) 99°

Alle Scripte in diesem Dokument unterliegen dem strengen Copyright der
Firma 99° und dürfen ohne deren Zustimmung nicht kopiert, vervielfältigt
oder verfremdet werden.

Für Fragen: www.99grad.de / 0611-4080919

------------------------------------------------------------------------ */



// ---------------------------------------------------------------------
// http://gettopup.com/documentation

TopUp.players_path = "fileadmin/templates/js/topup/players/";
TopUp.images_path = "fileadmin/templates/js/topup/top_up/";


TopUp.addPresets({
	".shaded": {
	 shaded: 1,
	 overlayClose: 1,
	 layout: 'dashboard',
	 resizable: 0
	}
});

TopUp.addPresets({
	".flv-video": {
	 shaded: 1,
	 overlayClose: 1,
	 layout: 'dashboard',
	 resizable: 0,
	 width: 950,
	 height: 550,
	 effect: 'appear',
	 ondisplay: function () { tell_flash( 'flash_banner', 'sound_leise', '' ); },
	 onclose: function () { tell_flash( 'flash_banner', 'sound_laut', '' ); }
	}
});


// ---------------------------------------------------------------------
// IE6 Warning, Spezielle CSS/JS-Dateien

$(function () {

	var is_msie = $.browser.msie;
	var vers = parseFloat($.browser.version);
	
	if (is_msie) {
		if (vers <= 6) {
			$.getScript('fileadmin/templates/js/ie6_warning/warning.js', function () {
				alert_ie6_warning("fileadmin/templates/js/ie6_warning/");
			});
		}
	}	

});



// ---------------------------------------------------------------------
// http://gsgd.co.uk/sandbox/jquery/easing/
// http://jqueryui.com/download
// http://docs.jquery.com/UI/Effects/Slide

var _firstRun = true;
var _canFlash = false;

$( function () {
	
	if (SWFAddress) {
	
		SWFAddress._ignore_change = false;
		SWFAddress.onChange = function () {
		
			if (SWFAddress._ignore_change) return false;
			try {
				var str = SWFAddress.getValue();
				if (str.substr(0,1) == '/') str = str.substr(1);
				var parts = str.split('/');
				var url = parts.join("/");
				
				if (url) {
					ajax_menue_func( false, url );
				} else {
				
					if (!_firstRun) {
						ajax_menue_func( false, $.currentURL().split('#')[0] );
					}
					_firstRun = false;
				}
				
			} catch (e) {}
		}
		
		SWFAddress.setValueSilently = function ( url ) {
			SWFAddress._ignore_change = true;
			SWFAddress.setValue( url );
			SWFAddress._ignore_change = false;
		}
		
	}
	
	$(window).load( function () {
		if (swfobject && $('#headerbox_flash').html() == null) _canFlash = true;
	});
	
});



// ---------------------------------------------------------------------
// Accordion für die Navigation


function update_menue ( thisRef ) {

	var el = false;
	if (thisRef) highlight_menue( thisRef );
	
	el = $('ul.subnavi li.selected').parent('ul.subnavi');
	if (!el.html()) {
		el = $(thisRef).next();
	}
	
	if (!el.html()) {
		el = $('#main_menu ul li.selected');
	}
	
	if (el.html()) {
	
		$.each( $('ul.subnavi'), function ( k, v ) {
			var a = $(v).parent().hasClass('selected');
			if ( !$(v).find('li.selected').html() && $(v).is(':visible') && !a) {
				$(v).slideUp( 'fast' );
			}
		});
		
		if (el.find('ul.subnavi').html()) el = el.find('ul.subnavi');
		var vis = el.is(':visible');
		
		if (!vis) {					
			el.slideDown( 'fast' );
		} else {
			el.show();
		}
	}
	ajax_load_url( jQuery(thisRef).attr('href') );
	
};

function highlight_menue( obj ) {
	$( obj ).parent().parent().find('li').removeClass( 'selected' );
	$( obj ).parent().addClass( 'selected' );
}


var currentid = -1;

function swop_text( html, div_id ) {
	var ref = get_reference();
	if (ref.getElementById) {
		var obj = ref.getElementById( div_id );
		obj.innerHTML = html;
	}
}

function tell_flash ( who, func, what ) {

	var obj = get_flash_movie( who );	
	if (obj != null && obj[func]) {
		obj[func]( what );
	}
}


function get_flash_movie( name ) {
	var ref = get_reference();
	if (ref[name]) return ref[name];
	return null;
}

function get_reference() {
	return document;
	//return (navigator.appName.indexOf("Microsoft") != -1) ? window : document;
}





/* ------------------------------------------------------------------------ */
// I N I T 

var gPageInitFuncs = [];

function register_page_init_func ( func ) {
	for (var i in gPageInitFuncs) if (gPageInitFuncs[i] == func) return;
	gPageInitFuncs.push( func );
}


$( function () {

	$('.brands a').pulsateColor({'background-color':'#fff', color:'#000', durationIn:50, durationOut:500, pause:2000});
	
	if (jQuery.browser.safari) {
		$('.brands').mouseenter( function(){
			$('.overlay_brands').slideToggle();
			return false;
		});
	} else {
		$('.brands').click( function () {
			ajax_menue_func(false, 'index.php?id=117&L='+$('meta[name=typo3_lang]').attr('content') );
			$('.overlay_brands').mouseleave();
			return false;
		});
	}
	
	$('.overlay_brands').mouseleave( function() {
		$('.overlay_brands').slideToggle( false );
	});
	
	$('.overlay_brands .inner a, .overlay_brands .inner').click ( function () {
		var ref = $(this);
		if (ref.nodeName() == 'div') ref = ref.find('a.ajax-loader');
		var href = ref.attr('href');
		var tg = ref.attr('target');
		if (tg != '_self' && tg) {
			window.open( href );
		} else {
			window.location( href );
		}
		return false;
	});
	
	init_page();
} );


function init_page () {
	
		
		// ####### Bilder schützen
		
	$('img').copyProtectImage();
	
	
		// #######  Navigation: Ajax

	$('#main_menu ul li a').unbind().click( ajax_menue_func );
	$('#sub_menu ul li a').unbind().click( ajax_menue_func );
	$('ul.metanavi li a').unbind().click( ajax_menue_func );
	
	$('#sub_menu').accordeonMenue();

	$('#main_menu ul li a').rolloverColor();

	// Ausnahmen: Händler-Login!
	$('li.pid_210 a').unbind();
	
	$('.rahmen_130').click( function () {
		var url = $(this).find('a').attr('href');
		if (url) return ajax_menue_func( false, url );
	});
	
	
		// ####### Menü-Hintergründe einfaden bei focus
	$('.formhandler_form input, .formhandler_form textarea').rolloverColor({'background-color':'#666', color:'#fff'}).unbind('mouseleave mouseenter');

		// ####### Partner: RollOver-Effekt
	$('.rahmen_120').copyUnprotectImage();
	$('.rahmen_120 .csc-textpic-imagecolumn, .rahmen_120 li').width(110);
	
	var w = 90;
	var s = 20;
	$('.rahmen_120 li, .rahmen_120 li img').width( w ).height( w );
	$('.rahmen_120 li').css({'padding-top':s});
	
	$('.rahmen_120 li img').unbind().mouseenter( function () {
		$(this).animate( {width:w+s,height:w+s,opacity:0.8}, {duration:500, easing:'easeInOutQuint'} );
		$(this).parent().parent().animate( {width:w+s, height:w+s, 'padding-top':s/2}, {duration:500, easing:'easeInOutQuint'} );
	}).mouseleave( function () {
		$(this).animate( {width:w,height:w,opacity:1}, {duration:200, easing:'easeOutQuint'} );
		$(this).parent().parent().animate( {width:w, height:w, 'padding-top':s}, {duration:200, easing:'easeOutQuint'} );
	});
	
		// ####### Akkordeon-Effekt für Pflegetipps
		
	$('.rahmen_140').click( function () {
		$(this).find('.bodytext').slideToggle();
	}).mouseenter( function () {
		$(this).find('h3').animate( {'color':'#c5aa00'});
	}).mouseleave( function () {
		$(this).find('h3').animate( {'color':'#bd1b00'});
	});
	
	for (var i in gPageInitFuncs) gPageInitFuncs[i]();
	

	
}

function update_flashparams ( html_data ) {

	if (!html_data) html_data = $('body').html();
	var flashvars = {};
	var flashvars_src = $.stripNL(html_data.split('/*--flashvars--*/')[1]);
	if (flashvars_src) {
		try { 
			eval(flashvars_src);
			//alert(flashvars.banner_imgs);
			$('#flash_banner').callFlashFunction( 'updateParams', [flashvars] );
		} catch(e) {}
	}
}

function update_flashsize ( h ) {
	$('#flash_banner').callFlashFunction( 'updateSize', [{height:h}] );
}

function ajax_menue_func ( ref, url ) {
			
	if (!url) {
		var url = $(this).attr('href');
		var tg = $(this).attr('target');
		if (tg && tg != '_self') return true;
		if (url.indexOf('javascript:') == 0 || url.indexOf('mailto:') == 0) return true;
	}
	
	url = url.split($('base').attr('href')).join('');
	if (!url) url = $('base').attr('href');
	
	SWFAddress.setValueSilently( '/'+url );
	$('html').animate({'scrollTop':0});

	var old_height = $('#contentbox').css({'height':'auto'}).height();
	$('#contentbox').animate({'opacity':0});
	
	$('body').showPreloader({followMouse:true, offsetTop:15, offsetLeft:0});

	$.m_ajax( {
				url: 		url, 
				targets:	{'#contentbox':'#contentbox', '#sub_menu':'#sub_menu', '#main_menu':'#main_menu'}, 
				success: 	function( data, html_data ) {
		
					$('.t3page').removeAttr('class').attr('class', html_data.attr('class') );
					$('meta[name=pid]').removeAttr('content').attr('content', $.metaTagValue('pid', data) );
					$("body").attr('class', html_data.attr('class'));
					
					init_page();
					update_flashparams( data );
					$('body').hidePreloader();
					
					var new_height = $('#contentbox').css({'height':'auto'}).height();		
					$('#contentbox').stop(true, true).css({'height':old_height}).fadeInRemoveFilter().animate({'height':new_height}, {duration:500, easing:'easeInOutQuint', complete:function(){
						$('#contentbox').css({'height':'auto'});
					}});
					
					var headerbox_height = $(html_data).find('#headerbox').css('height');
					$('#headerbox').stop(true,true).animate({'height':headerbox_height}, {duration:500, easing:'easeInOutQuint', step:function(h) {
						update_flashsize( h );
					}});
					
					if (!_canFlash) {
						var src = html_data.find('#headerbox_inner p', data).attr('src');
						$('#headerbox_inner').html( '<img src="'+src+'" />' );
					}
					
					//$('#headerbox_inner').html()attr({src:$('#headerbox_inner img', html_data).attr('src')});
	}});
	
	return false;
}



$( function () {
	/*
	function onWindowResized () {
	
		// Gras-Hintergrund immer unten am Rand lassen
		$('.hg2').css( {'height':Math.max($(window).height(), $('.centerbox').offset().top + $('.centerbox').height()+100)} );
		
		// Meta-Navi nach unten schieben
		$('#meta_menu').css( {'top':Math.max($('#sub_menu').height(), $('.centerbox').offset().top + $('.centerbox').height()-$('#meta_menu').height()-70)} );
	}

	$(window).resize( onWindowResized );	
	onWindowResized();
	*/
});


/* ------------------------------------------------------------------------ */
// EIGENE PLUG-INS für jQuery

// http://www.queness.com/post/112/a-really-simple-jquery-plugin-tutorial
// http://matthiasschuetz.com/jquery-tutorial-eigenes-tooltip-plugin-erstellen

/*

$.metaTagValue('pid');				->	gibt Wert eines Meta-Tags zurück
$.reqVars();						->	alle GET-Vars als Object holen, z.B. aus www.99grad.de/?test=hallo&...
$.reqVars('test');					->	GET-Var 'test' zurückgeben
$.stripTags(html, ['h2'], false );	->	HTML-Tags entfernen: code, allowed-tags-Array, allow-invers 
$.stripNL(html);					->	Tabs und Umbrüche entfernen (IE6-Problem)
$.htmlentitiesdecode( html );		->	Decode HTML
$.getAllTags(html, 'b', true );		->	HTML-Tags holen: code, tag-name, include-tag
$.gaTrackPage( title );				->	Seiten-Titel an Google Analytics senden, falls Tracking-ID im Quelltext gefunden wurde
$.execScripts(html, debug);			->	JavaScript in HTML-Code ausführen
$.isNumeric( str );					->	Gibt true zurück, wenn str eine Zahl ist
$.noCacheURL( url );				->	Hängt einen noCache=... an die URL, damit Seite beim Laden nicht gecached wird

$(sel).exists();							-> 	Existiert das Element?
$(element).rolloverColor({color:'#000'});	->	Ändert bei RollOver die Textfarbe, z.B. für Menüs

*/


// Erweiterung der Funktionen für den Typ $('id').plugin();

(function($){
	$.fn.extend({
		'copyProtectImage': function ( opt ) {
			var def = {transparent:'fileadmin/templates/imgs/trans.gif' };
			var opt = $.extend( def, opt);
			return this.each( function () {
			
				if ($(this).parent().hasClass('protector')) {
					$(this).parent().find('.protector_img').remove();
					$(this).unwrap();
				}
				
				if ($(this).parent().nodeName() == 'a') $(this).parent().bind("contextmenu", function(e) { e.preventDefault(); });
				$(this).wrap('<span class="protector" />');
				$(this).parent().prepend('<span class="protector_img" style="position:absolute;"><img src="'+opt.transparent+'" width="'+$(this).width()+'" height="'+$(this).height()+'"></span>');
			});
		},
		'copyUnprotectImage': function (opt) {
			var def = {};
			var opt = $.extend( def, opt);
			return this.each( function () {
				$(this).find('.protector_img').remove();
				$(this).find('.protector *').unwrap();	
				$(this).find('.protector').remove();
			});
		},
		'exists': function () {
			//return $(this).length>0;
			return $($(this).selector).length>0;
		},
		'nodeName': function () {
			return $(this)[0].nodeName.toLowerCase();
		},
		'slideToggle': function ( bShow ) {
			return this.each( function () {
				var el = $(this), height = el.data('originalHeight'), visible = el.is(':visible');
				if (bShow == undefined) bShow = !visible;
				if (bShow != visible) {
					if (!height) {
						height = el.show().height();
						el.data('originalHeight', height);
						if (!visible) el.hide().css({height:0});
					}
					if (bShow) {
						el.hide().css({height:0});
						el.stop(true, true).show().animate({height:height}, {duration:500, easing:'easeInOutQuint', complete:function() {
							el.css({height:'auto'});
						}} );
					} else {
						el.stop(true, true).animate({height:0}, {duration:500, easing:'easeInOutQuint', complete:function () { 
							el.hide();
						}});
					}
				}
			});
		},
		
		'fadeInRemoveFilter': function ( opt ) {
			var def = {duration:500, easing:'linear' };
			var opt = $.extend( def, opt);
			return this.each( function () {
				var el = $(this);
				el.animate({'opacity':1}, {duration:opt.duration, easing:opt.easing, complete:function(){
					var el = $(this)[0];
					if (el.style.filter && el.style.removeAttribute) el.style.removeAttribute('filter');
				}});
			});
		},
		
		'rolloverColor': function ( opt ) {
			
			var def = { color:'#777A66', duration: 400, durationOut: 100, 'background-color': false };
			var opt = $.extend( def, opt);
			$(this).resetRolloverColor();
			
			return this.each( function () {	
				$(this).data('col', $(this).css('color') );
				$(this).data('bgcol', $(this).css('background-color') );
				$(this).unbind('mouseenter focus').bind( 'mouseenter focus', function () {
					var obj = {};
					if (opt.color) obj['color'] = opt.color;
					if (opt['background-color']) obj['background-color'] = opt['background-color'];
					$(this).stop(true,true).animate(obj, opt.duration);
				}).unbind('mouseleave focusout').bind('mouseleave focusout', function () {
					var obj = {};
					if (opt.color) obj['color'] = $(this).data('col');
					if (opt['background-color']) obj['background-color'] = $(this).data('bgcol');
					$(this).stop(true,true).animate(obj, opt.durationOut);
				});
			});
		},
		
		'pulsateColor': function ( opt ) {
			var def = { color:'#fff', 'background-color': false, durationIn: 400, durationOut: 100, pause:1000 };
			var opt = $.extend( def, opt);
			return this.each( function () {
				var c = {'col':$(this).css('color'), 'bgcol':$(this).css('background-color')};
				$(this).data('_col', c );
				$(this).delay(opt.pause).animate({color:(opt.color ? opt.color : c.col), 'background-color':(opt['background-color'] ? opt['background-color'] : c.bgcol)}, {duration:opt.durationIn}).delay(opt.durationIn).animate({color:c.col, 'background-color':c.bgcol}, {duration:opt.durationOut, complete:function(){
					$(this).delay(opt.pause).pulsateColor( opt );
				}});
				
			});
		},
		
		'resetRolloverColor': function () {	
			return this.each( function () {
				$(this).removeAttr('style');
			});
		},
		
		'callFlashFunction': function ( func, params ) {
			return this.each( function () {
				$(this)[0][func].apply( this, params );
			});
		}
		
		
	});
})(jQuery);



// Erweiterung der Funktionen für Typ $.plugin();

(function($){
	$.extend({
	
		'isIE': function ( vers ) {
			if (!vers) return $.browser.msie;
			return ($.browser.msie && $.browser.version.split('.')[0] == vers);
		},
		
		'currentURL': function () {
			return window.location.href;
		},
		
		'currentAnchor': function () {
			var a = $.currentURL().split('#');
			if (a.length < 2) return ''; 
			return a[1];
		},
		
		'metaTagValue': function ( id, data ) {
				if (!data) var data = $('head').html();
				var val = data.split("<meta name=\""+id+"\" content=\"")[1].split("\"")[0];
				return val;
			},
			
		'reqVars': function ( id, url) {
			if (!url) url = document.location.href;
			var paramsRaw = (url.split("?", 2)[1] || "").split("#")[0].split("&") || [];
			var _params = {};
			for (var i = 0; i < paramsRaw.length; i++){
				var single = paramsRaw[i].split("=");
				if (single[0]) _params[unescape(single[0])] = unescape(single[1]);
			}
			return id ? _params[id] : _params;
		},
		
		'stripTags': function ( html ) {
			if(arguments.length < 2) {
				html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
			} else {
				var allowed = arguments[2] == undefined ? true : arguments[2];				
				var specified = arguments[1];
				if(allowed){
					html=html.replace(new RegExp('</?[^('+specified.join('|')+'|/)][^>]*>', 'gi'), '');
				} else{
					html=html.replace(new RegExp('</?[('+specified.join('|')+')][^>]*>', 'gi'), '');
				}
			}
				
			return $.trim( html );
		},
		
		'stripNL': function ( data ) {
			if (!data) return '';
			return data.split("\t").join("").split("\r").join("").split("\n").join("");
		},
		
		'htmlentitiesdecode': function ( str ) {
			if (!$("<div />").html(str)) return '';
			return $("<div />").html(str).text();
		},
		
		'getAllTags': function  ( source, tagname, include_tag ) {
			var arr = [];
			while(source.indexOf("<"+tagname) > -1 || source.indexOf("</"+tagname) > -1) {
				var s = source.indexOf("<"+tagname);
				var s_e = source.indexOf(">", s);
				var e = source.indexOf("</"+tagname, s);
				var e_e = source.indexOf(">", e);
				
				var str = include_tag ? source.substring(s,e_e+1) : source.substring(s_e+1, e);
				
				if (tagname == "script" && (str.indexOf("gaJsHost") > -1 || str.indexOf("_getTracker") >-1 || str.indexOf("only_execute_once") >-1 )) {
					// ignorieren, weil Page-Tracker-Script von Google
				} else {
					if ($.trim(str)) arr.push( str );
				}
				
				source = source.substring(0, s) + source.substring(e_e+1);
			}
			return arr;	
		},
		
		'execScripts': function ( source, debug ) {
			var sc = $.getAllTags(source, "script");
			for (var i = 0; i < sc.length; i++) {
				try {
					eval( sc[i] );
				} catch (e) {
					if (debug) {
						alert( e );
						alert( sc[i] );
					}
					return false;
				}
			}
			return true;
		},
		
		'isNumeric': function ( input ) {
			return (input - 0) == input && input.length > 0;
		},
		
		'noCacheURL': function ( url ) {
			return url + (url.indexOf('?') > 0 ? '' : '?') + '&nocache='+Math.floor(Math.random()*10000);
		},
		
		'gaTrackPage': function ( title ) {
			if (!title) title = document.title.split(': ')[1];
			try { 
				var gaid = $( 'body' ).html().split('_getTracker("')[1].split('"')[0];
				var pageTracker = _gat._getTracker( gaid );
				_gat._anonymizeIp();
				pageTracker._trackPageview( title );
			} catch (e) {}

		},
		
		'm_ajax': function ( obj ) {
			if (!obj.id) obj.id = '';
			try {
				$('body').data('m_ajax_loader_'+obj.id).abort();
			} catch (e) {}
			var n = $.ajax({ 	url: obj.url, /*$.noCacheURL(obj.url)*/ 
						success: function (data) {
							if (!data) return false;
							document.title = $.htmlentitiesdecode( $.getAllTags(data, 'title')[0] );
							
							// Aus dem Body-Tag ein DIV machen, sonst kann man die Klasse nicht lesen!
							var body2div = $.stripNL($.getAllTags(data, 'body', true)[0]).split("<body").join("<div").split("</body").join("</div");
							
							// Vermeiden, dass das Bild im Header im Hintergrund geladen wird
							body2div = body2div.split('<div id="headerbox_inner"><img').join('<div id="headerbox_inner"><p');

							var html_data = $(body2div);
							
							//var html_data = $($.stripNL($.getAllTags(data, 'body')[0]));
							
							for (var target in obj.targets) {
								var o = html_data.find( target );
								var div = obj.targets[target] === true ? target : obj.targets[target];
								$( div ).html( o.html() );
							}
							
							if (obj.execScripts !== false) $.execScripts( data );
							$.gaTrackPage();
							if (obj.success) obj.success( data, html_data );
						}
				});
			$('body').data('m_ajax_loader_'+obj.id, n );

		}
		
	});
})(jQuery);


// Preloader-Effekt

(function($){
	$.fn.extend({
		'showPreloader': function ( opt ) {
			$('body').hidePreloader();
			var def = { offsetLeft:0, offsetTop: -20, followMouse: false, delay:1000 };
			var opt = $.extend( def, opt);
			
			return this.each( function () {
				var el = $(this);
				var div = '<div class="preloader" style="background:transparent url(fileadmin/templates/imgs/spin.png) 0 0;width:32px;height:30px;position:absolute;z-index:20000"></div>';
				$('body').prepend(div);
				$('.preloader').css({top:el.offset().top + opt.offsetTop, left:el.offset().left + el.width()/2 + opt.offsetLeft });
				var p = 0;
				$.__preloaderIV = setInterval( function (e) {
					p = (p + 30)%(30*7);
					$('.preloader').css({'background-position':'0 '+p+'px'});
				}, 50);
				
				if (opt.followMouse) {
					$(this).unbind('mousemove').mousemove( function (e) {
						$('.preloader').css({top:e.pageY+opt.offsetTop, left:e.pageX+opt.offsetLeft});
					});
				}
				
				if (opt.delay) {
					$('.preloader').hide();
					setTimeout( function () { $('.preloader').show(); }, opt.delay);
				}
			});
		},
		'hidePreloader': function () {
			if ($.__preloaderIV) clearInterval( $.__preloaderIV );
			$('.preloader').remove();
			return this.each( function () {
				$(this).unbind('mousemove');
			});
		}
	})
})(jQuery);


(function($){
	$.fn.extend({
		'pulsate': function ( opt ) {
			
			var def = { speed:100, scale: 0.8, alpha: 0.2, delay:0 };
			var opt = $.extend( def, opt);
			
			return this.each( function(){
				
				var img = $(this);
			
				var is_div = img.html().length > 0;
				var orig = is_div ? {} : {w:img.attr('width'), h:img.attr('height') };
				
				if (!orig.w && !is_div) {
					img.load( function () { img.pulsate( obj ) } );
					return this;
				}
				
				var cnt = -opt.delay;
				var timer = setInterval( function () {
					if (cnt++ > opt.speed/2) cnt = 0;
					if (cnt < 0) return;
					var f = 0.5 + 0.5 * Math.sin( 90+(360/opt.speed*cnt)/(180/Math.PI) );
					if (opt.scale !== false) {
						img.attr( {	'width':	orig.w + ((orig.w * opt.scale)-orig.w)*f, 
									'height':	orig.h + ((orig.h * opt.scale)-orig.h)*f	
									});
					}
					img.css( 'opacity', opt.alpha + (1-opt.alpha)*f );
					if ( !img.position().top ) {clearInterval( timer );}
				}, 10);
			});
		}
		
	});
})(jQuery);



(function($){
	$.fn.extend({
		'accordeonMenue': function ( opt ) {
		
			var def = {offsetX:0, offsetY:0, radius:20, pause:0 };
			var opt = $.extend( def, opt);
			
			var div = $(this);
			
			var closeAll = function ( noAnimation ) {
			
				div.find('ul:first').addClass('selected');
				div.find('ul').each( function () {
					if (!$(this).hasClass('selected')) {
						if (noAnimation) {
							$(this).stop(true,true).hide();
						} else {
							$(this).stop(true,true).slideUp( 200, 'easeInOutQuint' );
						}
					}
				});
				div.find('ul:first, ul.selected').each( function () {
					if (!$(this).is(':visible')) {
						if (noAnimation) {
							$(this).stop(true,true).show();
						} else {
							$(this).stop(true,true).delay(200).slideDown( 200, 'easeInOutQuint' );
						}
					}
				});
			
			}
			
			var openUp = function ( ref ) {
				
				var li = $(ref).parent('li:first');
				var ul = li.parent('ul:first');
				
				div.find('ul,li,a').removeClass('selected');
				li.addClass('selected');
				li.find('ul:first').addClass('selected');
				$(ref).addClass('selected');
				
				$(this).addClass('selected');
				var t = ul;
				while ($(t).length) {
					t.addClass('selected');
					t.parent('li:first').find('a:first').addClass('selected');
					t = $(t.parent('ul:first,li:first'));
				}
			}
			
			openUp( div.find('ul li a.selected:last') );
			closeAll( true );
			
			return this.each( function () {
				var mc = div.find('ul li a');
				mc.click( function () {
					openUp( this );
					closeAll();
					div.find('a').resetRolloverColor();
				});
			});
		
		}
	});
})(jQuery);


// PNG-FIX für IE6+
// http://jquery.andreaseberhard.de/pngFix/

$( function() {$(document).pngFix();});
(function($){jQuery.fn.pngFix=function(settings){settings=jQuery.extend({blankgif:'blank.gif'},settings);var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(jQuery.browser.msie&&(ie55||ie6)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr('width',jQuery(this).width());jQuery(this).attr('height',jQuery(this).height());var prevStyle='';var strNewHTML='';var imgId=(jQuery(this).attr('id'))?'id="'+jQuery(this).attr('id')+'" ':'';var imgClass=(jQuery(this).attr('class'))?'class="'+jQuery(this).attr('class')+'" ':'';var imgTitle=(jQuery(this).attr('title'))?'title="'+jQuery(this).attr('title')+'" ':'';var imgAlt=(jQuery(this).attr('alt'))?'alt="'+jQuery(this).attr('alt')+'" ':'';var imgAlign=(jQuery(this).attr('align'))?'float:'+jQuery(this).attr('align')+';':'';var imgHand=(jQuery(this).parent().attr('href'))?'cursor:hand;':'';if(this.style.border){prevStyle+='border:'+this.style.border+';';this.style.border='';}
if(this.style.padding){prevStyle+='padding:'+this.style.padding+';';this.style.padding='';}
if(this.style.margin){prevStyle+='margin:'+this.style.margin+';';this.style.margin='';}
var imgStyle=(this.style.cssText);strNewHTML+='<span '+imgId+imgClass+imgTitle+imgAlt;strNewHTML+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;strNewHTML+='width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;';strNewHTML+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+jQuery(this).attr('src')+'\', sizingMethod=\'scale\');';strNewHTML+=imgStyle+'"></span>';if(prevStyle!=''){strNewHTML='<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;'+'">'+strNewHTML+'</span>';}
jQuery(this).hide();jQuery(this).after(strNewHTML);});jQuery(this).find("*").each(function(){var bgIMG=jQuery(this).css('background-image');if(bgIMG.indexOf(".png")!=-1){var iebg=bgIMG.split('url("')[1].split('")')[0];jQuery(this).css('background-image','none');jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')";}});jQuery(this).find("input[src$=.png]").each(function(){var bgIMG=jQuery(this).attr('src');jQuery(this).get(0).runtimeStyle.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+bgIMG+'\', sizingMethod=\'scale\');';jQuery(this).attr('src',settings.blankgif)});}
return jQuery;};})(jQuery);
