


function PostSelect(liste){
	NbCol1 = document.forms[liste].elements.cat.length;
	document.forms[liste].elements.cat.name = 'cat[]';
	document.forms[liste].submit();
	
	NbCol2 = document.forms[liste].elements.ss_cat.length;
	document.forms[liste].elements.ss_cat.name = 'ss_cat[]';
	document.forms[liste].submit();
}

function PostSelect2(liste){
	NbCol1 = document.forms[liste].elements.ss_cat.length;
	document.forms[liste].elements.ss_cat.name = 'ss_cat[]';
	document.forms[liste].submit();
}

function PostSelect3(liste){
	NbCol1 = document.forms[liste].elements.cat.length;
	document.forms[liste].elements.cat.name = 'cat[]';
	document.forms[liste].submit();
}

function listelogo(){
	window.open('listelogo.php', 'listelogo', 'toolbar=0, location=0, directories=0, status=1, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=400, height=400, left=0, top=0');
}

function aff_contact(contact){
	var left_size = window.screen.width/4;
	var top_size = window.screen.height/4;

	window.open('aff_contact.php?contact='+ contact, 'contact', 'toolbar=0, location=0, directories=0, status=1, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=400, height=200, left='+ left_size, 'top='+ top_size);
}

function choix(id, src){
	window.opener.document.getElementById('idlogo').value = id;
	window.opener.document.getElementById('logo').src= src;
	
	this.window.close();
}

function clean_field(id){
	if(window.document.getElementById(id).value == 'Identifiant'){
		window.document.getElementById(id).value = '';
	}
	if(window.document.getElementById(id).value == 'eeeeeeeee'){
		window.document.getElementById(id).value = '';
	}
}

function conf(){
	var conf = false;
	conf = confirm("Confirmer la suppression");
	return conf;
}

function onglet_select(id){
	if(id!=0)
		window.document.getElementById(id).style.backgroundColor = '#DDD';
}

function ajout_logo(){
	window.opener.location.replace("utilisateur.php?onglet=27");
	this.window.close();
}

function select(id){
	if (window.document.getElementById(id).style.border == '3px solid red'){
		window.document.getElementById(id).style.border = '0px';
		window.document.getElementById("h"+id).value = 0;
	}
	else{
		window.document.getElementById(id).style.border = '3px solid red';
		window.document.getElementById("h"+id).value = 1;
	}
}

function show_div(id){
	if(window.document.getElementById(id).style.display == 'block'){
		window.document.getElementById(id).style.display = 'none';
	}
	else{
		window.document.getElementById(id).style.display = 'block';
	}
}

function verif_password(){
	var form = false;
	var message = '';

	if(window.document.getElementById('pass_actu').value == ''){
		window.document.getElementById('pass_actu').style.border = '1px solid red';
		message = 'Veuillez donner le mot de passe actuel\n';
	}
	else{
		window.document.getElementById('pass_actu').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('pass_new1').value == ''){
		window.document.getElementById('pass_new1').style.border = '1px solid red';
		message = message + "Veuillez donner un nouveau mot de passe\n";
		window.document.getElementById('pass_new2').style.border = '1px solid #255597';
	}
	else{
		window.document.getElementById('pass_new1').style.border = '1px solid #255597';
	
		if(window.document.getElementById('pass_new2').value == ''){
			window.document.getElementById('pass_new2').style.border = '1px solid red';
			message = message + "Veuillez confirmer le nouveau mot de passe\n";
		}
		else{
			window.document.getElementById('pass_new2').style.border = '1px solid #255597';
			if(window.document.getElementById('pass_new2').value != window.document.getElementById('pass_new1').value){
				window.document.getElementById('pass_new2').style.border = '1px solid red';
				window.document.getElementById('pass_new2').value = '';
				message = message + "La confirmation du mot de passe est incorrecte";

			}
		}
	}
	
	if(message != ''){
		alert(message);
		return form;
	}
	else{
		form = true;
	}
	
	return form;
}

function verif_entreprise(){
	var form = false;
	var message = '';
	
	if(window.document.getElementById('nom').value == ''){
		window.document.getElementById('nom').style.border = '1px solid red';
		message = "Veuillez donner le nom de l'entreprise\n";
	}
	else{
		window.document.getElementById('nom').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('adresse').value == ''){
		window.document.getElementById('adresse').style.border = '1px solid red';
		message = message + "Veuillez donner l'adresse de l'entreprise\n";
	}
	else{
		window.document.getElementById('adresse').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('cp').value == ''){
		window.document.getElementById('cp').style.border = '1px solid red';
		message = message + "Veuillez donner le code postal de l'entreprise\n";
	}
	else{
		window.document.getElementById('cp').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('ville').value == ''){
		window.document.getElementById('ville').style.border = '1px solid red';
		message = message + "Veuillez donner la ville de l'entreprise\n";
	}
	else{
		window.document.getElementById('ville').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('tel').value == ''){
		window.document.getElementById('tel').style.border = '1px solid red';
		message = message + "Veuillez donner le numéro de téléphone de l'entreprise\n";
	}
	else{
		window.document.getElementById('tel').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('login').value == ''){
		window.document.getElementById('login').style.border = '1px solid red';
		message = message + "Veuillez donner un login\n";
	}
	else{
		window.document.getElementById('login').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('password').value == ''){
		window.document.getElementById('password').style.border = '1px solid red';
		message = message + "Veuillez donner un mot de passe\n";
		window.document.getElementById('password2').style.border = '1px solid #255597';
	}
	else{
		window.document.getElementById('password').style.border = '1px solid #255597';
	
		if(window.document.getElementById('password2').value == ''){
			window.document.getElementById('password2').style.border = '1px solid red';
			message = message + "Veuillez confirmer le mot de passe\n";
		}
		else{
			window.document.getElementById('password2').style.border = '1px solid #255597';
			if(window.document.getElementById('password2').value != window.document.getElementById('password').value){
				window.document.getElementById('password2').style.border = '1px solid red';
				window.document.getElementById('password2').value = '';
				message = message + "La confirmation du mot de passe est incorrecte";
			}
		}
	}
	
	if(window.document.getElementById('c_nom').value == ''){
		window.document.getElementById('c_nom').style.border = '1px solid red';
		message = message + "Veuillez donner votre nom\n";
	}
	else{
		window.document.getElementById('c_nom').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('c_prenom').value == ''){
		window.document.getElementById('c_prenom').style.border = '1px solid red';
		message = message + "Veuillez donner votre prénom\n";
	}
	else{
		window.document.getElementById('c_prenom').style.border = '1px solid #255597';
	}
	if(window.document.getElementById('c_mail').value == ''){
		window.document.getElementById('c_mail').style.border = '1px solid red';
		message = message + "Veuillez donner votre adresse email perso\n";
	}
	else{
		window.document.getElementById('c_mail').style.border = '1px solid #255597';
	}
	
	if(message != ''){
		alert(message);
		return form;
	}
	else{
		form = true;
	}
	
	return form;
}

/* newsticker actualités */

function startTicker()
{



theCurrentStory     = -1;
theCurrentLength    = 0;

if (document.getElementById) {
    theAnchorObject     = document.getElementById("tickerAnchor");
runTheTicker();
}
else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
}
}

function runTheTicker()
{
var myTimeout;

if(theCurrentLength == 0)
{
theCurrentStory++;
theCurrentStory      = theCurrentStory % theItemCount;
theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
theTargetLink        = theSiteLinks[theCurrentStory];
if (theTargetLink != "")
{
	
	theStorySummary=theStorySummary+"<br><DIV class='actu_menu_droite'><ul><h5><li><a href='"+theTargetLink+"'>Lire l'article...</a></li></h5></ul></DIV>";
	
}
}

theAnchorObject.innerHTML = theStorySummary.substring(0,theCurrentLength) + whatWidget();

if(theCurrentLength != theStorySummary.length)
{
theCurrentLength++;
myTimeout = theCharacterTimeout;
}
else
{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}

setTimeout("runTheTicker()", myTimeout);
}

function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
return theWidgetNone;
}

if((theCurrentLength % 2) == 1)
{
return theWidgetOne;
}
else
{
return theWidgetTwo;
}
}


window.status='Copyright © 2006 Lycée Réaumur - Tous droits réservés';