/* 
# CSS www.cedricwidmer.ch
# Alain Bellet 2006
*/

/* For popup menu */
var menu_delay = 0;

function show_menu(div_name){
	// hide all
	hide_all();
	// show specific menu
	show_hide(div_name,"visible");
	// clear delay
	clearTimeout(menu_delay);
}

function init_delay(){
	menu_delay = setTimeout('hide_all()',1000);
}

function reset_delay(){
	clearTimeout(menu_delay);
}

function hide_all(){
	show_hide("popPersonal","hidden");
	show_hide("popCorporate","hidden");
	show_hide("popxtra","hidden");
}

function thumb_action (the_popup,the_classsement,the_legend,state){
	if (the_popup == 1) the_id = "legendePersonal";
	if (the_popup == 2) the_id = "legendeCorporate";
	if (the_popup == 4) the_id = "legendextra";
	if (state == 0 ){
	// start delay
	init_delay();
	set_html(the_id,'&nbsp;');
	}else{
	set_html(the_id, the_legend);
	reset_delay();
	}
}

/* Global Functions */

// show-hide a div
function show_hide(the_div,vis){
	if (document.getElementById){
		document.getElementById(the_div).style.visibility = vis;
	}
	else if (document.all)
	{
		document.all[the_div].style.visibility = vis;
	}
}

// show-hide a div (with diplay
function set_display(the_div,vis){
	if (document.getElementById){
		document.getElementById(the_div).style.display = vis;
	}
	else if (document.all)
	{
		document.all[the_div].style.display = vis;
	}
}

// set html of a div
function set_html(the_div,html){
	if (document.getElementById){
		document.getElementById(the_div).innerHTML = html;
	}
	else if (document.all)
	{
		document.all[the_div].innerHTML = html;
	}
}
