// Definition der Konstanten
RotationSpeed = 3;
ZoomSpeed = 0.1;
MoveSpeed = 1;


function IsNetscape() {
  var agt = navigator.userAgent.toLowerCase();
  return (agt.indexOf("msie") == -1);
}

function startSubanimation (idx){		//startet die Subanimation Nr.(idx) und setzt den Animationswert auf true
  frog.StartSubAnimation (idx, false);		
}

function resetAll(){					//Reset Scene - Rücksetzen auf die Ursprüngliche Positiom
  frog.ShowAll();
  startSubanimation(0);
  stopAnim();
}

function zoomIn(){						//Zoom In - Zoomt in die aktuelle Scene mit einer Schrittweite von ZoomInSpeed
  frog.Zoom = frog.Zoom + ZoomSpeed;
}

function zoomOut(){						//Zoom Out - Zoomt aus der aktuellen Scene mit einer Schrittweite von ZoomOutSpeed
  frog.Zoom = frog.Zoom - ZoomSpeed;
}

function turnRight() {					//Turn Left - Objektrotation Clockwise
  frog.Phi = frog.Phi - RotationSpeed;
}

function turnLeft() {					//Turn Left - Objektrotation counter Clockwise
  frog.Phi = frog.Phi + RotationSpeed;
}

function turnUp() {						//Turn Up - Objektrotation aufwärts
  frog.Psi = frog.Psi - RotationSpeed;
}

function turnDown() {					//Turn Down - Objektrotation abwärts
  frog.Psi = frog.Psi + RotationSpeed;
}

function moveUp() {						//Move Up - Objektbewegung aufwärts
	frog.PanY = frog.PanY + MoveSpeed;
}


function moveDown() {					//Move Down - Objektbewegung abwärts
	frog.PanY = frog.PanY - MoveSpeed;
}


function moveLeft() {					//Move Left - Objektbewegung links
	frog.PanX = frog.PanX - MoveSpeed;
}

function moveRight() {					//Move Right - Objektbewegung rechts
	frog.PanX = frog.PanX + MoveSpeed;
}

function moveUpLeft() {						//Move Up - Objektbewegung aufwärts + links
    moveUp(); moveLeft();
}

function moveDownLeft() {						//Move Up - Objektbewegung abwärts + links
    moveDown(); moveLeft();
}

function moveUpRight() {						//Move Up - Objektbewegung aufwärts + rechts
    moveUp(); moveRight();
}

function moveDownRight() {						//Move Up - Objektbewegung abwärts + rechts
    moveDown(); moveRight();
}

function onAnimationDone()				//Alert Window: Message, dass die Animation angehalten wurde
{
   alert("Animation angehalten");
}

function startAnim()					//Simple Animation Start - Start oder Wiederaufnahme an beliebigem Punkt
{
	frog.StartAnimation();
}

function haltAnim(){					//Halt Animation - Hält die Animation an
	frog.StopAnimation(); 
}

function stopAnim() {					// Der Player spring zur Startposition der Animation
  frog.StartSubAnimation(0, false); 	
  frog.StopAnimation(); 				
}
