var mouseX = 0;
var mouseY = 0;
var randLinks = 0;

$(document).ready(function(){
	$().mousemove(function(e) {
			mouseX = e.pageX;
			mouseY = e.pageY;
			randLinks = parseInt(document.getElementById("stage").offsetLeft)
			//$("#mausinfo").css("left",mouseX+"px");
			//$("#mausinfo").css("top",mouseY+"px");
			//$("#mausinfo p").text(parseInt(document.getElementById("stage").offsetLeft));
		});
	window.setInterval("startAnimTeaser()", 4000);
	//startAnimTeaser();	
});

$(function() {
    $('a#anfahrttext').lightBox();
    $('a#anfahrtbild').lightBox();
    $('#gallery a').lightBox();
    $('#innen a').lightBox();
    $('#aussen a').lightBox();
    $('#gwhs a').lightBox();
    $('#mai a').lightBox();
    $('#fasching a').lightBox();
    $('#oktober06 a').lightBox();
    $('#oktober05 a').lightBox();
    $('#steps a').lightBox();
    $('#fruehshoppen a').lightBox();
    $('#weihnachtsmarkt a').lightBox();
    $('a.klassikerLink').lightBox();
    $('a.klassikerLinkNavi').lightBox();
});

/*
*	Bildwechsel bei Mouseover/... 
*/
function imgChange(image,source){
	image.src= source;
}

var timer;

function tischinfo(layernr,job) {
	if(job == 1) {
		$("#ti"+layernr).css("display","block");
		$("#ti"+layernr).css("top",(mouseY-160)+"px");
		$("#ti"+layernr).css("left",(mouseX-randLinks-80)+"px");		
		timer = window.setTimeout("tischinfo("+layernr+","+job+")", 100);
	}
	if(job == 0) {
		window.clearTimeout(timer);
		$("#ti"+layernr).css("display","none");
	}
}

wichLayer = 1;

function startAnimTeaser() {
	$("#angebot"+wichLayer).fadeOut("slow",function(){
		if(wichLayer == 3) {
			wichLayer = 1;
		} 
		else {
			wichLayer++;
		}
		$("#angebot"+(wichLayer)).fadeIn("slow");
	});
} 


