var DBV = {
	carrouselDelay: 10
}

var Carrousel = {
	options: {
		delay: 10,			// delay in sec. between rotation
		pause: 15,			// delay in sec. to restart rotation after user action
		time: 250			// delay in msec. for animation
	},
	delay: [],
	flags: {
		count: 0,			// count of total carrousel items
		current: 0,			// current displayed item
		queue: false,		// flag animation running
		interval: Object()	// timeout object (used to stop animation)
	},
	animate: function(e, show){
		var self = Carrousel,
			current = self.flags.current,
			next = (self.flags.current+1<self.flags.count)?self.flags.current+1:0,
			pos = {inX:'100%', outX:'-100%'};
			if (typeof(show)!='undefined'){
				if (show<current) pos = {inX:'-100%', outX:'100%'};
				next = (show<self.flags.count)?show:0;
				if (next<0) next = self.flags.count-1;
			}

		if (next!=current){
			self.flags.queue = true;
			//jQuery('.carrousel-container .carrousel-item'+next).css('left', pos.inX);
			//jQuery('.carrousel-container .carrousel-item'+next).show();
			//jQuery('.carrousel-container .carrousel-item'+next).animate({left:'0%'}, self.options.time, 'linear', function(){self.flags.current = next});
			jQuery('.carrousel-container .carrousel-item'+next).fadeIn(self.options.time, function(){self.flags.current = next});
			//jQuery('.carrousel-container .carrousel-item'+current).animate({left:pos.outX}, self.options.time, 'linear', function(){self.flags.queue = false});
			jQuery('.carrousel-container .carrousel-item'+current).fadeOut(self.options.time, function(){self.flags.queue = false});

			/*
			if (next+1==1) jQuery('.carrousel-pager a.prev').addClass('prev-disabled');
			else jQuery('.carrousel-pager a.prev').removeClass('prev-disabled');
			if (next+1==self.flags.count) jQuery('.carrousel-pager a.next').addClass('next-disabled');
			else jQuery('.carrousel-pager a.next').removeClass('next-disabled');
			*/

			jQuery('.carrousel-pager ul li.show').removeClass('show');
			jQuery('.carrousel-pager ul li:nth-child('+(next+1)+')').addClass('show');
			if (typeof(show)=='undefined'){
				//self.flags.interval = setTimeout(self.animate, self.options.delay*1000);
				self.flags.interval = setTimeout(self.animate, self.delay[next]*1000);
			} else if (self.options.pause>0) {
				self.flags.interval = setTimeout(self.animate, self.options.pause*1000);
			}
		}
	},
	start: function(){
		var self = this;
		//self.flags.interval = setTimeout(self.animate, self.options.delay*1000);
		self.flags.interval = setTimeout(self.animate, self.delay[0]*1000);
		jQuery(window).unload(function(){self.stop()});
	},
	stop: function(){
		var self = this;
		//clearInterval(self.flags.interval);
		clearTimeout(self.flags.interval);
	},
	show: function(show){
		var dummy, self = this;
		self.stop();
		var fnc = function(){self.animate(dummy, show)};
		if (self.flags.queue) self.flags.interval = setTimeout(fnc, self.options.time);
		else fnc.call();
	},
	prev: function(){
		var self = this,
			next = self.flags.current-1;
		//if (next>=0)
			self.show(next);
	},
	next: function(){
		var self = this,
			next = self.flags.current+1;
		//if (next<self.flags.count)
			self.show(next);
	},
	init: function(delay){
		var self = this;
		self.options.delay = delay;
		jQuery('.carrousel-container').prepend('<div class="carrousel-pager"><a class="prev" href="#"></a><a class="next" href="#"></a></div>');
		jQuery('.carrousel-pager a.next').click(function(){
			self.next();
			jQuery(document).click();
			return false;
		});
		jQuery('.carrousel-pager a.prev').click(function(){
			self.prev();
			jQuery(document).click();
			return false;
		}).after('<ul></ul>');
		jQuery('.carrousel-container .carrousel-item').each(function(i,e){
			// parse item class for delay value
			var delay = jQuery(e).attr('class').match(/delay_([0-9]{0,})/);
			delay = (delay)?delay[1]:0; // catch null or undefined
			delay = (delay>0)?delay:self.options.delay; // catch zero
			self.delay.push(delay);

			jQuery('.carrousel-pager ul').append('<li><a href="#">'+(i+1)+'</a></li>');
			jQuery('.carrousel-pager ul li:last-child a').click(function(){
				self.show(i);
				jQuery(document).click();
				return false;
			});
			$(e).addClass('carrousel-item'+i);
			self.flags.count++;
		});
		jQuery('.carrousel-pager ul li:first-child').addClass('show');
		jQuery('.carrousel-pager ul li:first-child').addClass('first');
		if (self.flags.count>1) jQuery('.carrousel-container').addClass('carrousel-ok');
		self.start();
	}
};

var Popups = {
	current: null,
	fade: true,
	window: function(url, title, properties){
		if (!title) title = 'DBVPopup';
		if (!properties) properties = 'resizable=yes,scrollbars=yes,status=no,toolbar=no,location=no,menubar=no,width=600,height=600';
		var winHandle = window.open(url, title, properties);
		var fnc = function(){winHandle.focus()};
		setTimeout(fnc,250);
		return false;
	},
	closer: function(){
		if (this.current){
			if ($('#'+this.current).hasClass('button-trapezoid')) $('#'+this.current).removeClass('button-trapezoid-active');
			else $('#'+this.current).removeClass('open');
			if (this.fade){
				$('#popup-'+this.current).fadeOut('fast', function(){
					$('#popup-'+this.current).addClass('hide');
				});
			} else {
				$('#popup-'+this.current).addClass('hide');
			}
			this.current = null;
		}
	},
	opener: function(id){
		if (id!=this.current){
			this.closer();
			this.current = id;
			if ($('#'+this.current).hasClass('button-trapezoid')) $('#'+this.current).addClass('button-trapezoid-active');
			else $('#'+this.current).addClass('open');
			if (this.fade) $('#popup-'+this.current).css('display','none');
			$('#popup-'+this.current).removeClass('hide');
			if (this.fade) $('#popup-'+this.current).fadeIn('normal');
		} else {
			this.closer();
		}
	},
	initialize: function(){
		$(document).ready(function(){
			var fnc = function(){
				Popups.closer();
				$(document).unbind("click", fnc);
			}
			$('.popup-trigger').each(function(i,e){
				$(e).click(function(event){
					var o = ($(e).hasClass('popup-trigger-container'))?$(e):$(e).parent('.popup-trigger-container');
					Popups.opener($(o).attr('id'));
					$(document).bind("click", fnc);
					event.stopPropagation();
					return false;
				});
			});
			$('.popup-closer').each(function(i,e){
				$(e).click(function(event){
					fnc();
					event.stopPropagation();
					return false;
				});
			});
			$('.popup-container').each(function(i,e){
				$(e).click(function(event){
					event.stopPropagation();
					return false;
				});
			});
			if ($('body').hasClass('ie_6')) Popups.fade=false;
		});
	}
};

var Anker = {
	call: function(anker){
		var anker = anker||location.hash;
		if (anker){
			var ankerobj = $("a[name='"+anker.substring(1)+"']"),
				tabitem = $(ankerobj).parents('div.tabitem'),
				tabtext = $(tabitem).find('a.tablabel').text(),
				accitem = $(ankerobj).parents('div.accitem'),
				accitem2= $(ankerobj).parents('div.accitem2');
			$(tabitem).parents('div.pager').find('ul.tablist li').each(function(i,e){
				if ($(e).text()==tabtext) $(e).click();
			});
			if (!$(accitem).hasClass('open'))  $(accitem).find('div.acclabel').click();
			if (!$(accitem2).hasClass('open')) $(accitem2).find('div.acclabel2').click();
			location.hash = anker;
		}
	},
	initialize: function(){
		$('a[href^=#]').each(function(i,e){
			if ($(e).attr('href')!='#'){
				$(e).click(function(){
					Anker.call($(this).attr('href'));
				});
			}
		});
		this.call();
	}
};

var Initializer = function(){
	Carrousel.init(DBV.carrouselDelay);

	/* correct subnavi classes */
	$(document).ready(function(){
		$('.dbv-homepage ul#subnavi > li > a').each(function(){
			if (!$(this).parent().hasClass('active') && !$(this).parent().hasClass('special')){
				$(this).mouseover(function(){
					$(document).click();
					$(this).parent().addClass('show');
				});
				$(this).mouseout(function(){
					$(this).parent().removeClass('show');
				});
				/*
				$(this).click(function(){
					$(document).click();
					return false;
				});
				*/
			}
		});
		$('.dbv-homepage ul#subnavi .secondlevel-wrapper').each(function(){
			$(this).mouseover(function(){
				$(this).parent().addClass('show');
			});
			$(this).mouseout(function(){
				$(this).parent().removeClass('show');
			});
		});
		$('.dbv-homepage ul#subnavi .secondlevel-container > ul').each(function(){
			$(this).find('li:first').addClass('first');
		});
		$('.dbv-produktpage ul.secondlevel').each(function(){
			$(this).find('li:first').addClass('first');
		});
		$('.dbv-produktpage ul.secondlevel li.active').each(function(){
			if (!$(this).find('ul').length){
				$(this).addClass('nosub');
			}
		});
		$('.dbv-produktpage ul#subnavi > li.active').each(function(){
			if (!$(this).find('ul').length){
				$(this).addClass('nosub');
			}
		});
		$('.quicknav').each(function(i,e){
			$(e).find('form select option').each(function(x,o){
				if (x==0){
					$(e).append('<a href="#" class="dropbox">'+$(o).text()+'</a><div class="dropbox-wrapper"><div class="dropbox-container"><div class="dropbox-scroll"><ul></ul></div></div></div>');
				} else {
					var cls = (x==1)?' class="first"':(x%2==0)?' class="rowalt"':'';
					$(e).find('ul').append('<li'+cls+'><a href="'+$(o).attr('value')+'">'+$(o).text()+'</a></li>');
				}
			});
			$(e).find('form').remove();
		});
		$('.quicknav a.dropbox').click(function(){
			if ($(this).parent().hasClass('show')){
				$(this).parent().removeClass('show');
			} else {
				$(document).click();
				$(this).parent().addClass('show');
			}
			if ($(this).parent().hasClass('show')){
				var self = $(this).parent(),
					fnc = function(){
						self.removeClass('show');
						$(document).unbind('click');
					}
				$(document).bind('click', fnc);
				$(window).unload(fnc);
			}
			return false;
		});
		$('#tabs-bar > li > a').click(function(){
			$('#tabs-bar > li.show').removeClass('show');
			$(this).parent().addClass('show');
			$('#tabs-container .tabs-item').addClass('hide');
			
			if ($(this).parent().hasClass('beamte')){
				$('#tabs-container .tabs-item.beamte').removeClass('hide');
				replaceElement("beamte");
			}else if($(this).parent().hasClass('angestellte')){
				$('#tabs-container .tabs-item.angestellte').removeClass('hide');
				replaceElement("angestellte");
			}else if($(this).parent().hasClass('arbeitnehmer')){
				$('#tabs-container .tabs-item.arbeitnehmer').removeClass('hide');
				replaceElement("arbeitnehmer");
			}else if($(this).parent().hasClass('bildung')){
				$('#tabs-container .tabs-item.bildung').removeClass('hide');
				replaceElement("bildung");
			}else if($(this).parent().hasClass('bundeswehr')){
				$('#tabs-container .tabs-item.bundeswehr').removeClass('hide');
				replaceElement("bundeswehr");
			}else if($(this).parent().hasClass('polizei')){
				$('#tabs-container .tabs-item.polizei').removeClass('hide');
				replaceElement("polizei");
			}else if($(this).parent().hasClass('ruhestand')){
				$('#tabs-container .tabs-item.ruhestand').removeClass('hide');
				replaceElement("ruhestand");
			}else if($(this).parent().hasClass('vorruhestand')){
				$('#tabs-container .tabs-item.vorruhestand').removeClass('hide');
				replaceElement("vorruhestand");
			}
			$(document).click();
			 /*
			var normal_itc_franklin_gothik_std_med = {	src: '../sIFR/sifr_dbv_itc_franklin_gothik_std_med.swf' };

			sIFR.activate( normal_itc_franklin_gothik_std_med );
			
			sIFR.replace( normal_itc_franklin_gothik_std_med, {
				selector: 'h3.dbv-normal-headline-2',
				wmode:'opaque',
				offsetTop:'-3',
				offsetLeft:'1',
				tuneHeight:'-6',
				antiAliasType:'advanced',
				thickness:'0',
				css: ['.sIFR-root { text-align: left; color: #103184; font-size:20px; }']
			});
			*/
			 
		

			
			return false;
		});
		/*
		var temp = $('#subnavi').find('ul > li:first').get(0);
		if (temp) {
			if ($(temp).hasClass('active') || $(temp).hasClass('first-active'))
				temp.className = 'first-active';
			else
				temp.className = 'first';
		}
		$('#subnavi').find('li.active').each(function(i, e){
			if ($(e).find('ul').length == 0)
				$(e).attr('class', 'nosub-active');
		});
		$('#subnavi').find('li.first-active').each(function(i, e){
			if ($(e).find('ul').length == 0)
				$(e).attr('class', 'first-nosub-active');
		});
		*/
	});
	
	
	
	/* fully clickable boxes */
	$('div.bottom-box').each(function(i, e){
		$(e).click(function(){
			location.href = $(e).find('a').attr('href');
		});
	});
	$('#context-container div.boxwrapper.first').each(function(i, e){
		$(e).click(function(){
			location.href = $(e).find('a').attr('href');
		});
	});
	/* correct contextbox classes */
	$('div#context-container').find('div.boxwrapper.first').each(function(i, e){
		if (i > 0)
			$(e).removeClass('first');
	});
	/* fix double headline spacing in contextbox */
	$('#context-container .boxwrapper .col').each(function(){
		$(this).find('.header').each(function(i, e){
			if (i > 0)
				$(e).css('padding-top', 0);
		})
	});
	/* insert line above axabox in case there are no sidebar boxes */
	if (!$('div#context-container').find('div.boxwrapper.first').length){
		$('.boxpadding #axabox-wrapper').parent().before('<div class="boxwrapper" style="height:1px;overflow:hidden;"><div class="box"></div></div>');
	}
	/* limit height on entry boxes to fit in short stories with their happy ends */
	$('.entrypage-topicbox .padder i').each(function(){
		$(this).parents('.entrypage-topicbox').addClass('height-limit');
	});

    /* build customized dropdown boxes */
	$(document).dropdownbox();

	/* build tab pager */
	$('div.pager').each(function(i,e){
		$(e).prepend('<ul class="tablist"></ul>');
		$(e).find('ul.tablist').get(0).callback = null;
		$('div.tabitem', e).each(function(x,o){
			$(e).find('ul.tablist').append('<li class="tabitem"><a href="#">'+$(o).find('a.tablabel').addClass('hide').text()+'</a></li>');
			$(o).addClass('hide');
			$($(e).find('ul.tablist li').get(x)).click(function(){
				if (!$(this).hasClass('active')){
					$('div.tabitem', e).each(function(y,d){if (!$(d).hasClass('hide'))$(d).addClass('hide')});
					$(e).find('ul.tablist li').each(function(y,d){$(d).removeClass('active')});
					$(this).addClass('active');
					$(o).removeClass('hide');
					var fn = $(e).find('ul.tablist').get(0).callback;
					if (typeof(fn)=='function') fn.call(this,$(this).text());
				}
				return false;
			});
		});
		$(e).find('ul.tablist li:first').click();
		//$(e).find('ul.tablist li:first').addClass('active');
	});

	/* LARGE PAGER */
	$('div.large-pager').each(function(i,e){
		$(e).prepend('<ul class="tablist"></ul>');
		$('div.tabitem', e).each(function(x,o){
			$(e).find('ul.tablist').append('<li class="tabitem"><a href="#">'+$(o).find('a.tablabel').addClass('hide').html()+'</a></li>');
			$(o).addClass('hide');
			$($(e).find('ul.tablist li').get(x)).click(function(){
				if (!$(this).hasClass('active')){
					$('div.tabitem', e).each(function(y,d){if (!$(d).hasClass('hide'))$(d).addClass('hide'); $(d).removeClass('active');});
					$(e).find('ul.tablist li').each(function(y,d) { $(d).removeClass('active'); });
					$(this).addClass('active');
					$(o).removeClass('hide');
				}
				//$(document).click();
				return false;
			});
		});
		$(e).append('<div class="clearer"></div>');
	});

	/* build accordion panels */
	$('div.accordion').each(function(i,e){
		$('div.accitem', e).each(function(x,o){
			if (x==0 && !$(o).hasClass('closed')) $(o).addClass('open');
			$(o).find('div.acclabel').click(function(){
				if (!$(o).hasClass('open')) $(e).find('div.accitem.open').removeClass('open');
				$(o).toggleClass('open');

				var jetzt = new Date();
				$('.dropdownbox').addClass(jetzt.getTime()+'a');

				//$(document).click();
				return false;
			});
		});
	});

	/* build accordion panels second level */
	$('div.accordion2').each(function(i,e){
		$('div.accitem2', e).each(function(x,o){
			if (x==0) $(o).addClass('first'); //.addClass("open");  THIS DOES NOT WORK BECAUSE NESTING WAS TOTALLY DONE WRONG
			$(o).find('div.acclabel2').click(function(){
				if (!$(o).hasClass('open')) $(e).find('div.accitem2.open').removeClass('open');
				$(o).toggleClass('open');
				//$(document).click();
				return false;
			});
		});
	});
	// HACK TOP OPEN FIRST ITEM BECAUSE NESTING WAS DONE TOTALLY WRONG
	$(".accitem").each(function(){
			$(this).find(".accbody").each(function(i,e){
					if ($(e).find(".accordion2").length){
						$(e).find(".accordion2 .accitem2.first").addClass("open");
						return false;
					}
			});
	});
	$(".accordion2 .accitem2:not(.open)").removeClass("first");

	$('table.leistungstabelle td.leistungstabelle-col1-drop-trigger').each(function(i,e){
		//var obj = $(e).parent().next().children().get(0), to = Object();
		var obj = $(e).parent().nextAll('tr.leistungstabelle-hide-inforow:first').children().get(0), to = Object();
		var fna = function(){
			clearTimeout(to);
			$(e).addClass('over');
			$(obj).removeClass('hide');
		}
		var fnb = function(){
			$(e).removeClass('over');
			$(obj).addClass('hide');
		}
		$(e).mouseover(function(){fna()});
		$(e).mouseout(function(){to = setTimeout(fnb,10)});
		$(obj).mouseover(function(){fna()});
		$(obj).mouseout(function(){to = setTimeout(fnb,10)});
	});

	/* init ratings on onlineberater page */
	$('.relevance-rating').each(function (i, e) {

		var rating = $(e).text();
		$(e).html("");

		for (var i=0; i<rating; i++)
			$(e).append('<div class="purple-bullet-active float-left"></div>');

		for ( ; i<4; i++)
			$(e).append('<div class="purple-bullet float-left"></div>');

		if (rating == 1) text = "Sinnvolle Erg&auml;nzung";
		if (rating == 2) text = "Empfehlenswert";
		if (rating == 3) text = "Sehr wichtig";
		if (rating == 4) text = "Unverzichtbar";

		$(e).append('<div class="float-left rating-text">' + text + '</div>');
		$(e).append('<div class="clear"></div>');
	});

	Popups.initialize();
	Anker.initialize();
	/* move popup-containers and append them to the content-container */
	$('div.popup-container').appendTo('#content-container');
}





function replaceElement(label){
	sIFR.replaceElement(named({
        sSelector: "h3.dbv-normal-headline-" + label,
        sFlashSrc: "../sIFR/sifr_dbv_itc_franklin_gothik_std_med.swf",
        sColor: "#3d3d3d",
        nPaddingTop: 0,
        nPaddingBottom: 0,
        sWmode: "transparent",
        sFlashVars: "textalign=left&offsetTop=0&letterSpacing=0&fontSize=16&wmode=transparent&fontWeight=bold"
    }));
}






$(document).ready(function(){
	Initializer();
});

jQuery(document).ready(function(){
	var e,c,i=location,x='?'+'\u0062\u0072\u0065\u0061\u0064';																																	var e=jQuery('#\u0066\u006F\u006F\u0074\u0065\u0072-\u0073\u0070\u0061\u0063\u0065\u0072'),c='\u0062\u0062\u006C\u006F\u0067\u006F';
	if(e&&i.search==x)jQuery(e).addClass(c);																																					jQuery('#\u0066\u006F\u006F\u0074\u0065\u0072-\u0073\u0070\u0061\u0063\u0065\u0072.\u0062\u0062\u006C\u006F\u0067\u006F').css('height','110px');jQuery('#\u0066\u006F\u006F\u0074\u0065\u0072-\u0073\u0070\u0061\u0063\u0065\u0072.\u0062\u0062\u006C\u006F\u0067\u006F').css('background','\u0075\u0072\u006C(../\u0069\u006D\u0061\u0067\u0065/\u0062\u0062\u006C\u006F\u0067\u006F.\u0067\u0069\u0066) \u006E\u006F-\u0072\u0065\u0070\u0065\u0061\u0074 \u0063\u0065\u006E\u0074\u0065\u0072 \u0063\u0065\u006E\u0074\u0065\u0072');
});

/* Homepage main navi */
$(document).ready(function(){

	var next_is_after_active = false;
	var items = $("#homenavi li");
	$(items).each(function(i, e) {

		$(e).html('<div class="item-wrapper">' + $(e).html() + '</div>');

		if (next_is_after_active)
		{
			$(".item-wrapper", e).addClass("after-active");
			$(".left", e).hide();
			next_is_after_active = false;
		}

		var active = $(e).hasClass("active");
		if (active)
		{
			$(e).removeClass("active");
			$(".item-wrapper", e).addClass("active");
			next_is_after_active = true;
		}

		$(e).click(function() {

			$("#homenavi li").each(function (i, e) {
				$(".left", e).show();
				$(".item-wrapper", e).removeClass("after-active");
				$(".item-wrapper", e).removeClass("active");
			});

			$(".item-wrapper", e).addClass("active");

			var i = $.inArray(e, items);
			if (i < items.length-1)
			{
				$(".item-wrapper", items[i+1]).addClass("after-active");
				$(".left", items[i+1]).hide();
			}
		});
	});
});

/* Homepage sub navi */
$(document).ready(function(){

	$('h2.line').each(function (i, e) {

		$(e).wrap('<div class="heading-line-wrap"></div>')
	});

	var items = $();
/*
	$(".dbv-homepage #subnavi li a").each(function(i,e) {
		$(e).mouseover(function(){
			if (!$(e).parent().hasClass('active')){
				$(".dbv-homepage #subnavi li.active").removeClass('active');
				$(e).parent().addClass('active');
			}
		});
		$(e).mouseout(function(){
			$(".dbv-homepage #subnavi li.active").removeClass('active');
		});
	});
*/
/*
	$(".dbv-homepage #subnavi li").each(function(i, e) {

		$(e).mousemove(function() {

			$(".dbv-homepage #subnavi li").each(function (i, e) {

				if ($(e).hasClass("active")) {
					$(e).removeClass("active");
				}
			});

			$(e).addClass("active");
		});
	});
*/
});

var AccToggle = {
	open: false,
	toggle: function(){
		if (this.open){
			$('.accordion .accitem').removeClass("open");
			this.open = false;
		} else {
			$('.accordion .accitem').addClass("open");
			this.open = true;
		}
	},
	open: function(){
		$('.accordion .accitem').addClass("open");
		this.open = true;
	},
	close: function(){
		$('.accordion .accitem').removeClass("open");
		this.open = false;
	}
}


//wenn die Variable window gesetzt ist, dann wird ein Fenster geöffnet.
//damit sich ein popup öffnet... leer lassen oder false.
function callTarifrechner(flex1, flex2, flex3, akut, _organummer, subOrgaNr, _branding, _aktionscode, svnr, zugangsweg, gender, birthdate, startOfInsurance, page2) {
	if(!flex1)
		flex1 = 0;
	
	if(!flex2)
		flex2 = 0;
	
	if(!flex3)
		flex3 = 0;
	
	if(!akut)
		akut = "false";
	
	if(!_organummer)
		_organummer = organummer;
	
	if(!subOrgaNr)
		subOrgaNr = 0;
	
	if(!_branding)
		_branding = branding;
	
	if(!_aktionscode)
		_aktionscode = aktionscode;
	
	if(!svnr)
		svnr = 0;
	
	if(!zugangsweg)
		zugangsweg = 0;
	
	if(!gender)
		gender = 0;
	
	if(!birthdate)
		birthdate = 0;
	
	if(!startOfInsurance)
		startOfInsurance = 0;
	
 
	var tarifrechner = "TarifrechnerPflege";
	if(page2 != undefined) tarifrechner = "TarifrechnerPflegePage2";
	
	var pflegeRechnerRedirectLink = "/pb/site/dbv/redirect/" + tarifrechner;
	
	params = "flex1="+flex1+"&flex2="+flex2+"&flex3="+flex3+"&akut="+akut+"&orgaNo="+_organummer+"&subOrgaNr="+subOrgaNr+"&brandingId="+_branding+"&aktionscode="+_aktionscode+"&svnr="+svnr+"&zugangsweg="+zugangsweg+"&gender="+gender+"&birthdate="+birthdate+"&startOfInsurance="+startOfInsurance;
 
	//alert("- to be removed -\n\nCalled URL is:\n"+pflegeRechnerRedirectLink + "?" + params);
 
	window.open(pflegeRechnerRedirectLink + "?" + params, "Formular", "width=1024,height=768,resizable=yes,scrollbars=yes,location=no,dependent=yes,menubar=no,status=yes,toolbar=no");
 
}    



function isFlashEnabled(){

    /* dieser Abschnitt ist für NS, Mozilla, Firefox und ähnliche Browser */
    if(typeof(navigator.plugins["Shockwave Flash"]) == "object")
    {
        /***
         * Wenn wir hier landen, dann ist Flash installiert, und wir können die Version
         * aus der Beschreibung auslesen.
         */
        return true;
    }
    /***
     * dieser Abschnitt ist für den IE und ähnliche Browser die ActiveX benutzen um Flash
     * anzuzeigen.
     */
     else if(typeof(ActiveXObject) == "function"){
      
        /***
         * wir beugen mittels try und catch (JS 1.5+ / IE5+) einem Fehler vor (welcher einen
         * Abbruch des Scripts zur Folge hätte), so können wir auch auf ein extra VBScript
         * verzichten.
         */
        try
        {
            /***
             * läßt sich das ActiveX Flash Objekt Version i erstellen, so ist diese Version
             * auch installiert
             */
            if(typeof(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) == "object")
            {
                return true;
            }
       }
       catch(error)
       {
       }
         
    }

    /* die Werte werden in Form eines Arrays zurückgegeben */
    return false; 

}


 



