function constr_ligne_page_dep(type, num_ligne)
{
	var infos_dep = dep[num_ligne];
	var eclate_infos = infos_dep.split(";");
	var nom_actuel = eclate_infos[0] ;
	var existe = eclate_infos[1] ;
	var nom_ancien = eclate_infos[2] ;
	var nom_fichier = eclate_infos[3] ;
	var ligne_code = "";
	if (type == 'actuel')
	{
		ligne_code = "  <option value=" + num_ligne + ">" + nom_actuel + "</option>\n";
	}
	else
	{
		if (existe == "OK")
		{
			ligne_code = "  <option value=" + num_ligne + ">" + nom_ancien + "</option>\n";
		}
	}
	
	return(ligne_code);						
}
function constr_page_dep(type)
{
	var fich ="";
	// Tableau des départements
	declare_departements();
	for (loc_i = 1; loc_i < dep.length; loc_i++)
	{
		fich += constr_ligne_page_dep(type, loc_i);
	}
	// Ecriture
	document.write(fich);
}
function VerifFormDep(form)
{
	var num_dep = form.num_dep_actuel.value;
	var infos_dep = dep[num_dep];
	var eclate_infos = infos_dep.split(";");
	var nom_actuel = eclate_infos[0] ;
	var existe = eclate_infos[1] ;
	
	if (existe == "OK")
	{
		constr_page();
		//return true;
	}
	else
	{
		var message = "Le département " + nom_actuel + " n'appartenait pas à la France en 1832";
		alert(message);
		window.location.href = "#dep_" + num_dep;
		return false;
	}
}

function constr_page()
{
	var page_html = "";
	var commande = "";
	
	page_html += "departement.php?num_dep_actuel=" + num_dep;
	
	commande += "window.open('" + page_html + "'";										  
	commande += ",'_blank','scrollbars=1,resizable=1,";
	commande += "menuBar=0,left=0,top=0,width=" + screen.availWidth;
	commande += ",height=" + (screen.availHeight - 40)+ "');";
	
	eval(commande);
}

