/*
	ACHTUNG:
	BEVOR DIESE DATEI EINGEBUNDEN WIRD MUSS die Datei jquery-1.3.2.js oder eine kompatible Version von jQuery
	EBENFALLS IN DAS DOKUMENT EINGEBUNDEN WERDEN!
*/



var oldScreenWidth = 0;
var oldScreenHeight = 0;
var refPicNum = 0;
var refPicX = 0;
var refPicY = 0;
var firstresize = 0;
var contentBoxHeight = "200px";
var contentBoxWidth = 530;

var boxAbstandBrowserFenster = 15;


/*
	Das Array bgs:
	Beinhaltet fuer jede Seite Informationen, welche Bilder verwendet werden
	und an welcher Stelle die Inhaltsbox angezeigt wird.
*/
//var bgs = new Array();


// Hintergrundbild automatisch an den Abzeigebereich des Browsers anpassen.
function autoFitBackgroundImage() {
	var box = $("#layer1");
	var screenHeight = 502;
	var screenWidth = 966;
	//alert(i);
	/*
if(navigator.userAgent.indexOf("irefox") > -1) {
		screenWidth = window.innerWidth;
		screenHeight = window.innerHeight;
	} else {
		screenWidth = $(window).width();
		screenHeight = $(window).height();	
	}
*/
	$("#img1").css('display', 'inline');
	$("#img2").css('display', 'inline');
	
	$("#main-box").css('width', screenWidth+'px');
	$("#main-box").css('height', screenHeight+'px');
	
	
	$("#skipbutton").css('display', 'inline');
	$("#skipbutton").css('top', (screenHeight-60)+'px');
	$("#skipbutton").css('left', (screenWidth-140)+'px');
	
	//alert($(window).height());
	$("#layer1").css('width', screenWidth+40+'px');
	$("#layer1").css('height', screenHeight+'px');
	
	$("#layer2").css('width', screenWidth+40+'px');
	$("#layer2").css('height', screenHeight+'px');
	
	$("#layer3").css('width', screenWidth+40+'px');
	$("#layer3").css('height', screenHeight+'px');
	
	
	//frpAnimateLayer("layer1");
	window.setTimeout("frpAnimateLayer(\"layer1\")",2000);
	window.setTimeout("frpFader(\"btob\")",5000);
	window.setTimeout("frpAnimateLayer(\"layer2\")",9000);
	window.setTimeout("frpFader(\"btoc\")",12000);
	window.setTimeout("frpFaderOut(\"animation\")",16000);
	
	
	
	
}

function frpController(){
	/*
frpAnimateLayer("layer1");
	window.setTimeout("frpAnimateLayer(\"layer2\")",6000);
	window.setTimeout("frpFader(\"btob\")",100);
	
	window.setTimeout("frpAnimateLayer(\"layer3\")",12000);
*/
	
}

function frpAnimateLayer(box){
	//var box = "layer1";
	var screenHeight = 0;
	var screenWidth = 0;
	//alert(i);
	if(navigator.userAgent.indexOf("irefox") > -1) {
		screenWidth = window.innerWidth;
		screenHeight = window.innerHeight;
	} else {
		screenWidth = $(window).width();
		screenHeight = $(window).height();	
	}

	$("#"+box+"").animate({"left": "+="+(screenWidth+40)+"px"}, 3000);
}

function frpFader(element){
	$("#"+element+"").fadeIn(2000);
}

function frpFaderOut(element){
	$("#"+element+"").fadeOut(2000);
}

 
function weiterleitung(seite) { 
	window.setTimeout("frptarget(\""+seite+"\")",17500);
//	window.open(seite,"_top");
} 

function frptarget(seite){
	window.open(seite,"_top");
}

