var onloadHooks = [];
	
onloadHooks.push(function(){ 
	startIntro();
});

window.onload = function()
{
	// Get onload scripts
	var i = 0;
	for(i = 0; i < onloadHooks.length; i++)
	{
		onloadHooks[i]();
	}
	
}



var futura = { src: 'http://www.corus-centermanagement.de/wp-content/themes/corus/fonts/dinlight.swf' };
run_sIFR();


function run_sIFR() {
	
	sIFR.activate(futura);
	sIFR.replace(futura, {
		  selector: 'h3',
		  css: '.sIFR-root { background-color: #FFFFFF; color: #005187;}',
		  // kipaka 2010-08-06 (überlagerte Überschriften auf Popups)
		  wmode: 'transparent'
		});
	sIFR.replace(futura, {
		  selector: '.replacedepth_0',
		// kipaka 2010-08-06 (überlagerte Überschriften auf Popups)
		  wmode: 'transparent',
		  css: ['.sIFR-root a { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:hover { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:visited { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}'
				]
		  
		});
	sIFR.replace(futura, {
		  selector: '.replacedepth_1',
		  wmode: 'transparent',
		  css: ['.sIFR-root a { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:hover { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:visited { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}'
				]
		});
	sIFR.replace(futura, {
		  selector: '.replacedepth_2',
		  wmode: 'transparent',
		  css: ['.sIFR-root a { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:hover { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}',
		        '.sIFR-root a:visited { background-color: #FFFFFF; color: #707070; cursor: pointer; text-decoration: none;}'
				]
		});
		
}

// Intro-Animation

var home = 'http://www.corus-centermanagement.de/wp-content/themes/corus/';
var iIntro = 0;
var iTimeout = 50;

function setOpacity(current,lay, negative)
{
	try
	{
		img = document.getElementById(lay);
		
		if(current<0)
		{
			current = 0;
		}
					
		img.style.filter="alpha(opacity=" + current + ")";
		img.style.MozOpacity = current/100 + '';
		img.style.opacity = current/100 + '';
		
		if(negative)
		{
			current -= 20;
		}
		else
		{
			current+=10;
		}
		
		if(current<198 && current>=0)
		{
			setTimeout('setOpacity(' + current + ',\'' + lay + '\','+negative + ')',50);
		}
	} 
	catch(e)
	{
	}		
}

function startIntro()
{
	if(document.getElementById("intro0_0"))
	{
		doIntro(0);
	}
}

function doIntro(iStep)
{
	if(iStep == 0)
	{
		
		document.getElementById("intro0_0").style.left = "0px";
		document.getElementById("intro0_1").style.left = "-20px";
		document.getElementById("intro0_2").style.left = "0px";
		document.getElementById("intro0_2").style.top = "65px";
	}
	if(iStep == 1)
	{
		document.getElementById("intro0_0").style.left = "80px";
		document.getElementById("intro0_1").style.left = "15px";
		document.getElementById("intro0_2").style.left = "165px";
		document.getElementById("intro0_2").style.top = "55px";
	}
	if(iStep == 2)
	{
		document.getElementById("intro0_0").style.left = "150px";
		document.getElementById("intro0_1").style.left = "25px";
		document.getElementById("intro0_2").style.left = "90px";
		document.getElementById("intro0_2").style.top = "65px";
	}
	if(iStep == 3)
	{
		document.getElementById("intro0_0").style.left = "150px";
		document.getElementById("intro0_1").style.left = "0px";
		document.getElementById("intro0_2").style.left = "90px";
		document.getElementById("intro0_2").style.top = "65px";
	}
	if(iStep == 4)
	{
		document.getElementById("intro0_0").style.left = "150px";
		document.getElementById("intro0_1").style.left = "0px";
		document.getElementById("intro0_2").style.left = "90px";
		document.getElementById("intro0_2").style.top = "65px";
	}
	if(iStep == 5)
	{
		document.getElementById("intro0_0").style.left = "150px";
		document.getElementById("intro0_1").style.left = "0px";
		document.getElementById("intro0_1").style.top = "30px";
		document.getElementById("intro0_2").style.left = "90px";
		document.getElementById("intro0_2").style.top = "75px";
	}
	
	var count = 1000;
	for(var i=0;i<3;i++)
	{
		//iStep = i;
		if(document.getElementById("intro"))
		{
			setTimeout('doStep('+iStep+',' + i + ')',count);
			
			count += 1000;
		}
	}
}

function doStep(iStep,iSubStep)
{
	var intro = document.getElementById("intro0_" + iSubStep);
	//intro.style.height = "300px";
	
	intro.src = home + "images/intro" + iStep + "_" + iSubStep + ".gif";
	setOpacity(1,'intro0_' + iSubStep,false);
	
	if(iSubStep == 2 && iStep != 5)
	{
		setTimeout('blendOut(' + iStep + ')',1000);
	}
}

function blendOut(iStep)
{
	var iNext = iStep + 1;
	
	setOpacity(200,'intro0_0',true);
	setOpacity(200,'intro0_1',true);
	setOpacity(200,'intro0_2',true);

	if(iNext <= 6)
	{
		setTimeout('doIntro(' + iNext + ')',1000);	
	}
}
