//Robby Jansch
//js-lib.js
//all the general-functions for this project
//29.04.05

//11.10.05 AlexEngel, Logbuch: Funktionen zum Bildaustausch bei MouseOver oder Whatever

//12/07/2007 keine MM_preloadImages <-- funktionen für den Bilderaustausch verwenden nicht xhtml-konform!!!!
var old_div;
var div_array = new Array("d_heliplus","d_pilotsnet","d_logmyflight","d_paper-la-papp","d_augenpraxis-lindenthal","d_jinshinjyutsu","d_engel-malerei","d_koellen-maler");
function show_picture(id, path){
	document.getElementById(id).src=path;
}


function pic_change(id){
	window.document.picture.src="nothing.gif";
}

function checkform(){
	alert(document.form.contactname.value);
	alert(document.form.email.value);
	alert(document.form.subject.value);
	alert(document.form.contact.value);
}
function show_div(id){
	

	for(i=0;i<div_array.length;i++){
		//alert(document.getElementById(div_array[i]).style.display);
		if(document.getElementById(div_array[i]).style.display==""){

		new Effect.Fade(div_array[i],{queue:'front'});

		}
	}

	
     new Effect.Appear(id,{queue:'end'});


	
}

function hide_div(id){



	//alert(id);
	if(document.getElementById(id).style.visibility=="visible"){
		alert("jup");
		// <![CDATA[
      Effect.Fade(id);
    // ]]>
	//	document.getElementById(id).style.display="none";
	}
}

//Timer 
//use start() to get it running
//put this in the html-site
//<input type="hidden" name="theTime" id="theTime"size=5>

// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var timerID = 0;
var tStart  = null;

function UpdateTimer() {
	//erstmal nen einfachen umschalter
	if (document.all.theTime.value=="0:1"){
		over("heliplus");
	}
	if (document.all.theTime.value=="0:10"){
		over("pilotsnet");
	}
	if (document.all.theTime.value=="0:20"){
		over("logmyflight");
	}
	if (document.all.theTime.value=="0:30"){
		over("engel");
	}
	if (document.all.theTime.value=="0:40"){
		over("paperlapapp");
	}
         if (document.all.theTime.value=="0:50"){
		Reset();
	}


   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }

   if(!tStart)
      tStart   = new Date();

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);

   document.all.theTime.value = ""
                                   + tDate.getMinutes() + ":"
                                   + tDate.getSeconds();

   timerID = setTimeout("UpdateTimer()", 1000);
}

function Start() {
   tStart   = new Date();

 document.getElementById('theTime').value = "00:00";

   timerID  = setTimeout("UpdateTimer()", 1000);
}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}

function Reset() {
   tStart = null;

   document.all.theTime.value = "00:00";
}
//Start();






/*
//get all the screeninfos you need
function screeninfo(){
//fits on all browsers
alert("Bildschirm:" + screen.width + " x " + screen.height);
//fits only on IE - the others take window.innerwidth
alert("Fenster:" +  document.body.offsetWidth  + " x " + document.body.offsetHeight );
//extend it  with screen infos 

}


//to get the actual position of the mouse 
//put this into the html, onload="init_mousemove()"
//<form style="position:absolute;top:0px;left:200px" name="feld"><input type="text" name="ausg"></form>
//
// find out if ie runs in quirks mode
//
var docEl = (
             typeof document.compatMode != "undefined" && 
             document.compatMode        != "BackCompat"
            )? "documentElement" : "body";

// register event
// capture it for nc 4x (ok it's a dino)
//
function init_mousemove() {
    if(document.layers) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove =	dpl_mouse_pos;
}

function dpl_mouse_pos(e) {

    // position where mousemove fired
    //
    var xPos    =  e? e.pageX : window.event.x;
	var yPos    =  e? e.pageY : window.event.y;

	
	// for ie add scroll position
	//
	if (document.all && !document.captureEvents) {
	    xPos    += document[docEl].scrollTop;
	    yPos    += document[docEl].scrollTop;
    }
    
    // display position
    //
    document.feld.ausg.value    =  "Left = " + xPos + " : Top = " + yPos;
    
    // for the dino pass event
    //
    if (document.layers) routeEvent(e);
}



//testfunction - leave it on the end
function DHTMLtest() {
  var Ausgabetext = "";
  if (DHTML) {
    Ausgabetext += "DHTML ist aktiviert!\n"
  } else {
    Ausgabetext += "DHTML ist nicht aktiviert!\n";
  }
  if (DOM) {
    Ausgabetext += "DOM wird unterstützt!\n";
  } else {
    Ausgabetext += "DOM wird nicht unterstützt!\n";
  }
  if (MSIE4)
    Ausgabetext += "Alte Microsoft-Technologie ohne DOM!\n";
  if (NS4)
    Ausgabetext += "Alte Netscape-Technologie ohne DOM!\n";

  /*var h1_Inhalt = getContent("tagname", "h1", 0);
  if (h1_Inhalt) {
    Ausgabetext += "Inhalt des h1-Elements: " + h1_Inhalt + "!\n";
  } else {
    Ausgabetext += "Inhalt des h1-Elements konnte nicht ermittelt werden!\n";
  }*/

  /*var p_Inhalt = getContent("id", "Hinweisabsatz", null);
  if (p_Inhalt) {
    Ausgabetext += "Inhalt des p-Elements: " + p_Inhalt + "!\n";
  } else {
    Ausgabetext += "Inhalt des p-Elements konnte nicht ermittelt werden!\n";
  }*/

  /*if (NS4) {
    Verweis = getAttribute("name", "anchors", "Anker", "text");
  } else {
    Verweis = getContent("name", "Anker", 0);
  }
  if (Verweis) {
    Ausgabetext += "Verweistext: " + Verweis + "!\n";
  } else {
    Ausgabetext += "Verweistext konnte nicht ermittelt werden!\n";
  }*/

 /* var h1_align = getAttribute("tagname", "h1", 0, "align");
  if (h1_align) {
    Ausgabetext += "Ausrichtung des h1-Elements: " + h1_align + "!\n";
  } else {
    Ausgabetext += "Ausrichtung des h1-Elements konnte nicht ermittelt werden!\n";
  }*/

  /*var Bild_Hoehe= getAttribute("name", "auge", 0, "height");
  if (Bild_Hoehe) {
    Ausgabetext += "Bildhöhe: " + Bild_Hoehe + "px.\n";
  } else {
    Ausgabetext += "Die Bildhöhe konnte nicht ermittelt werden!\n";
  }*/

  /*var Bereich_id = getAttribute("id", "Bereich", null, "id");
  if (Bereich_id) {
    Ausgabetext += "id-Name des Bereichs: " + Bereich_id + "!\n";
  } else {
    Ausgabetext += "id-Name des Bereichs konnte nicht ermittelt werden!\n";
  }

  setContent("id", "Bereich", null, "Tests sind fertig!");

  alert(Ausgabetext);
}

*/
