function LadImg() { //v2.0
  if (document.images) {
    var imgFiles = LadImg.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MerkImg() { //v2.0
  if (document.ImgDef != null)
    for (var i=0; i<(document.ImgDef.length-1); i+=2)
      document.ImgDef[i].src = document.ImgDef[i+1];
}

function TauImg() { //v2.0
  var i,j=0,objStr,obj,TauArray=new Array,oldArray=document.ImgDef;
  for (i=0; i < (TauImg.arguments.length-2); i+=3) {
    objStr = TauImg.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      TauArray[j++] = obj;
      TauArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = TauImg.arguments[i+2];
  } }
  document.ImgDef = TauArray; //used for restore
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore(what) { //v3.0
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

if (window.name != "freigabe"){
	window.name = "main";
}
this.focus();
	

function calcHeight()
	{
	  if (document.layers) {
	    h=document.layers['Content'].document.height + 100;
	    if (h > document.height) {document.height = h;} 
	  }
	}


/* Rollover-Effect TDs 
------------------------------------------------------------
Aufruf: onMouseOver="javascript:high(this);return false" onMouseOut="javascript:low(this);return false;"
------------------------------------------------------------
*/
function high(LinkObject)	{
RollColor='EFEFEF';
	LinkObject.style.background = '#' + RollColor;
}
function low(LinkObject)	{
	LinkObject.style.background = 'transparent';
}

//-->
	

function movieWin(file,props)
{
movieWin = window.open(file,"movie",props);
}
	

var x
function fensterAuf (x,wid,hei)
{
if (document.layers)			// fuer netzcape
	{
	wid = parseInt(wid) + 8;
	hei = parseInt(hei) + 6;	
	}
else							// weil explorer behandelt die fenstergroessen anners
	{
	wid = parseInt(wid) + 20;
	hei = parseInt(hei) + 38;	
	}
props = 'width=' + wid + ',height=' + hei + ',resizable=yes,scrollbars=yes';
pictWin = window.open(x,"pict",props);
if (pictWin.closed != true)		
	{
	pictWin.resizeTo(wid,hei);
	}
}

function fensterAuf250 (x,wid,hei)
{
if (document.layers)			// fuer netzcape
	{
	wid = parseInt(wid) + 8;
	hei = parseInt(hei) + 6;	
	}
else							// weil explorer behandelt die fenstergroessen anners
	{
	wid = parseInt(wid) + 10;
	hei = parseInt(hei) + 29;	
	}
props = 'width=' + wid + ',height=' + hei + ',resizable=no';
pictWin = window.open(x,"pict",props);
if (pictWin.closed != true)		
	{
	pictWin.resizeTo(wid,hei);
	}
}

function fensterAufDyn (x,wid,hei)
{
if (document.layers)			// fuer netzcape
	{
	wid = parseInt(wid) + 8;
	hei = parseInt(hei) + 6;	
	 if (wid > 800) {
	   wid = 800;
	 }
	 if (hei > 600) {
	   hei = 600;
	 }
	}
else							// weil explorer behandelt die fenstergroessen anners
	{
	wid = parseInt(wid) + 40;
	hei = parseInt(hei) + 38;	
	 if (wid > 800) {
	   wid = 800;
	 }
	 if (hei > 600) {
	   hei = 600;
	 }
	}
props = 'width=' + wid + ',height=' + hei + ',resizable=yes,scrollbars=yes';
pictWin = window.open(x,"pict",props);
if (pictWin.closed != true)		
	{
	pictWin.resizeTo(wid,hei);
	}
}

function helpAuf (x,wid,hei)
{
if (document.layers)			// fuer netzcape
	{
	wid = parseInt(wid) + 8;
	hei = parseInt(hei) + 6;	
	}
else							// weil explorer behandelt die fenstergroessen anners
	{
	wid = parseInt(wid) + 20;
	hei = parseInt(hei) + 38;	
	}
props = 'width=' + wid + ',height=' + hei + ',resizable=no, scrollbars';
pictWin = window.open(x,"pict",props);
if (pictWin.closed != true)		
	{
	pictWin.resizeTo(wid,hei);
	}
}

function fenster(name,ort,w,h,scroll)
{
	if (document.layers)			// fuer netzcape
	{
		w = parseInt(w) + 15;
		h = parseInt(h) + 24;	
	}
	else							// weil explorer behandelt die fenstergroessen anners
	{
		w = parseInt(w) + 30;
		h = parseInt(h) + 68;	
	}
  	win = window.open(ort, name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scroll+',resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (win.closed != true)		
	{
		win.resizeTo(w,h);
	}
	win.focus();
	return false;
}

function ubbWin(name,ort,w,h,scroll,resize)
{
	if (document.layers)			// fuer netzcape
	{
		w = parseInt(w) + 15;
		h = parseInt(h) + 14;	
	}
	else							// weil explorer behandelt die fenstergroessen anners
	{
		w = parseInt(w) + 30;
		h = parseInt(h) + 58;	
	}
  	win = window.open(ort, name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scroll+',resizable='+resize+',copyhistory=no,width='+w+',height='+h);
	if (win.closed != true)		
	{
		win.resizeTo(w,h);
	}
	win.focus();
}

function chkSuchFormular()
   {
	if(document.formular.such.value == "")
     {
      alert("Bitte geben Sie einen Suchbegriff an!");
      document.formular.such.focus();
      return false;
     }
   }

function login_chkFormular()
 {
	 if(document.login_form.fuser.value == "")
   {
    alert("Bitte Benutzernamen angeben!");
    document.login_form.fuser.focus();
    return false;
   }
  if(document.login_form.fpw.value == "")
   {
    alert("Bitte Passwort angeben!");
    document.login_form.fpw.focus();
    return false;
   }
 }
 
 function login_sub() {
  document.login_form.submit();
 }
 
 function checkDel(url)
	 {
	 	//var url = "" + url;
		if (url.indexOf("delpage") > -1)
		{
		var msg = "Moechten Sie die aktuelle Seite mit allen Elementen wirklich loeschen?";
		}
		
		if (url.indexOf("katdelp2") > -1)
		{
		var msg = "Moechten Sie die aktuelle Kategorie wirklich loeschen?";
		}
		
		if (url.indexOf("del_element") > -1)
		{
		var msg = "Moechten Sie das Element wirklich loeschen?";
		}
		
  if (url.indexOf("did") > -1)
		{
		var msg = "Moechtest du die Unit wirklich loeschen?";
		}
	    if(confirm(msg)) top.location.href = url;
	 }
	
		//PopUpfunktion
		function pop_up(url,name,breit,hoch,scroll,menubar)
		{
			if (document.layers)				// fuer netzcape
				{
					breit = parseInt(breit) + 8;
					hoch = parseInt(hoch) + 6;	
				}
				else							// weil explorer behandelt die fenstergroessen anners
				{
					breit = parseInt(breit) + 20;
					hoch = parseInt(hoch) + 38;	
				}
		fenster=window.open(url,name,'width='+breit+',height='+hoch+',toolbar=no,location=no,directories=no,status=no,menubar='+menubar+',scrollbars='+scroll+',resizable=yes,copyhistory=yes');
		fenster.focus();
		}

 /*
 DETECT FLASH
  Resources:
   - http://www.xs4all.nl/~ppk/js/flash.html
   - http://www.dithered.com/javascript/flash.html
*/

var flashinstalled = 0;
var flashversion = 0;
var MSDetect = "false";

if(navigator.plugins && navigator.plugins.length){
 x = navigator.plugins["Shockwave Flash"];
 if(x){
  flashinstalled = 2;
  if (x.description){
  	y = x.description;
   flashversion = y.charAt(y.indexOf('.')-1);
 	}
 }
 else{
  flashinstalled = 1;
 }
 if(navigator.plugins["Shockwave Flash 2.0"]){
  flashinstalled = 2;
  flashversion = 2;
 }
}
else if(navigator.mimeTypes && navigator.mimeTypes.length){
 x = navigator.mimeTypes['application/x-shockwave-flash'];
 if(x && x.enabledPlugin){
 	flashinstalled = 2;
 }
 else{
		flashinstalled = 1;
 }
}
else{
 MSDetect = "true";
 document.write('<script type="text/vbscript"\> \n');
 document.write('on error resume next \n');
 document.write('If MSDetect = "true" Then \n');
 document.write(' 	For i = 2 to 8 \n');
 document.write('   	If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then \n');
 document.write('    Else \n ');
 document.write('	 	  flashinstalled = 2 \n');
 document.write('	    flashversion = i \n');
 document.write('    End If \n ');
 document.write('	 Next \n');
 document.write('End If \n');
 document.write('If flashinstalled = 0 Then \n');
 document.write('	 flashinstalled = 1 \n');
 document.write('End If');
 document.write('</script\> \n');
}


function contentFlash(swfFile,swfWidth,swfHeight,altFile) {
 if ( flashinstalled == 2 && flashversion >= 6 ) {
  document.write('<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0\' id=\'footer_de\' width=\'' + swfWidth + '\' height=\'' + swfHeight + '\'\>');
  document.write('<param name=\'movie\' value=\'' + swfFile + '\' /\>');
  document.write('<param name=\'quality\' value=\'high\' /\>');
  document.write('<param name=\'bgcolor\' value=\'transparent\' /\>');
  document.write('<param name=\'wmode\' value=\'opaque\' /\>');
  document.write('<embed src=\'' + swfFile + '\' quality=\'high\' wmode=\'opaque\' swLiveConnect=\'false\' width=\'' + swfWidth + '\' height=\'' + swfHeight + '\' name=\'visual\' align=\'\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.adobe.com/shockwave/download/download.cgi\?P1_Prod_Version=ShockwaveFlash\'\></embed\>');
  document.write('</object\>');
 } else {
  document.write('<img src=' + altFile + ' width=' + swfWidth + ' height=' + swfHeight + ' border=0 /\>');
 }
}


function in_send_email_Formulare55() {
	 if(document.send_email.u_nickname.value == "" && document.send_email.u_email.value == "")
    {
     alert("Bitte gib Deinen Nickname und / oder\nDeine Email - Adresse an!");
     document.send_email.u_nickname.focus();
     return false;
    }
  }

function in_send_email_Formulare55en() {
	 if(document.send_email.u_nickname.value == "" && document.send_email.u_email.value == "")
    {
     alert("Your Username and / or\nEmail - Adress is missing!");
     document.send_email.u_nickname.focus();
     return false;
    }
  }
  
function chkFormular53(){
 if (document.in_Formular.elements['u_nickname']) {
  if(document.in_Formular.u_nickname.value == ""){
 		alert("Bitte gib einen Nickname an!");
 		document.in_Formular.u_nickname.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_passw'] ) {
 	if(document.in_Formular.u_passw.value == ""){
 		alert("Bitte gib ein Passwort an!");
 		document.in_Formular.u_passw.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_passw'] ) {
 	if(document.in_Formular.u_passw.value.length < 6){
 		alert("Das Passwort muss mindestens 6 Zeichen lang sein!");
 		document.in_Formular.u_passw.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_passw'] && document.in_Formular.elements['u_passwc'] ) {
 	if(document.in_Formular.u_passw.value != document.in_Formular.u_passwc.value){
 		alert("Die Passwoerter sind nicht identisch!");
 		document.in_Formular.u_passwc.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_vorname'] ) {
 	if(document.in_Formular.u_vorname.value == ""){
 		alert("Bitte gib deinen Vornamen an!");
 		document.in_Formular.u_vorname.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_nachname'] ) {
  if(document.in_Formular.u_nachname.value == ""){
 		alert("Bitte gib deinen Nachnamen an!");
 		document.in_Formular.u_nachname.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_strasse'] ) {
 	if(document.in_Formular.u_strasse.value == ""){
 		alert("Bitte gib eine Strasse an!");
 		document.in_Formular.u_strasse.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_plz'] ) {
 	if(document.in_Formular.u_plz.value == ""){
 		alert("Bitte gib eine Postleitzahl an!");
 		document.in_Formular.u_plz.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_ort'] ) {
 	if(document.in_Formular.u_ort.value == ""){
 		alert("Bitte gib einen Ort an!");
 		document.in_Formular.u_ort.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_email'] ) {
 	if(document.in_Formular.u_email.value == ""){
 		alert("Bitte gib eine gueltige E-Mail Adresse an!");
 		document.in_Formular.u_email.focus();
 		return false;
 	}
  if(document.in_Formular.u_email.value != ""){
 		if(document.in_Formular.u_email.value.indexOf('@') == -1){
 			alert("E-Mail Adresse ist ungueltig!");
 			document.in_Formular.u_email.focus();
 			return false;
 		}
 	}
 }
  if (document.in_Formular.elements['u_gebdd']) {
  if(document.in_Formular.u_gebdd.value == ""){
 		alert("Bitte gib deinen Geburtstag an!");
 		document.in_Formular.u_gebdd.focus();
 		return false;
 	}
 }
 if (document.in_Formular.elements['u_gebmm']) {
  if(document.in_Formular.u_gebmm.value == ""){
 		alert("Bitte gib deinen Geburtstag an!");
 		document.in_Formular.u_gebmm.focus();
 		return false;
 	}
 }
 if (document.in_Formular.elements['u_gebyyyy']) {
  if(document.in_Formular.u_gebyyyy.value == ""){
 		alert("Bitte gib deinen Geburtstag an!");
 		document.in_Formular.u_gebyyyy.focus();
 		return false;
 	}
 }
 if ( document.in_Formular.elements['u_accepts'] ) {
 	if(!document.in_Formular.u_accepts.checked == true){
 		alert("Bitte Datenschutz anerkennen!");
 		document.in_Formular.u_accepts.focus();
 		return false;
 	}
 }
}

function el08tab(a,p_id,c_pa) {
 jQuery.noConflict();
 var visTab = 'tab0' + a;
 var url = '/tools/teaser08.cfm';
 var pars = 'id=' + a + '&p_id=' + p_id + '&c_pa=' + c_pa;
 var adiv = 'teaserTab';
 var myAjax = new Ajax.Updater(adiv, url, {method: 'get', parameters: pars });
 if (document.getElementById('tab01')) { document.getElementById('tab01').className = 'tabdeakt' } ;
 if (document.getElementById('tab02')) { document.getElementById('tab02').className = 'tabdeakt' } ;
 if (document.getElementById('tab03')) { document.getElementById('tab03').className = 'tabdeakt' } ;
 document.getElementById(visTab).className = 'tabakt';
}

function select_all(a) {
    var text_val = eval(document.getElementById(a));
    text_val.focus();
    text_val.select();
 }

function CheckLen(Target) {
  var maxlength = "160"; //die maximale Zeichenlänge
  StrLen=Target.value.length;

  if (StrLen==1&&Target.value.substring(0,1)==" ")
  {
   Target.value="";
   StrLen=0;
  }
  if (StrLen>maxlength ) {
    Target.value=Target.value.substring(0,maxlength);
    CharsLeft=0;
   } else {
    CharsLeft=maxlength-StrLen;
   }
    document.getElementById('AnzahlZeichen').innerHTML=CharsLeft;
 }
  


