// JavaScript Document

onload = function(){
	initHeight();
}
onresize = function(){
	initHeight();
}


window.addEvent('domready', function() {	
	if($('logo1') != null){
		initLogo();
	}	
});



/*****************************
	Logo motion frontpage
******************************/

var aItems = new Array('logo1', 'logo2', 'logo3', 'logo4', 'logo5', 'logo6', 'logo7', 'logo8');
var iCurrent = 0;
var sInterval;

function showLogo() {

	var myEffects = new Fx.Styles(aItems[iCurrent], {duration: 1000});
	
	//height from 10 to 100 and width from 900 to 300
	myEffects.start({
		'opacity': [0,1]
	});

	if(iCurrent >= aItems.length -1) {
		clearInterval(sInterval);	
	} else {
		iCurrent++;
	}

}

function initLogo(){
	sInterval = setInterval('showLogo()', 110);
}


/*****************************
	Margins & Swooshes
******************************/

function initHeight(){
        
        var windowHeight = document.documentElement.clientHeight;
		var containerHeight = document.getElementById('container').offsetHeight;
		
		if(windowHeight <= 650) {
			document.getElementById('topMargin').style.display = "none";
		} else {
			document.getElementById('topMargin').style.display = "block";
		}


}
