//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// MEINE FUNCTIONEN
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//==================================================================================
//==================================================================================
//
// JS-PROGRAMMIERUNG
// AUTOR: MS
// ERSTELLT: 16.11.2009
//
//==================================================================================
//==================================================================================



//==================================================================================
// INHALT
//==================================================================================

// STARTSEITE - ZUFALL - BOX EINBLENDEN
// STARTSEITE - MAIN BILD BEWEGEN 
// WEITERE INFOS - BOX OEFFNEN
// IMPRESSUM DATENSCHUTZHINWEIS ZEIGEN

//==================================================================================









//==================================================================================
//==================================================================================
// 
// STARTSEITE - ZUFALL - BOX EINBLENDEN
// 
//==================================================================================
//==================================================================================

//Bilden wir die Variablen
var ErsteZahl;
var ZweiteZahl;
var time_zufall1;
var time_zufall2;

//Bilden wir zwei zufällige Zahl
function zufall_BoxAnzeige()
{
	var min = 1;
	var max = 3;
	ErsteZahl = Math.floor(Math.random() * (max - min)) + min;
	ZweiteZahl = Math.floor(Math.random() * (max - min)) + min;
	
	//alert(ErsteZahl+" und "+ZweiteZahl);
	anzeige_BoxAnzeige();
	
	//abfrage, damit die zwei zahlen nicht doppelt vorkommen
	/*if (ErsteZahl == ZweiteZahl)
	{
	  zufall_BoxAnzeige();
	}
	else
	{
		anzeige_BoxAnzeige();
	}*/
	
}


//Zeigen wir die Boxen
function anzeige_BoxAnzeige()
{
  zeigeBox1 = document.getElementById('reiter_box_neu_'+ErsteZahl);
  zeigeBox2 = document.getElementById('reiter_box_sommerzeit_'+ZweiteZahl);
  zeigeBox1.style.display = "block";
  zeigeBox2.style.display = "block";  
  window.setTimeout ('zufallbox_einfahren1(ErsteZahl)', 1000);
  window.setTimeout ('zufallbox_einfahren2(ZweiteZahl)', 1000);
}

// BOX1 wird eingefahren
function zufallbox_einfahren1(ErsteZahl)
{
	TextBox1 = document.getElementById('reiter_text_neu_'+ErsteZahl);
	TextBox1.style.position = 'relative';
	TextBox1_left=-600;
	TextBox1.style.left = TextBox1_left + 'px';
  TextBox1_einfahren1();
}

function TextBox1_einfahren1()
{
	if (time_zufall1)
	{
		window.clearTimeout(time_zufall1);
	}
	if (TextBox1_left<0)
	{
		TextBox1_left=TextBox1_left+20;
		TextBox1.style.left=TextBox1_left + 'px';
		time_zufall1 = window.setTimeout ('TextBox1_einfahren1()', 10);
  }
  if (TextBox1_left==0)
  {
		TextBox1.style.zIndex = '10';
  }
}

// BOX2 wird eingefahren
function zufallbox_einfahren2(ZweiteZahl)
{
	TextBox2 = document.getElementById('reiter_text_sommer_'+ZweiteZahl);
	TextBox2.style.position = 'relative';
	TextBox2_left=-600;
	TextBox2.style.left = TextBox2_left + 'px';
  TextBox2_einfahren2();
}

function TextBox2_einfahren2()
{
	if (time_zufall2)
	{
		window.clearTimeout(time_zufall2);
	}
	if (TextBox2_left<0)
	{
		TextBox2_left=TextBox2_left+20;
		TextBox2.style.left=TextBox2_left + 'px';
		time_zufall2 = window.setTimeout ('TextBox2_einfahren2()', 10);
  }
  if (TextBox2_left==0)
  {
		TextBox2.style.zIndex = '10';
  }
}
		





//==================================================================================
//==================================================================================
// 
// STARTSEITE - MAIN BILD BEWEGEN 
// 
//==================================================================================
//==================================================================================

var time_main_bild;
var gehe_schritte = 1;
var geschwindigkeit = 31;

function main_bild_bewegen()
{
  MainBild = document.getElementById('main_bild');
  MainBild.style.position = 'relative';
	MainBild_left=0;
	MainBild.style.left = MainBild_left + 'px';
  window.setTimeout ('fahre_main_bild()', 4000);

}

// bewege main_bild nach rechts
function fahre_main_bild()
{
	if (time_main_bild)
	{
		window.clearTimeout(time_main_bild);
	}
	if (MainBild_left >= -188)
	{
		MainBild_left=MainBild_left-gehe_schritte;
		MainBild.style.left = MainBild_left + 'px';
		time_main_bild = window.setTimeout ('fahre_main_bild()', geschwindigkeit);
  }
  if (MainBild_left == -188)
  {
		MainBild.style.left = MainBild_left + 'px';
		MainBild_left = -190;
		window.setTimeout ('fahre_main_bild_zurueck()', 4000);
  }
}

// bewege main_bild nach links
function fahre_main_bild_zurueck()
{

	if (time_main_bild)
	{
		window.clearTimeout(time_main_bild);
	}
	if (MainBild_left <= 0)
	{
		MainBild_left=MainBild_left+gehe_schritte;
		MainBild.style.left = MainBild_left + 'px';
		time_main_bild = window.setTimeout ('fahre_main_bild_zurueck()', geschwindigkeit);
  }
  if (MainBild_left == 0)
  {
		MainBild.style.left = MainBild_left + 'px';
		MainBild_left = 0;
		window.setTimeout ('fahre_main_bild()', 4000);
  }
}





//==================================================================================
//==================================================================================
// 
// WEITERE INFOS - BOX OEFFNEN
// 
//==================================================================================
//==================================================================================

function weiter_infos_aufmachen(zahl)
{
	weitere_infos1 = document.getElementById('weiter_infos_link_'+zahl);
	weitere_infos1.style.display = 'none';
	weitere_infos2 = document.getElementById('sortiment_mehr_infos_text_'+zahl);
	weitere_infos2.style.display = 'block';
}


function weiter_infos_zumachen(zahl)
{
	weitere_infos1 = document.getElementById('weiter_infos_link_'+zahl);
	weitere_infos1.style.display = 'block';
	weitere_infos2 = document.getElementById('sortiment_mehr_infos_text_'+zahl);
	weitere_infos2.style.display = 'none';
}





//==================================================================================
//==================================================================================
// 
// IMPRESSUM DATENSCHUTZHINWEIS ZEIGEN
// 
//==================================================================================
//==================================================================================

function datenschutzhinweis_einblenden(hinweis_status) {

  datenschutzElement = document.getElementById("datenschutzhinweis");
  
  if(hinweis_status == "ein")
  {datenschutzElement.style.display = "block"}
  if(hinweis_status == "aus")
  {datenschutzElement.style.display = "none"}  
}  
  

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// PopUp-Funktion
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var popupSettings = {};
popupSettings['default'] = '';
popupSettings['Video'] = 'width=640,height=382,scrollbars=no';

function openPopup(url,windowName,settingsID) {
  var settings;
  var newWindow;
  if (popupSettings[settingsID]) {
    settings = popupSettings[settingsID];
  } else {
    settings = popupSettings['default'];
  }
  newWindow = window.open(url,windowName,settings);
  newWindow.focus();
}


