
function GetId(Ctl) {

	return document.getElementById(Ctl)
}

function isEmail(obj) {
       if (obj.value.indexOf(" ") + "" == "-1"
       && obj.value.indexOf("@") + "" != "-1"
       && (obj.value.lastIndexOf(".") > obj.value.indexOf("@"))
       && obj.value != "") return true;
       else return false;
}

// -------------------------------------------------------------------------------------
// Début script Agenda

function BlinkTxt() {
	if(document.getElementById && document.all){
		obj = document.getElementsByTagName("blink");
		for (var i=0; i<obj.length; i++)
		if (obj[i].style.visibility=="hidden") {
			obj[i].style.visibility="visible";
		} else {
			obj[i].style.visibility="hidden";
		}
		setTimeout('BlinkTxt()',750);
	}
}

function DateValidation(Ctrl) {	
	if (!isDate(Ctrl.value)) { 
		alert('Attention! La date saisie n\'est pas conforme\nau format JJ/MM/AAAA !') 
		Ctrl.value ='';
		Ctrl.focus();
	} else {
		Calendar_Form.UserDef.value = "true"
	}
}

function PeriodChange(Ctrl) {
	if (Ctrl.selectedIndex != 5) {Calendar_Form.UserDef.value = "" }
	Calendar_Form.submit();
}

// Fin script Agenda
// -------------------------------------------------------------------------------------


// -------------------------------------------------------------------------------------
// Début script Carte interactive
// -------------------------------------------------------------------------------------

function showframe(){
	GetId("toto").style.display="";
}

function showframeintro(){
	GetId("intro").style.display="none";
}

function hideframe(){
	GetId("toto").style.display="none";
	GetId("intro").style.display="";
}

function showinfos(id,like){
	like = (typeof(like)!='undefined' && like == true) ? true : false;
	GetId("annuaire_infos").src="annuaire_infos.asp?Id="+escape(id)+"&Page=1&Like=" + like;				
}

function clearinfos(){
	GetId("annuaire_infos").src="annuaire_infos.asp";				
}

//------------------------------------------------------------------------------------
// Script Anti-flash
//------------------------------------------------------------------------------------
window.onload = function()
{	
	elems=document.getElementsByTagName("span");
		for(i=0; i<elems.length;i++)
		{
			var elem=elems[i];
			if(elem.className=="clickfix")
			{
				elem.outerHTML = elem.innerHTML;
				elem.style.display = "";
			}
		}

}

// -------------------------------------------------------------------------------------
// Menus des pages de lois
// -------------------------------------------------------------------------------------

function closeall()
	{
		for (i=0;i< 9; i++)
		{
			GetId("tab"+i).style.display="none";
		}
	}
	

function sw(id)
		{
			if (GetId("tab"+id).style.display=="none")
			{
				closeall();
				GetId("tab"+id).style.display="";				
			} 
			else 
			{
				GetId("tab"+id).style.display="none";				
			}
		}
function survolbtn(id)
		{
			GetId("btn"+id).style.backgroundColor="#F8F3E6";
		}
function sortiebtn(id)
		{

			GetId("btn"+id).style.backgroundColor="#FFFFFD";
		}
function survol(id)
		{
		
			if (menu_select==id) return;
			GetId("art"+id).style.backgroundColor="#F8F3E6";
			//GetId("lien"+id).style.fontWeight="bold";
		}
function sortie(id)
		{

			if (menu_select==id) return;
			GetId("art"+id).style.backgroundColor="#FFFFFD";
			//GetId("lien"+id).style.fontWeight="normal";
		}
var menu_select = null;
function clic(id)
		{
			if (menu_select!=null)
			{
				GetId("art"+menu_select).style.backgroundColor="#FFFFFD";
				GetId("lien"+menu_select).style.fontWeight="normal";
				GetId("tab"+menu_select).style.display="none"
			}
			if (menu_select==id) { menu_select=null; return; }
		
			menu_select = id;
			GetId("art"+id).style.backgroundColor="#F8F3E6";
			GetId("lien"+id).style.fontWeight="bold";
			GetId("tab"+id).style.display="";
			//sw(id);
		}


		