function showMuttertag2008() {
	document.getElementById('muttertag2008').style.display = 'block';
}
    
function hideMuttertag2008() {
	document.getElementById('muttertag2008').style.display = 'none';
}



function checkDealersearch(index) {

	if(index == 0) {
	//	alert('ausblenden');
		document.getElementById("dealercountry_zip").style.display = "none";
		document.getElementById("dealercountry_button").style.display = "none";
	} else {
	//	alert('einblenden');
		document.getElementById("dealercountry_zip").style.display = "block";
		document.getElementById("dealercountry_button").style.display = "block";
	}
}






var langSelectOpen = 'false';


function showLangSelect(lang,land,foe) {
    
	var foe = 'false';

    if(langSelectOpen == 'false') {
        document.getElementById("subnavigation_sprache").style.display = "block";
        if(foe == 'true') { document.getElementById("foeButton").style.display = "none"; }
        langSelectOpen = 'true';
        document.langtab.src = '/shared/images/langtab_' + lang + '_' + land + '_on.gif';
    } else {
        document.getElementById("subnavigation_sprache").style.display = "none";
        if(foe == 'true') { document.getElementById("foeButton").style.display = "block"; }
        langSelectOpen = 'false';
        document.langtab.src = '/shared/images/langtab_' + lang + '_' + land + '_off.gif';
    }
      
}

function schule_ueber(was){
	if(document.getElementById(was).className.indexOf('notoggle') > -1){
		return(true);
	}
	document.getElementById(was).style.display = 'block';
}
function schule_aus(was){

	if(document.getElementById(was).className.indexOf('notoggle') > -1){
		return(true);
	}
	document.getElementById(was).style.display = 'none';
}

function schule(){
	if(document.getElementById('subnavigation_schule').style.display == 'block'){
		document.getElementById('subnavigation_schule').style.display = 'none';
	}else{
		document.getElementById('subnavigation_schule').style.display = 'block';
	}
	
}

function openBildXXL(image) {
	var width = 100;
	var height = 100;
	var attribute="resizable=yes,location=no,scrollbars=yes,toolbar=no,status=no,width=" + width + ",height=" + height + ",top=50,left=50";
	var WindowURL = '/php/katalog_popup.php?image='+image;
	
	WindowTemp=window.open(WindowURL,'Detailansicht',attribute);
	WindowTemp.focus();
}


function changeBildLarge(bild_large,bild_xxl,active) {
    document.getElementById('bild_large').src = bild_large;
    document.getElementById('bild_xxl').href = "javascript:openBildXXL('"+bild_xxl+"');";
    
    for(i=1; i < (countThumbs+1); i++) {
        if(i == active) {
            activeThumb[i] = 'calenderThumbsActive';
            inactiveThumb[i] = 'calenderThumbsActive';
            document.getElementById('thumbBox'+i).className = activeThumb[i];
        } else {
            activeThumb[i] = 'calenderThumbsActive';
            inactiveThumb[i] = 'calenderThumbs';            
            document.getElementById('thumbBox'+i).className = inactiveThumb[i];
        }
    }
}



function openPopup(url, width, height) {
	
	var attribute="resizable=no,location=no,scrollbars=no,toolbar=no,status=no,width=" + width + ",height=" + height + ",top=50,left=50";
	var WindowURL = url;
	
	WindowTemp=window.open(WindowURL,'Detailansicht',attribute);
	WindowTemp.focus();
}

function mausUeber(was) {
	document.getElementById("weisser_punkt_" + was).style.display = 'block';
}
function mausRaus(was) {
	document.getElementById("weisser_punkt_" + was).style.display = 'none';
}

function unterMausUeber(was) {
	if(was.className.indexOf('notoggle') == -1){
		//alert(was.className);
		was.className = was.className + ' over';
	}
}
function unterMausAus(was) {
	if(was.className.indexOf('notoggle') == -1){
		was.className = 'navigationselement';
	}
}

function unterMausUeber_2(was) {
	was.className = was.className + ' aktiv2';
}



function unterMausAus_2(was) {
	if(was.className.indexOf('notoggle') > -1){
		return(true);
	}
	
	if(was.className.indexOf('last') == -1){
		was.className = 'navigationselement_2';
	}else{
		was.className = 'navigationselement_2 last';
	}
	
}
function unterMausAus_2_last(was) {
	was.className = 'navigationselement_2 last';
}

















/**
 * SWFObject v1.4.2: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.alternative_image = '';
	this.alternative_link = '';
	this.alternative_link_target = '';
	this.alternative_html = '';
	this.additional_html = '';
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	set_alternative_image: function(imageurl){
		this.alternative_image = imageurl;
	},
	set_alternative_link: function(linkurl, target){
		this.alternative_link = linkurl;
		this.alternative_link_target = target;
	},
	set_alternative_html: function(html){
		this.alternative_html = html;
	},
	set_additional_html: function(html){
		this.additional_html = html;
	},
	
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
			if(this.additional_html != ''){
				swfNode += this.additional_html;
			}
		}
		
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			
			if(this.alternative_html != ''){
				// alternativer HTML-Block hat höchste Prio
				n.innerHTML = this.alternative_html;
			}else{
				// Dann alternatives Bild, falls angegeben
				if(this.alternative_image != ''){
					if(this.alternative_link != ''){
						// ggf. mit Link, falls angegeben
						if(this.alternative_link_target == ''){
							this.alternative_link_target = "_self";
						}
						n.innerHTML = '<a href="' + this.alternative_link + '" target="' + this.alternative_link_target  + '"><img src="' + this.alternative_image + '" border="0"></a>';
					}else{
						n.innerHTML = '<img src="' + this.alternative_image + '" border="0">';
					}
				}
			}
			return true;
			
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = null;
			}
		}
	}
}
if (typeof window.onunload == 'function') {
	var oldunload = window.onunload;
		window.onunload = function() {
		deconcept.SWFObjectUtil.cleanupSWFs();
		oldunload();
	}
} else {
	window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

function SubscribeLehrerNewsletter(){
	var colorErr = "#ff0000";
	var colorStd = "#BAB5B0";
	var firstname   = jQuery.trim(jQuery('#vorname').val());
	var lastname    = jQuery.trim(jQuery('#nachname').val());
	var appellation = jQuery.trim(jQuery('#anrede').val());
	var email       = jQuery.trim(jQuery('#email').val());
	var schooltype  = jQuery.trim(jQuery('#schooltype').val());

	firstname = firstname == "Vorname" ? "" : firstname;
	lastname  = lastname == "Nachname" ? "" : lastname;
	email     = email == "eMail" ? "" : email;

	var error = false;
	if (appellation == '') {
		error = true;
		jQuery('#anrede').css("background-color", colorErr);
	}
	else {
		jQuery('#anerede').css("background-color", '#fff');
	}
	if (firstname == '') {
		error = true;
		jQuery('#vorname').css("border-color", colorErr);
	}
	else {
		jQuery('#vorname').css("border-color", colorStd);
	}
	if (lastname == '') {
		error = true;
		jQuery('#nachname').css("border-color", colorErr);
	}
	else {
		jQuery('#nachname').css("border-color", colorStd);
	}
	if (email == '' || !email.match(/^[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z]{2,4}$/g)) {
		error = true;
		jQuery('#email').css("border-color", colorErr);
	}
	else {
		jQuery('#email').css("border-color", colorStd);
	}
	if (schooltype == '') {
		error = true;
		jQuery('#schooltype').css("background-color", colorErr);
	}
	else {
		jQuery('#schooltype').css("background-color", "#fff");
	}
	
	if (!document.getElementById('NLprivacy').checked) {
		error = true;
		jQuery('#NLprvcText').css("color", colorErr);
		jQuery('#NLprvcLnk').css("color", colorErr);
	}
	else {
		jQuery('#NLprvcText').css("color", '#000');
		jQuery('#NLprvcLnk').css("color", '#000');
	}

	if (error) {
		alert("Bitte füllen Sie alle Felder aus!");
		return false;
	}

	appellation = encodeURIComponent(appellation);
	firstname = encodeURIComponent(firstname);
	lastname = encodeURIComponent(lastname);
	email = encodeURIComponent(email);
	schooltype = encodeURIComponent(schooltype);
	
	jQuery.ajax({
		type: "POST",
		url: "/shared/newsletter.php",
		data: "appellation=" + appellation + "&firstname=" + firstname + "&lastname=" + lastname + "&email=" + email + "&schooltype=" + schooltype,
		success: function(msg){
			jQuery('#FormLehrerNewsletter').hide();
			jQuery('#ConfirmLehrerNewsletter').show();
/*
		  var h = jQuery('#TeaserLehrerNewsletter').height();
		  jQuery('#TeaserLehrerNewsletter').hide();
		  jQuery('#ConfirmLehrerNewsletter').css("height", h + "px");
		  jQuery('#ConfirmLehrerNewsletter').show();
*/
		}
	});
}

function hideSlide(id) {
	jQuery(id).css('margin-top', '0px');
	jQuery(id).css('overflow', 'hidden');
	jQuery(id).animate({
		height: "0px"
	}, 300);
}
function checkdate(day, month, year) {
	day = day.replace(/^[0]{1,11}/, '');
	month = month.replace(/^[0]{1,11}/, '');
	
	day = parseInt(day);
	month = parseInt(month);
	year = parseInt(year);
	
	if (day == '' || isNaN(day) || day < 1 || day > 31) {
		return false;
	}
	if (month == '' || isNaN(month) || month < 1 || month > 12) {
		return false;
	}
	if (year == '' || isNaN(year) || year < 1) {
		return false;
	}
	
	leap = false;
	if (year % 4 == 0) {
		leap = true;
	}
	if (year % 100 == 0) {
		leap = false;
	}
	if (year % 400 == 0) {
		leap = true;
	}
	
	switch (month) {
		case 4:
		case 6:
		case 9:
		case 11:
			if (day > 30) {
				return false;
			}
			break;
		case 2:
			if (leap && day > 29) {
				return false;
			}
			if (!leap && day > 28) {
				return false;
			}
			break;
	}
	
	return true;
}