/*
 * date:	2007-06-22
 * info:	DETA development for feature boxes
 */

function displayFeature() {
	document.getElementById('top_feature_container1').style.display = 'block';
	document.getElementById('top_feature_container2').style.display = 'none';
	document.getElementById('top_feature_container3').style.display = 'none';
	document.getElementById('top_feature_container4').style.display = 'none';
}

divs = ['top_feature_container1','top_feature_container2','top_feature_container3','top_feature_container4'];


function hideDivs() {
  for (var i=0; i<divs.length; i++)
    document.getElementById(divs[i]).style.display = 'none';

}


function toggleVisibility(obj){
	hideDivs();	
	var div = document.getElementById(obj);
	var isVisible = (( div.style.display == 'block' ) ? true : false );
	if( isVisible ){
		div.style.display = 'none'; 
	}else{
		div.style.display = 'block'; 
	}
	return true;
}


function randomFeature(){
	
	divs = ['top_feature_container1','top_feature_container2','top_feature_container3','top_feature_container4'];

  for (var i=0; i<divs.length; i++)
    document.getElementById(divs[i]).style.display = 'none';


	//var i = Math.round(3*Math.random());
	var i = Math.round(Math.random()*3);

	var obj = divs[i];
	
	var div = document.getElementById(obj);
	var isVisible = (( div.style.display == 'block' ) ? true : false );
	if( isVisible ){
		div.style.display = 'none'; 
	}else{
		div.style.display = 'block'; 
	}
	return true;
}