/* is called with <input type="text" onKeyup="this.value=withoutNonZipcodeCharacters(this.value)" (...) > */
var notAlertedYet = true;
function withoutNonZipcodeCharacters(text) {
   textWithout = text.replace(/[^\d]/gim,"");
   if (notAlertedYet && text != textWithout) {
     alert("The German zip code is numeric with 5 digits. (non-digit characters are deleted)");
     notAlertedYet = false;
   }
   return textWithout;
}
/* is called with <form onsubmit="return alertOnEmptyValue(this.datafieldname.value, 'text');" (...) > */
function alertOnEmptyValue(value, text) {
  if (value != '') {
    return true;
  } else {
    alert (text);
    return false;
  }
}

/*
 Name: Flash plugin detect
*/
var flashdetect = false;
function fnFlashDetect() {
 if (navigator.plugins && navigator.plugins.length) {
  for (x=0; x < navigator.plugins.length; x++) {
   if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
     flashdetect = true;      
    break;
   }
  }
 }
 else if (window.ActiveXObject) {
  for (x = 2; x <= 20; x++) {
   try {
    oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
    if(oFlash) {
     flashdetect = true;  
    }
   }
   catch(e) {}
  }
 }
}
 
fnFlashDetect(); // ausführung nach dem Laden der datei
 
/*
 Name:     Flash embed
 Description:  Writeout flash code. Fixes Eolas update for IE as well.
 @param swf       String path to swf file
 @param width     Number value of movie width
 @param height    Number value of movie height
 @param alternateContent String of HTML to be served if flash is not installed
*/
 
flash = new Object();
flash.insert = function(swf,width,height,alternateContent) {
	swf = swf.replace(/\./g,"%2E") // encode periods as %2e	

// ist eine Darkpage geladen,
if(document.getElementById('darkpage')){
	flashObject = alternateContent;
}else{ 	
 	if(flashdetect) {
 		flashObject = '<embed src="'+swf+'" allowScriptAccess="sameDomain" bgcolor="#f31c0a" align="middle" menu="false" quality="high" width="'+width+'px" height="'+height+'px" type="application/x-shockwave-flash" wmode="transparent" salign="T" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
 	}else{
  		flashObject = alternateContent;
 	}
}

 document.write(flashObject);
}

