function setSitemap(){
	if(document.getElementById("sitemap").style.display == "block"){	
		iv = setInterval("shrink()", 10);
	}else{
		iv = setInterval("grow()", 10);	
	}
}


function shrink(){
	height = getHeight() - 5;
	setHeight(height);
	
	if(height <= 0){
		clearInterval(iv);
		document.getElementById("sitemap").style.display = "none";
	}	
}

function grow(){
	height = getHeight() + 5;	
	setHeight(height);
	
	if(height >= 190){
		clearInterval(iv);
		document.getElementById("sitemap").style.display = "block";
	}
}

function setHeight(height){
	document.getElementById('navigation').getElementsByTagName('ul')[0].style.top = height + "px";
	document.getElementById('navigationCenter').style.height = height + "px";	
}

function getHeight(){
	var height = document.getElementById('navigationCenter').style.height;	
	if(height == "" || typeof(height) == "undefined"){
		height = "10px";
	}	
	height = parseInt(height);
	
	return height;		
}


function showNews(newsId){
	newsDiv = document.getElementById("news_" + newsId);
	newsDiv.style.height = "14px";
	newsDiv.style.width = "24px";
	newsDiv.style.left = "33px";
	newsDiv.style.display = "block";
	
	niv = setInterval("growNews()", 20);		
}

function hideNews(newsId){
	newsDiv = document.getElementById('news_' + newsId);
	newsDiv.style.display = "none";
	newsDiv.getElementsByTagName("div")[0].style.display = "none";
}

function growNews(){
	currentHeight = parseInt(newsDiv.style.height);
	currentWidth = parseInt(newsDiv.style.width);
	currentLeft = parseInt(newsDiv.style.left);

	height = currentHeight + 14;
	width = currentWidth + 24;
	left = currentLeft - 24;
	
	if(height < 266){
		newsDiv.style.height = height + "px";
		newsDiv.style.width = width + "px";
		newsDiv.style.left = left + "px";
	}else{
		newsDiv.style.height = "271px";
		newsDiv.style.width = "476px";
		newsDiv.style.left = "-406px";
		newsDiv.getElementsByTagName("div")[0].style.display = "block";
		clearInterval(niv);	
	}
}
