// JavaScript Document

var contTimer = "";

var current = "featured_albums";
function showComment() {
	document.getElementById("featured_albums").style.opacity = "1.0";
	document.getElementById("featured_albums").style.filter = "alpha(opacity=100)";


	fadeContOut(current, "my_comment_box");
	current = "my_comment_box";
}

function showComments() {
	document.getElementById("featured_albums").style.opacity = "1.0";
	document.getElementById("featured_albums").style.filter = "alpha(opacity=100)";


	fadeContOut(current, "comment_box");
	current = "comment_box";
}

function fadeContOut(id, inid) {
	clearTimeout(contTimer);
	
	var obj = document.getElementById(id);
	var current = parseInt(obj.style.opacity*100);
	if (current > 0) {
		var step = 10;
		if (current - step < 0) {
			current = 0;	
		}
		else {
			current -= step;
		}
		obj.style.opacity = current/100;
		obj.style.filter = "alpha(opacity="+current+")";
		
		contTimer = setTimeout("fadeContOut('"+id+"', '"+inid+"')", 20);
	}
	else {
		document.getElementById(id).style.display = "none";
		document.getElementById(inid).style.display = "block";
		fadeContIn(inid);
	} 	
}


function fadeContIn(id) {
	clearTimeout(contTimer);
	
	var obj = document.getElementById(id);
	var current = parseInt(obj.style.opacity*100);
	
	if (current < 100) {
		var step = 10;
		if (current + step > 100) {
			current = 100;	
		}
		else {
			current += step;
		}
		obj.style.opacity = current/100;
		obj.style.filter = "alpha(opacity="+current+")";
		
		contTimer = setTimeout("fadeContIn('"+id+"')", 20);
	}
	else {
		
	} 	
	
}
