function switchTxt(fid){

   var faqAntwort = document.getElementById("textMore_" + fid);
   /* var switchLink = document.getElementById("faqSwitch_" + fid); */
   var faqFrage   = document.getElementById("textMoreBtn_" + fid);

   if(faqAntwort.style.display == "none"){
     /*  faqFrage.style.color = "#ae8509"; */
      faqAntwort.style.display = "";
      faqFrage.innerHTML = "Zuklappen";
      faqFrage.title = "Zuklappen";
      faqFrage.className = "plus";
   }else{
     /*  faqFrage.style.color = "#ae8509"; */
      faqAntwort.style.display = "none";
      faqFrage.innerHTML = "Mehr";
      faqFrage.title = "Mehr";
      faqFrage.className = "plus";
   }
}

function tgdEPaperTeaserV1Archiv(url,pub_title)
{
       Shadowbox.open( { content: "http://content.oemus.com/epaper/v1/index.php?ausgabe=" + url
                         , player:        "iframe"
                         , title:        pub_title
                         ,height:     802
                         ,width:      982
                         ,handleOversize: "none"
                         } ); 
}

function tgdEPaperTeaserV2Archiv(url,pub_title)
{
       Shadowbox.open( { content: "http://content.oemus.com/epaper/pub/" + url + "/index.html"
                         , player:        "iframe"
                         , title:         pub_title
                         ,height:     2000
                         ,width:      2000
                         } ); 
}

function tgdEPaperV2normal(url,title)
{
       Shadowbox.open( { content: url + "/index.html"
                         , player:        "iframe"
                         , title:         title
                         ,height:     2000
                         ,width:      2000
                         } ); 
}

// leipzig film
function video(url)
{
pop = window.open(url,'POP','scrollbars=no,width=500,height=430,top=' + ((screen.availHeight-430) / 2) + ',left=' + ((screen.availWidth-500) / 2)); 
pop.focus();
}

function epaperWindow(url)
{
pop2 = window.open(url,'POP','scrollbars=no,width=1000,height=679,top=' + ((screen.availHeight-679) / 2) + ',left=' + ((screen.availWidth-1000) / 2)); 
pop2.focus();
}


function mediadata(url)
{
pop2 = window.open(url,'POP','scrollbars=no,width=1000,height=679,top=' + ((screen.availHeight-679) / 2) + ',left=' + ((screen.availWidth-1000) / 2)); 
pop2.focus();
}

function MM_swapImgRestore() { //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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 surfto(form) {
          var myindex=form.select1.selectedIndex
          if (form.select1.options[myindex].value != "0") {
           location=form.select1.options[myindex].value;}
  }

// *****************************  textbox *************************************************************

function showWMTT(el,text) {
   nanu=getElementPosition(el)
	wmtt = document.getElementById("overDiv");
   wmtt.style.left = nanu.left+20+ "px";
   wmtt.style.top = nanu.top+20+ "px";
	wmtt.innerHTML=text;
	wmtt.style.display = "block"
}


function getElementPosition(elemID){
 var offsetTrail = document.getElementById(elemID);
 var offsetLeft = 0;
 var offsetTop = 0;
 while (offsetTrail){
  offsetLeft += offsetTrail.offsetLeft;
  offsetTop += offsetTrail.offsetTop;
  offsetTrail = offsetTrail.offsetParent;
 }
 if (navigator.userAgent.indexOf('Mac') != -1 && typeof 
document.body.leftMargin != 'undefined'){
  offsetLeft += document.body.leftMargin;
  offsetTop += document.body.topMargin;
 } return {left:offsetLeft,top:offsetTop};
}

function hideWMTT() {
	wmtt.style.display = "none";
}


function setText(text){
document.getElementById("bildtext").innerHTML = text;
}

function archivPop(url)
{
pop = window.open(url,'POP','scrollbars=yes,width=621,height=570, top=' + ((screen.availHeight-700) / 2) + ',left=' + ((screen.availWidth-600) / 2)); 
pop.focus();
}

// *****************************  Publikationsmenu *************************************************************

function change_menu(div_id,anzahl){  

     
   for(var i=1; i < anzahl+1; i++){ 
      var div = document.getElementById("con"+i);
      var divLink = document.getElementById("b"+i);
      div.style.display = (i == div_id) ? "" : "none";
      divLink.className = (i == div_id) ? "current" : "";
   }   
}

// *****************************  Publikationsuebersicht *************************************************************

function showWMTT(el,text,width,height) {
   nanu=getElementPosition(el)
   wmtt = document.getElementById("overDiv");
   wmtt.style.left = nanu.left+175+ "px";
   wmtt.style.top = nanu.top-206 + "px";
   wmtt.style.width = width + "em";
   wmtt.innerHTML= '<img src="' + text + '" style="width:'+ width +'em; height:'+ height + 'em;" />';
   wmtt.style.display = "block"
}


function getElementPosition(elemID){
 var offsetTrail = document.getElementById(elemID);
 var offsetLeft = 0;
 var offsetTop = 0;
 while (offsetTrail){
  offsetLeft += offsetTrail.offsetLeft;
  offsetTop += offsetTrail.offsetTop;
  offsetTrail = offsetTrail.offsetParent;
 }
 if (navigator.userAgent.indexOf('Mac') != -1 && typeof 
document.body.leftMargin != 'undefined'){
  offsetLeft += document.body.leftMargin;
  offsetTop += document.body.topMargin;
 } return {left:offsetLeft,top:offsetTop};
}

function hideWMTT() {
	wmtt.style.display = "none";
}

// *****************************  Kurztexte ein/ausblenden *************************************************************

function switchShortInfo(rows){
		
   var switchLink1 = document.getElementById("switchLink1");
   var switchLink2 = document.getElementById("switchLink2");
   
   
   for (var i = 1;i < (rows+1);i++){
   	
   	 var kurzInfo   = document.getElementById("k" + i); 
   
	   if(kurzInfo.style.display == "none"){
	      kurzInfo.style.display = "";
	      switchLink1.innerHTML = "Kurztexte ausblenden";
	      switchLink1.title = "Kurztexte ausblenden";
	      switchLink1.className = "switchClassOn"; 
	      switchLink2.innerHTML = "Kurztexte ausblenden";
	      switchLink2.title = "Kurztexte ausblenden";
	      switchLink2.className = "switchClassOn"; 

	   }else{
	      kurzInfo.style.display = "none";
	      switchLink1.innerHTML = "Kurztexte einblenden";
	      switchLink1.title = "Kurztexte einblenden";
	      switchLink1.className = "switchClassOff"; 
	      switchLink2.innerHTML = "Kurztexte einblenden";
	      switchLink2.title = "Kurztexte einblenden";
	      switchLink2.className = "switchClassOff"; 

	   }
   
  }
}

// *****************************  open window *************************************************************

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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];}}
}


<!--
var browser=new Object;
browser=navigator.appName;
version=navigator.appVersion;
os=navigator.platform;
codename=navigator.appCodeName;
agent=navigator.userAgent;
browser.major = parseInt(navigator.appVersion);
browser.minor = parseFloat(navigator.appVersion);

/*
document.write("<br><br><br>Browser:" + browser + "<br>");
document.write("Version:" + version + "<br>");
document.write("Sprache:" + language + "<br>");
document.write("Betriebssystem:" + os + "<br>");
document.write("Codename des Browsers:" + codename + "<br>");
document.write("User-Agent-Attribut:" + agent + "<br>");
document.write("Browser:" + browser + "<br>");
*/


safari = (navigator.appVersion.indexOf("Safari")!=-1) ? true : false;
moz = (navigator.appName.indexOf("Netscape")!=-1) ? true : false;
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
opera = (navigator.userAgent.indexOf("Opera")!=-1) ? true : false;
ie55 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.5")!=-1)) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
NS4 = (document.layers) ? true : false;
ie7 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 7")!=-1)) ? true : false;

function setContentHeightHome(){

    var bheight=getMyPageSize();
    
/*
    if (moz  || ie7) {
      document.getElementById('contentFrameContent').style.minHeight = bheight[1]-264 + "px";
      document.getElementById('teaserFrame1').style.minHeight = bheight[1]-260 + "px";
    }
    else {
      document.getElementById('contentFrameContent').style.height = bheight[1]-260 + "px";
      document.getElementById('teaserFrame1').style.height = bheight[1]-260 + "px";  
    }
*/
}  

function setContentHeight(myheight){

    var bheight=getMyPageSize();
     
    var mysize = 555;
/*
    if (moz  || ie7) {
       document.getElementById('contentFrameContent').style.minHeight = mysize - myheight + "px";
      document.getElementById('teaserFrame1').style.minHeight = mysize + 4 + "px";
    }
    else {
       document.getElementById('contentFrameContent').style.height = mysize - myheight + "px";
      document.getElementById('teaserFrame1').style.height = mysize + "px";
    }
*/
}  


function getMyPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function CheckForm(formname) {

  var illegalChars = /[\W_]/;
  var email_value = document.forms[formname].form_mail.value;
  
  if(document.forms[formname].form_name.value == "") {
    alert("Bitte geben Sie Ihren Namen ein.");
    document.forms[formname].form_name.focus();
    document.getElementById('form_name').style.borderColor="red";
    return false;
  }  
  if(document.forms[formname].form_vorname.value == "") {
    alert("Bitte geben Sie Ihren Vornamen ein.");
    document.forms[formname].form_vorname.focus();
    document.getElementById('form_vorname').style.borderColor="red";
    return false;
  }
  if(document.forms[formname].form_strasse.value == "") {
    alert("Bitte geben Sie Ihre Strasse und Hausnummer ein.");
    document.forms[formname].form_strasse.focus();
    document.getElementById('form_strasse').style.borderColor="red";
    return false;
  }
  if(document.forms[formname].form_ort.value == "") {
    alert("Bitte geben Sie Ihre PLZ und den Ort ein.");
    document.forms[formname].form_ort.focus();
    document.getElementById('form_ort').style.borderColor="red";
    return false;
  } 
  if(document.forms[formname].form_land.value == "") {
    alert("Bitte geben Sie Ihre Land ein.");
    document.forms[formname].form_land.focus();
    document.getElementById('form_land').style.borderColor="red";
    return false;
  }           

  //email format testen

  if(email_value == "") {
    alert("Bitte geben Sie Ihre Email-Adresse ein.");
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }   
 
  if(email_value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
    alert("Bitte geben Sie ein korrekte Email-Adresse ein.");
    document.forms[formname].form_mail.select();
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }

  return true;  
}

function CheckFormAnmeldung(formname) {

  var illegalChars = /[\W_]/;
  var email_value = document.forms[formname].form_mail.value;
  
  if(document.forms[formname].form_name.value == "") {
    alert("Bitte geben Sie Ihren Namen ein.");
    document.forms[formname].form_name.focus();
    document.getElementById('form_name').style.borderColor="red";
    return false;
  }  
  if(document.forms[formname].form_vorname.value == "") {
    alert("Bitte geben Sie Ihren Vornamen ein.");
    document.forms[formname].form_vorname.focus();
    document.getElementById('form_vorname').style.borderColor="red";
    return false;
  }
  if(document.forms[formname].form_strasse.value == "") {
    alert("Bitte geben Sie Ihre Strasse und Hausnummer ein.");
    document.forms[formname].form_strasse.focus();
    document.getElementById('form_strasse').style.borderColor="red";
    return false;
  }
  if(document.forms[formname].form_ort.value == "") {
    alert("Bitte geben Sie Ihre PLZ und den Ort ein.");
    document.forms[formname].form_ort.focus();
    document.getElementById('form_ort').style.borderColor="red";
    return false;
  } 
  if(document.forms[formname].form_land.value == "") {
    alert("Bitte geben Sie Ihre Land ein.");
    document.forms[formname].form_land.focus();
    document.getElementById('form_land').style.borderColor="red";
    return false;
  }           

  //email format testen

  if(email_value == "") {
    alert("Bitte geben Sie Ihre Email-Adresse ein.");
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }   
 
  if(email_value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
    alert("Bitte geben Sie ein korrekte Email-Adresse ein.");
    document.forms[formname].form_mail.select();
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }

  if(!document.forms[formname].form_agb.checked) {
    alert("Bitte informieren Sie sich ueber die AGBs und kreuzen Sie im Formular entsprechend an.");
    document.forms[formname].form_agb.focus();
    document.getElementById('form_agb').style.borderColor="red";
    return false;
  }        

  return true;  
}

function CheckFormKontakt(formname) {

  var illegalChars = /[\W_]/;
  var email_value = document.forms[formname].form_mail.value;
  
  if(document.forms[formname].form_name.value == "") {
    alert("Bitte geben Sie Ihren Namen ein.");
    document.forms[formname].form_name.focus();
    document.getElementById('form_name').style.borderColor="red";
    return false;
  }  
  if(document.forms[formname].form_vorname.value == "") {
    alert("Bitte geben Sie Ihren Vornamen ein.");
    document.forms[formname].form_vorname.focus();
    document.getElementById('form_vorname').style.borderColor="red";
    return false;
  }

  //email format testen

  if(email_value == "") {
    alert("Bitte geben Sie Ihre Email-Adresse ein.");
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }   
 
  if(email_value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
    alert("Bitte geben Sie ein korrekte Email-Adresse ein.");
    document.forms[formname].form_mail.select();
    document.forms[formname].form_mail.focus();
    document.getElementById('form_mail').style.borderColor="red";
    return false;
  }

  if(document.forms[formname].form_message.value == "") {
    alert("Bitte geben Sie Ihren Miiteilung ein.");
    document.forms[formname].form_message.focus();
    document.getElementById('form_message').style.borderColor="red";
    return false;
  }

  return true;  
}
//-->
