
var timeOut;

function thesen_erstellen_von_nah(doc, nr)
{
	var myElem = doc.getElementById('thesen');
  if (myElem) {
    return;
  } else {
    myElem = doc.createElement("div");
    myElem.id = 'thesen';
    doc.getElementsByTagName('body')[0].appendChild(myElem);
  }	
  var func = function () {
    if (timeOut){
      window.clearTimeout(timeOut);
    }   
    if (!myElem){
      return;
    }
    var html = '<div id="thesen_schatten"></div><div id="thesen_inhalt"><iframe src="these_' + nr + '.html" name="thesen_inhalt" height="100%" width="100%" class="thesen_iframe" marginheight="0" marginwidth="0" frameborder="0" noresize scrolling="no"></iframe></div>';
    //var html = '<iframe src="these_' + nr + '.html" name="thesen_inhalt" height="100%" width="100%" class="thesen_iframe" marginheight="0" marginwidth="0" frameborder="0" noresize scrolling="no"></iframe>';
    myElem.innerHTML = html;
  }    
  window.setTimeout(func, 1);
}


function thesen_erstellen_von_weit(doc, nr)
{
	var myElem = doc.getElementById('thesen');
	
	if (myElem && myElem.style.display == 'none')
	{
    myElem.style.display = 'block';
	  return;
	}
	
	myElem = doc.createElement("div");
	myElem.id = 'thesen'

	var html = '<div id="thesen_schatten"></div><div id="thesen_inhalt"><iframe src="../philosophie/these_' + nr + '.html" name="thesen_inhalt" class="thesen_iframe" marginheight="0" marginwidth="0" frameborder="0" noresize scrolling="no"></iframe></div>';
	myElem.innerHTML = html;
	doc.getElementsByTagName('body')[0].appendChild(myElem);
}



function thesen_schliessen(doc) {
  var myElem = doc.getElementById('thesen');
  //myElem.style.display = 'none';
  doc.getElementsByTagName('body')[0].removeChild(myElem);
}




//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// KARUSELL EFFEKT
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var a=0;
var aa=0;
var b;
var startStatus = true;
var text1;
var text2;
var text3;
var time;


//++++++++++++++++++++++++++++++++++++++++++++++
// nach links bewegend
//++++++++++++++++++++++++++++++++++++++++++++++


function karusell1()
{
  text1 = document.getElementById('text_1');
  if (startStatus == true)
  {
		text1.style.left=a + 'px';
		laufen1();
	}  
}

function karusell2()
{
  text2 = document.getElementById('text_2');
  text2.style.display = 'block';
  text2.style.left=aa + 'px';
  //laufen2();
}


function laufen1()
{
	if (time)
	{
		window.clearTimeout(time);
	}
	if (a>-210)
	{
		a=a-10;
		text1.style.left=a + 'px';
		time = window.setTimeout ('laufen1()', 0);
  }
  if (a==-200)
  {
    text1.style.display = 'none';
    karusell2();
  }
}

function laufen2()
{
	if (time)
	{
		window.clearTimeout(time);
	}
	if (aa>-210)
	{
		aa=aa-10;
		text2.style.left=aa + 'px';
		time = window.setTimeout ('laufen2()', 0);
  }
  if (aa==-200)
  {
    text2.style.display = 'none';
    divdrittebox();
  }
}

function divdrittebox()
{
  text3 = document.getElementById('text_3');
	a=0;
	text3.style.left=a + 'px';
	text3.style.display = 'block';
	rueck();
}



function rueck()
{
  if (time)
  {
    window.clearTimeout(time);
  }
  if (b>0)
	{
		b=b-10;
		text3.style.left=b + 'px';
		time = window.setTimeout ('rueck()', 1);
	}		  
}

//++++++++++++++++++++++++++++++++++++++++++++++
// nach rechts bewegend
//++++++++++++++++++++++++++++++++++++++++++++++

function zurueckbewegen()
{
  text3 = document.getElementById('text_3');
  if (startStatus == true)
  {
		text3.style.left=a + 'px';
		laufenR();
	}  
}


function laufenR()
{
	if (time)
	{
		window.clearTimeout(time);
	}
	if (a>-1)
	{
		a=a+10;
		text3.style.left=a + 'px';
		time = window.setTimeout ('laufenR()', 0);
  }
  if (a==250)
  {
    text3.style.display = 'none';
    zurueckbewegen2();
  }
}


function zurueckbewegen2()
{
  text2 = document.getElementById('text_2');
  text2.style.display = 'block';
  text2.style.left=aa + 'px';
  laufenR2();
}


function laufenR2()
{
	if (time)
	{
		window.clearTimeout(time);
	}
	if (aa>-1)
	{
		aa=aa+10;
		text2.style.left=aa + 'px';
		time = window.setTimeout ('laufenR2()', 0);
  }
  if (aa==250)
  {
    text2.style.display = 'none';
    divzweiteboxR();
  }
}


function divzweiteboxR()
{
  text1 = document.getElementById('text_1');
	a=-210;
	text1.style.left=a + 'px';
	text1.style.display = 'block';
	rueckR();
}



function rueckR()
{
  if (time)
  {
    window.clearTimeout(time);
  }
  if (a<0)
	{
		a=a+10;
		text1.style.left=a + 'px';
		time = window.setTimeout ('rueckR()', 1);
	}		  
}

