//Start bei DOM-Ready
$(document).ready(function(){
    if(redaktion != "true"){        
        //get size first     
        jQuery.fn.supersized.options = {
            //startwidth: $("#supersize img").width(),  
			      //startheight: $("#supersize img").height(),
            startwidth: 1024,  
            startheight: 1000,
            minsize: .50,
            slideshow: 1,
            slideinterval: 5000  
        };
        $("#supersize").supersized();
        $("#accordion").accordion({
            animated: false 
        });    
    }
    $("div.box p:first img").addClass('test');
});

//Globale Variablen
var globalVideo = "";
var globalBreite = "";
var globalHoehe = "";
var globalTitel = "";

//Funktion fuer Scrollwerte (Array mit x,y- werten)
//Corecode - quirksmode.org
function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 
		//Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {
		//alle anderen Internet Explorer
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
//Funktion fuer Seitengroesse (Array mit page width, height und window width, height)
//Corecode - quirksmode.org
function getPageSize(){
	var xScroll, yScroll;	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { 
		//Explorer Mac...wuerde auch in Explorer 6 Strict, Mozilla und Safari funktionieren
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	
		//alle Browser ausser Internet Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { 
		//Internet Explorer 6  im Strict Modus
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { 
		//andere Internet Explorer
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}		
	//fuer kleine Seiten mit einer kleineren Hoehe als der sichtbare Bereich
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	//fuer kleine Seiten mit einer totalen Breite kleiner als der sichtbare Bereich
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
//Funktionen fuer Flashvideos auf einer Extraebene
function placeVideo(breite,hoehe){
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	if(breite < 430){
		breite = 430;
	}
	document.getElementById("video").style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - hoehe) / 2) + 'px');
	document.getElementById("video").style.left = (((arrayPageSize[0] - breite) / 2) + 'px');
	//setTimeout("placeVideo(" + breite + "," + hoehe + ")", 50);
}
function openVideo(video,breite,hoehe,titel){
	globalVideo = video;
	globalBreite = breite;
	globalHoehe = hoehe;	
	globalTitel = titel;
	initVideo(video,breite,hoehe,titel);
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	document.getElementById("video").style.display = "block";
	document.getElementById("abdeckung").style.height = (arrayPageSize[1] + 'px');
	document.getElementById("abdeckung").style.width = ((arrayPageSize[0]-16) + 'px');
	document.getElementById("abdeckung").style.display = "block";	
	placeVideo(breite,hoehe);
}
function closeVideo(){
	document.getElementById("video").style.display = "none";
	document.getElementById("abdeckung").style.display = "none";
	miniEmpfehlen();
}
