 /****************************************
Utilitaires javascript

Création: 20 avril 2004
Dernière modification: 24 mai 2004
Programmeur: Arnaud Charlier
****************************************/

/* roll-over image */

	/*Consignes:
		Les images doivent avoir le même nom avecle suffixe
		- "_over" pour l'image affichée au survol
		- "_off" pour l'image affichée à l'état fermé
		- "_down" pour l'image affichée à l'état appuyé
		Les images doivent se trouver dans le même répertoire
	
*/
var ga_hidded;


function switchOver(ao_image)
{
var lo_image=ao_image.name;
var ls_src=document.images[lo_image].src;
var ls_motif=/off|down/;
ls_src=ls_src.replace(ls_motif,"over");
document.images[lo_image].src=ls_src;
//text_status(document.images[lo_image].alt);
}

function switchOff(ao_image)
{
var lo_image=ao_image.name;
var ls_src=document.images[lo_image].src;
ls_src=ls_src.replace("over","off");
document.images[lo_image].src=ls_src;
default_status();
}

function switchDown(ao_image)
{
var lo_image=ao_image.name;
var ls_src=document.images[lo_image].src;
ls_src=ls_src.replace("over","down");
document.images[lo_image].src=ls_src;
}


/* Window Status */

function text_status(as_text)
{
window.status=as_text;
}

function default_status(){
window.defaultStatus="MULTITEL, Your R&D Partner";
}

/*preload roll_over*/

function preload(aa_image)
{
	for(i=0;i<aa_image.length;i++)
		{
			new Image().src="http://www2.multitel.be/image/images/"+aa_image[i];
	}
}

/*init de test preload*/
function init()
{
	la_over=new Array();
	la_over.push("old_lang_en_down.gif");
	la_over.push("old_lang_en_over.gif");
	la_over.push("old_lang_fr_down.gif");
	la_over.push("old_lang_fr_over.gif");
	la_over.push("old_print_over.gif");
	la_over.push("close_over.gif");
	preload(la_over);
	ga_hidded=hidde();
	display(ga_hidded,"init");
	default_status();
}
	

function hidde()
{
	la_hidded=new Array();
	la_hidded.push("sous_practical");
	la_hidded.push("sous_rd");
	la_hidded.push("sous_service");
	return la_hidded;
}

function display(aa_hidded,ao_div)
{
	for (i=0;i<aa_hidded.length;i++)
		{	
			document.getElementById(aa_hidded[i]).style.display="none";
		}
	
	if (ao_div!="init")
		{	
			if (document.getElementById(ao_div).style.display=="block")
				{
					document.getElementById(ao_div).style.display="none";
				}
			else{
					document.getElementById(ao_div).style.display="block";
			 	}
		}
	
}


function open_sous(ao_div)
{
	document.getElementById(ao_div).style.display="block";
}

/* Sélection de l'option choisie dans des balises select 
faire passer l'indice de l'élément et la position de l'option
*/
function select_option (as_select,an_option)
{
var	menu=document.forms[0].elements[as_select];
	menu.options[an_option].selected=true;	
}	


/* Pop pour les projets */
function pop_up(ls_url)
	{
		if ((screen.width>=1024) && (screen.height>=768)){
		window.open(ls_url,"Projet","width=800,height=600,status=no,resizable=yes,menubar=yes,scrollbars=yes");
		}
		else
		{
		window.open(ls_url,"Projet","width=800,height=450,status=no,resizable=yes,menubar=yes,scrollbars=yes");
		}
	}
	
function window_position()
	{
		window.moveTo(10,10);
		window.focus();	
	}
	
function locations(url)
{
	window.location.href=url;
}

function first_focus(lo_form)
{	
	lo_form.focus();
	lo_form.select();
	
}

function display_news(ao_id )
{

	$element=document.getElementById(ao_id);
	
	if ($element.style.display=="none")
		{	
			$element.style.display="block";
		}
	else{

		$element.style.display="none";

	}

}
