﻿// JScript-Datei



function zufallsbild()      // es wird ein zufälliges bild geladen. bilder müssen dafür im ordner img/zufall sein und mit zufall[nummer] beginnen
{

    var picName = "img/zufall/zufall";
    var picType = ".gif";
    var picCount = 14;
    var num = parseInt(Math.random() * picCount) + 1;
   if(num == parent.Iframe3.document.getElementById("nummer").value)  //damit nicht zweimal das gleiche bild geladen wird
    {
        if(num == picCount) // wenn num ist gleich der max anzahl dann -1
        {
            num -=1;
        }
        else
        {
            num +=1;
        }
    }
    
	parent.Iframe3.document.getElementById("bilder").src = picName + num + picType;
	//parent.Iframe3.document.getElementById("bilder").width = "100"
	//parent.Iframe3.document.getElementById("bilder").height = "100"
	parent.Iframe3.document.getElementById("bilder").alt = picName + num + picType;
	parent.Iframe3.document.getElementById("nummer").value = num;

	 
}

function zufallsbild_en()      // es wird ein zufälliges bild geladen. bilder müssen dafür im ordner img/zufall sein und mit zufall[nummer] beginnen
{

  var picName = "../img/zufall/zufall";
  var picType = ".gif";
  var picCount = 14;
  var num = parseInt(Math.random() * picCount) + 1;
  if (num == parent.Iframe3.document.getElementById("nummer").value)  //damit nicht zweimal das gleiche bild geladen wird
  {
    if (num == picCount) // wenn num ist gleich der max anzahl dann -1
    {
      num -= 1;
    }
    else {
      num += 1;
    }
  }

  parent.Iframe3.document.getElementById("bilder").src = picName + num + picType;
  //parent.Iframe3.document.getElementById("bilder").width = "100"
  //parent.Iframe3.document.getElementById("bilder").height = "100"
  parent.Iframe3.document.getElementById("bilder").alt = picName + num + picType;
  parent.Iframe3.document.getElementById("nummer").value = num;


}

function ein_ausblenden(typ)  // menüpunkte werden ein bzw. ausgeblendet
{
      
    if(document.getElementById(typ).style.display == "none")
    {   
        document.getElementById(typ).style.display = "inline"
    }
    else 
    {    
        document.getElementById(typ).style.display = "none"
    }
    
}

function seite_laden(seite,htmlaspx)  //wenn man auf einen menüpunkt klickt wird eine seite geladen
{																			//htmlaspx -- false html wird geladen bei  true aspx seite wird geladen
 
	if (htmlaspx == true)
	{
		parent.Iframe2.location.href='../menu/'+seite+'.aspx';
	}
	else
	{
		parent.Iframe2.location.href='../menu/'+seite+'.html';
}
 
}


function write_email(subject)           //damit emails nicht von spambots ausgelesen werden können
{
    var    x ="@"
    var Mail ="<a href=\""
        Mail+="mailto:"
        Mail+="office"+x    
        Mail+="hollaus.at"
        Mail+="?subject="
        Mail+="Mail von hollaus.at ("+subject+")\">"
        Mail += "Email"
        Mail+="</a>"
    document.write(Mail);
    
}
function write_email_Hotline(subject)           //damit emails nicht von spambots ausgelesen werden können
{
    var x = "@"
    var Mail = "<a href=\""
    Mail += "mailto:"
    Mail += "Hotline" + x
    Mail += "hollaus.at"
    Mail += "?subject="
    Mail += "Mail von hollaus.at (" + subject + ")\">"
    Mail += "Email an Hotline/Support senden"    
    Mail += "</a>"
    document.write(Mail);

}
function write_email_Hotline_Startseite(subject)           //damit emails nicht von spambots ausgelesen werden können
{
    var x = "@"
    var Mail = "<a href=\""
    Mail += "mailto:"
    Mail += "Hotline" + x
    Mail += "hollaus.at"
    Mail += "?subject="
    Mail += "Mail von hollaus.at (" + subject + ")\">"
    Mail = Mail + subject 
    Mail += "</a>"
    document.write(Mail);

  }
  function write_email_RKVVIEW_Anforderung()           //damit emails nicht von spambots ausgelesen werden können
  {
   
    var x = "@"
    var Mail = "<a href=\""
    Mail += "mailto:"
    Mail += "office" + x
    Mail += "hollaus.at"
    Mail += "?subject=RKV-View 	&Uuml;bersicht"
    Mail += "&body=Bitte%20&uuml;bermitteln%20Sie%20mir%20eine%20Autstellung%20aller%20vorhandenen%20RKV-View%20Erweiterungen%0A%0A Telefonnummer:%0A Zus&auml;tzliche%20Bemerkung:%0A%0A mfg \">"

   

    Mail += "(Übersicht anfordern)"
    Mail += "</a>"
      document.write(Mail);
  
  }

  function write_email_SchulungBuchen(Kurs,Termin)           //damit emails nicht von spambots ausgelesen werden können
  {
  	 
//  	var x = "@"
//  	var Mail = "<a href=\""
//  	Mail += "mailto:"
//  	Mail += "office" + x
//  	Mail += "hollaus.at"
//  	Mail += "?subject=Schulungsanfrage"
//  	Mail += "&body=Name / Firma:%20%0ATelefonnummer:%20%0AWas%20soll%20geschult%20werden:%20" + Kurs + "%0ATermin:%20" + Termin + "\">"
//  	

//  	Mail += "Buchungsanfrage"
//  	Mail += "</a>"
//  	document.write(Mail);


  	var Schulungstext = "<a href=autocadschulungemail.aspx?Termin=" + Termin + "&kurs=" + Kurs + ">"
  	Schulungstext += "Buchungsanfrage"
  	Schulungstext += "</a>"
  	document.write(Schulungstext);
  }



 

function menu_einausblenden()
{ 
  
    var auswahl = document.getElementById("lbAuswahl").value;
   
    if(auswahl.length == "0")
    {
        auswahl="alle";
    }
     
    if(auswahl == "alle")
    {
  
        //var alleElemente = document.getElementsByTagName("*");    // ging mit ff nicht 
    
  //var elemente = document.getElementById("ddbox").style.display = "inline"; // style der ddbox wird richtig angezeigt
     var alleElemente = document.forms[0].getElementsByTagName("*");  
   
           for (var i = 0; i < alleElemente.length;i++) 
        { 
       
						 alleElemente[i].style.display="inline";											
        } 
           
    }
    else
    {
        document.getElementById(auswahl).style.display="inline";
    }
}



function calcHeight()   // zur berechnung der iframe höhe
{
	document.getElementById('content_frame').height=window.frames.content_frame.document.body.scrollHeight +50;
}

function calcHeight_frame2()   // zur berechnung der iframe höhe
{

	document.getElementById('Iframe2').height=top.Iframe2.document.body.scrollHeight +50;
}


function HauptseiteLaden(thref) {

  var url = thref;
   var tsplit = url.split("/");
  var tsplitlaenge = tsplit.length;
  var turl = tsplit[tsplitlaenge - 3] + "/" + tsplit[tsplitlaenge - 2] + "/" + tsplit[tsplitlaenge - 1];
//  alert(turl);
  (!top.frames[0]) ? top.location.href = '../../index.aspx?seite=' + turl : 0; 
  
}


