addLoadListener(homeAnimation);
addLoadListener(ieHover);

function ieHover() {
	var csList = document.getElementById('blog_list');
	var csListItems = csList.getElementsByTagName('li');
	for (i=0; i < csListItems.length; i++) {
		csListItems[i].onmouseover = function() {
			this.className = 'hover';
		};
		
		csListItems[i].onmouseout = function() {
			this.className = '';
		};
		
		csListItems[i].onclick = function() {
			window.location = this.getElementsByTagName('a')[0].href;
		};
	}
}

function homeAnimation() {
	setTimeout('showYou()', 500);
}

function showYou() {
	var showYou = new YAHOO.util.Anim('home_you', { opacity: {to: 1}}, 1, YAHOO.util.Easing.easeIn);
	showYou.onComplete.subscribe(initCrystal);
	showYou.animate();
}

function initCrystal() {
	setTimeout('showCrystal()', 1000);
}

function showCrystal() {
	var showCrystal = new YAHOO.util.Anim('crystal_clear', { opacity: {to: 1}}, 1, YAHOO.util.Easing.easeIn);
	showCrystal.onComplete.subscribe(initHideText);
	showCrystal.animate();
}

function initHideText() {
	setTimeout('hideText()', 2000);
}

function hideText() {
	var youText = new YAHOO.util.Anim('home_you', { opacity: {to: 0}}, 1, YAHOO.util.Easing.easeIn);
	var crystalText = new YAHOO.util.Anim('crystal_clear', { opacity: {to: 0}}, 1, YAHOO.util.Easing.easeIn);
	youText.onComplete.subscribe(initGrowPanels);
	youText.animate();
	crystalText.animate();
}

function initGrowPanels() {
	setTimeout('growPanels()', 500);
}

function growPanels() {
	var growPanel1 = new YAHOO.util.Anim('band_bg', { height: {to: 365}, top: {to: 0}}, 1, YAHOO.util.Easing.easeIn);
	//var growPanel2 = new YAHOO.util.Anim('band_bg_btm', { height: {to: 183}}, 1, YAHOO.util.Easing.easeIn);
	growPanel1.onComplete.subscribe(showTagline);
	growPanel1.animate();
	//growPanel2.animate();
}

function initTagline() {
	setTimeout('showTagline()', 1000);
}

function showTagline() {
	var showTagline = new YAHOO.util.Anim('tagline', { opacity: {to: 1}}, 1, YAHOO.util.Easing.easeIn);
	showTagline.onComplete.subscribe(initBlogPanel);
	showTagline.animate();
}

function initBlogPanel() {
	setTimeout('blogPanel()', 1000);
}

function blogPanel() {
	var slideBlogPanel = new YAHOO.util.Anim('blog_panel', { left: {to: 0}}, .5, YAHOO.util.Easing.easeOut);
	//slideBlogPanel.onComplete.subscribe(removeElement);
	slideBlogPanel.animate();
}