//------------------------------------------------------------------------------------------
//
// Fonctions Javascript
//
//------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------
// Script run once the page has loaded
//------------------------------------------------------------------------------------------
function loadingScript(){
	new Effect.Appear('text', { duration: 1.0});
	hideNews();	
}


//------------------------------------------------------------------------------------------
// News hiding part
//------------------------------------------------------------------------------------------
var newsVisible = new Boolean();

function hideNews(){
	newsVisible = false;
	if($('other_news')!=null) new Effect.BlindUp('other_news');
}

function showAllNews(linkDomEl){
	
	if(!newsVisible) {
		new Effect.BlindDown('other_news');
		linkDomEl.innerHTML = "<< ";
		newsVisible = true;
	} else {
		
		new Effect.BlindUp('other_news');
		linkDomEl.innerHTML = " >>";
		newsVisible = false;
	}
}

//------------------------------------------------------------------------------------------
// Changement de couleur des onglets
//------------------------------------------------------------------------------------------
var elm_old=document.getElementById('m1');
function change_color(elm)
{
	elm_old.style.color='#006699';
	elm_old.style.backgroundColor='white';
	//elm_old.style.borderWidth='0px';
		
	
	elm.style.color='#ff9933';
	elm.style.backgroundColor='#F0F0FF';
	//elm.style.borderWidth='1px';



	elm_old=elm;
}
function reset_color()
{
	elm_old.style.backgroundColor='white';
	elm_old.style.color='#006699';
	//elm_old.style.borderWidth='0px';
}

//------------------------------------------------------------------------------------------
// Gestion des Flags lors du passage de la souris
//------------------------------------------------------------------------------------------
var uk = document.getElementById('uk').style;
var buk = document.getElementById('buk').style;
var fr = document.getElementById('fr').style;
var bfr = document.getElementById('bfr').style;
var es = document.getElementById('es').style;
var bes = document.getElementById('bes').style;
function disp_flag(fl)
{
	if(fl == 'buk')
	{
		to_hide = uk;
		to_disp = buk;
	}
	else if(fl == 'uk')
	{
		to_hide = buk;
		to_disp = uk;
	}
	
	if(fl == 'bfr')
	{
		to_hide = fr;
		to_disp = bfr;
	}
	else if(fl == 'fr')
	{
		to_hide = bfr;
		to_disp = fr;
	}
	
	if(fl == 'bes')
	{
		to_hide = es;
		to_disp = bes;
	}
	else if(fl == 'es')
	{
		to_hide = bes;
		to_disp = es;
	}
	
	to_hide.visibility = 'hidden';
	to_hide.position = 'absolute';
	
	to_disp.visibility = 'visible';
	to_disp.position = 'relative';
}

//------------------------------------------------------------------------------------------
//	Gestion de l'affichage des divs dans la partie admin
//------------------------------------------------------------------------------------------
function disp_div(elm)
{
	document.getElementById('to_aff').innerHTML = document.getElementById(elm).innerHTML;
}


//------------------------------------------------------------------------------------------
//	Vérification du formulaire de login et mot de passe de la partie membre
//------------------------------------------------------------------------------------------
function check_ident()
{
	if(document.getElementById('login').value != "" && document.getElementById('pass').value != "") return true;
	document.getElementById('msg').innerHTML="<img src='../../gwu_images/icon/error.png'/> Please type your password and your login.";
	return false;
}


