

 function verification(){
				var expreg_email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	 
	 
document.creation.nom.style.backgroundColor="#ffffff"; 
document.creation.adresse.style.backgroundColor="#ffffff"; 
document.creation.prenom.style.backgroundColor="#ffffff"; 
document.creation.mail.style.backgroundColor="#ffffff"; 
document.creation.tel.style.backgroundColor="#ffffff"; 
document.creation.message.style.backgroundColor="#ffffff"; 
document.creation.adresse.style.backgroundColor="#ffffff"; 

	 if(document.creation.nom.value == ""){

        alert ('Vous avez oublié de saisir votre nom');
		         document.creation.nom.style.backgroundColor="#f97d7d"; 

         document.creation.nom.focus(); 
        return false;

    }
 else if(document.creation.prenom.value == ""){

        alert ('Vous avez oublié de saisir votre prénom');
		         document.creation.prenom.style.backgroundColor="#f97d7d"; 

        document.creation.prenom.focus(); 
        return false;

    }


   else if(document.creation.mail.value == ""){

        alert ('Vous avez oublié de saisir votre mail');
		         document.creation.mail.style.backgroundColor="#f97d7d"; 

 document.creation.mail.focus(); 
        return false;

    }
	
	else if (!expreg_email.test(document.creation.mail.value)){
					alert("Veuillez indiquer une adresse email valide.");
					         document.creation.mail.style.backgroundColor="#f97d7d"; 

					document.creation.mail.select();
					return false;
				}


    else if(document.creation.tel.value == ""){

        alert ('Vous avez oublié de saisir votre téléphone');
							         document.creation.tel.style.backgroundColor="#f97d7d"; 

 document.creation.tel.focus(); 
        return false;

    }
    else if(document.creation.adresse.value == ""){
	 document.creation.adresse.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir votre adresse');
 document.creation.adresse.focus(); 
        return false;

    }
   
    else if(document.creation.message.value == ""){
					         document.creation.message.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir un message');
 document.creation.message.focus(); 
        return false;

    }
	
		 
	
			
	    
return true;

}
 
 function testDateValide(saisie) {


saisie = (saisie).split("/");


}
	function verifdt(){
verdat=document.creation.naissance.value;
datej= new Date()
anneej=datej.getFullYear()+"*";
anneej=anneej.substring(0,2)

if (verdat.length ==6) 
verdat=verdat.substring(0,2)+"/"+verdat.substring(4,2)+"/"+anneej+verdat.substring(6,4);

if (verdat.length ==8) 
verdat=verdat.substring(0,2)+"/"+verdat.substring(4,2)+"/"+verdat.substring(8,4);


if(!isValidDate(verdat))
{
alert("Votre  date  de naissance n'est pas valide ou n'est pas au bon format.\n format : JJ/MM/AAAA");
        return false;

}
else
{
document.creation.naissance.value = verdat;
}

	}

	function isValidDate(d) {
var dateRegEx = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;
return d.match(dateRegEx);
	} 



 function verification2(){
	  
	  
var expreg_email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	 

var saisie = document.creation.naissance.value;	 



document.creation.nom.style.backgroundColor="#ffffff"; 
document.creation.prenom.style.backgroundColor="#ffffff"; 
document.creation.adresse.style.backgroundColor="#ffffff"; 
document.creation.cp.style.backgroundColor="#ffffff"; 
document.creation.ville.style.backgroundColor="#ffffff";
 
document.creation.naissance.style.backgroundColor="#ffffff"; 
document.creation.mail.style.backgroundColor="#ffffff"; 
document.creation.tel.style.backgroundColor="#ffffff"; 


	 if(document.creation.nom.value == ""){

        alert ('Vous avez oublié de saisir votre nom');
		         document.creation.nom.style.backgroundColor="#f97d7d"; 

         document.creation.nom.focus(); 
        return false;

    }
 else if(document.creation.prenom.value == ""){

        alert ('Vous avez oublié de saisir votre prénom');
		         document.creation.prenom.style.backgroundColor="#f97d7d"; 

        document.creation.prenom.focus(); 
        return false;

    }



    else if(document.creation.adresse.value == ""){
	 document.creation.adresse.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir votre adresse');
 document.creation.adresse.focus(); 
        return false;

    }
	
	    else if(document.creation.cp.value == ""){
				document.creation.cp.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir votre code postal');
 document.creation.cp.focus(); 
        return false;

    }
	
	    else if(document.creation.ville.value == ""){
					         document.creation.ville.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir votre ville');
 document.creation.ville.focus(); 
        return false;

    }



	
	    else if(document.creation.naissance.value == ""){
					         document.creation.naissance.style.backgroundColor="#f97d7d"; 

        alert ('Vous avez oublié de saisir votre date de naissance');
 document.creation.naissance.focus(); 
        return false;

    }
		







	
      else if(document.creation.mail.value == ""){

        alert ('Vous avez oublié de saisir votre mail');
		         document.creation.mail.style.backgroundColor="#f97d7d"; 

 document.creation.mail.focus(); 
        return false;

    }
	
	else if (!expreg_email.test(document.creation.mail.value)){
					alert("Veuillez indiquer une adresse email valide.");
					         document.creation.mail.style.backgroundColor="#f97d7d"; 

					document.creation.mail.select();
					return false;
				}


    else if(document.creation.tel.value == ""){

        alert ('Vous avez oublié de saisir votre téléphone');
							         document.creation.tel.style.backgroundColor="#f97d7d"; 

 document.creation.tel.focus(); 
    

    }

		 
var response = verifdt();
if (response == false)
   {

return false;
}
	    
return true;

}
 
 
function pausescroller(content, divId, divClass, delay){
 
this.content=content //message array content
 
this.tickerid=divId //ID of ticker div to display information
 
this.delay=delay //Delay between msg change, in miliseconds.
 
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
 
this.hiddendivpointer=1 //index of message array for hidden div
 
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
 
var scrollerinstance=this
 
if (window.addEventListener) //run onload in DOM2 browsers
 
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
 
else if (window.attachEvent) //run onload in IE5.5+
 
window.attachEvent("onload", function(){scrollerinstance.initialize()})
 
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
 
setTimeout(function(){scrollerinstance.initialize()}, 500)
 
}
 
 
 
// -------------------------------------------------------------------
 
// initialize()- Initialize scroller method.
 
// -Get div objects, set initial positions, start up down animation
 
// -------------------------------------------------------------------
 
 
 
pausescroller.prototype.initialize=function(){
 
this.tickerdiv=document.getElementById(this.tickerid)
 
this.visiblediv=document.getElementById(this.tickerid+"1")
 
this.hiddendiv=document.getElementById(this.tickerid+"2")
 
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
 
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
 
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
 
this.getinline(this.visiblediv, this.hiddendiv)
 
this.hiddendiv.style.visibility="visible"
 
var scrollerinstance=this
 
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
 
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
 
if (window.attachEvent) //Clean up loose references in IE
 
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
 
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
 
}
 
 
 
 
 
// -------------------------------------------------------------------
 
// animateup()- Move the two inner divs of the scroller up and in sync
 
// -------------------------------------------------------------------
 
 
 
pausescroller.prototype.animateup=function(){
 
var scrollerinstance=this
 
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
 
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
 
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
 
setTimeout(function(){scrollerinstance.animateup()}, 50)
 
}
 
else{
 
this.getinline(this.hiddendiv, this.visiblediv)
 
this.swapdivs()
 
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
 
}
 
}
 
 
 
// -------------------------------------------------------------------
 
// swapdivs()- Swap between which is the visible and which is the hidden div
 
// -------------------------------------------------------------------
 
 
 
pausescroller.prototype.swapdivs=function(){
 
var tempcontainer=this.visiblediv
 
this.visiblediv=this.hiddendiv
 
this.hiddendiv=tempcontainer
 
}
 
 
 
pausescroller.prototype.getinline=function(div1, div2){
 
div1.style.top=this.visibledivtop+"px"
 
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
 
}
 
 
 
// -------------------------------------------------------------------
 
// setmessage()- Populate the hidden div with the next message before it's visible
 
// -------------------------------------------------------------------
 
 
 
pausescroller.prototype.setmessage=function(){
 
var scrollerinstance=this
 
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
 
setTimeout(function(){scrollerinstance.setmessage()}, 100)
 
else{
 
var i=this.hiddendivpointer
 
var ceiling=this.content.length
 
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
 
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
 
this.animateup()
 
}
 
}
 
 
 
pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
 
if (tickerobj.currentStyle)
 
return tickerobj.currentStyle["paddingTop"]
 
else if (window.getComputedStyle) //if DOM2
 
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
 
else
 
return 0
 
}
blocolor = true;
function hexa(couleur,test,form)
{
	if(test=='0')
	{
		document.getElementById(form).value = couleur; // On inscrit dans le champs TEXT la valeur HEX de la couleur
		document.getElementById(form+'2').style.display = 'none';	
	}
	document.getElementById(form).style.color = couleur;
}

function mise_ajour_prix_liste(idchlo)
{
	//alert(idchlo);
	choixa=idchlo.split('-');
	document.getElementById("prixadmin_produit").value =choixa[1];
	document.getElementById("promoadmin_produit").value =choixa[2];
	
}

function palette_couleurs(form) 
{ 
if(document.getElementById(form+'2').style.display == 'block')
{
			document.getElementById(form+'2').style.display = 'none';	
			document.getElementById(form+'1').innerHTML = '<img src="../images/accordion_open.png" width="16" height="17" onclick="palette_couleurs(\''+form+'\');">';
			
			
}
else
{
	document.getElementById(form+'2').style.display = 'block';	
	document.getElementById(form+'1').innerHTML = '<img src="../images/accordion_close.png" width="16" height="17" onclick="palette_couleurs(\''+form+'\');">';

}
	// Ouverture du tableau
	txtdiv="<TABLE border='0' cellpadding='0' cellspacing='0' ><TR>";
	
	// Déclaration des variables
	var tabk = new Array('FF','CC','99','66','33','00'); // Tableau principal de couleur
	var tabj = tabk;
	var tabi = new Array('CC', '66', '00'); // Petit tableau principal (colonne de 6 couleurs)
	var tabi2 = new Array('00','33','66','99','CC','FF'); // Tableau principal inversé pour la colone du milieu (colonne de 6 couleurs)
	var color=""; // initialisation de color a vide
	var cmp = 0; // initialisation du compteur a 0
	
	// Début prog
	for(var k=0;k<6;k++) // Boucle pour les lignes de couleurs
	{
		for(var i=0;i<3;i++) // Boucle pour les colonnes (colonnes de 6 couleurs)
		{
			if (i == 1) // Si on attaque la 2 eme colonne de 6 couleurs
			{
				tabj = tabi2; // on inverse le tableau principale de couleurs
			}
			else // sinon
			{
				tabj = Array('FF','CC','99','66','33','00'); // On remet le tableau par default
			}
			
			for(var j=0;j<6;j++) // Boucle pour l'affichage couleur par couleur
			{
				color="#"+tabi[i]+tabk[k]+tabj[j]; // concaténation des chaines pour la valeur de la couleur
				// et on affiche la couleur
				txtdiv = txtdiv + "<TD width='15' height='15' style='border: 1px solid #000000;' bgcolor='"+color+"' onMouseOver=\"hexa('"+color+"','1','"+form+"')\" onClick=\"hexa('"+color+"','0','"+form+"')\"></TD>"; 
			} 
		} 
		txtdiv = txtdiv + "</tr>";
		
		cmp = cmp + 1; // On compte le nombre de ligne faite
		if (cmp == 6) // si on a fait les 6 lignes
		{
			var tabi = new Array('FF', '99', '33'); // on redéfini le nouveau tableau principal (colonne de 6 couleurs)
			var tabk = tabi2; // on re initialise le tableau des lignes
			k = -1; // on défini k à -1 car on a déja fait un passage
		}
	}
	// Fin prog
	txtdiv = txtdiv + "</TABLE><BR>"; // On ferme le tableau + saut de ligne
document.getElementById(form+'2').innerHTML = txtdiv;
} 


function bloc_menutype(txt)
{
	if(txt=='2'){
document.getElementById('typebloc').style.display = 'none';	
	}else
	{
		document.getElementById('typebloc').style.display = 'block';	

	}
}


function afficher_numerocolis()
{
numcol=document.getElementById('numero_colis').value;


choix=document.getElementById('etat_delacomunede').value;
choixa=choix.split('*');
choixb=choixa[0];

test=document.getElementById(choixb).value;

a=test.split('<var2>numero_colis</var2>');

if(a[1]){
newtxt=a[0] + " " + numcol + " " +a[1];
document.getElementById('mailetat').value=newtxt;
}

}
function ch_txt_comande(txt)
{
a=txt.split('*');
txt=a[0];
idtxt=a[1];


document.getElementById('mailetat').value = document.getElementById(txt).value;
document.getElementById('idpiuerpm').value = idtxt;

document.getElementById('mailsujet').value = document.getElementById(txt+'wwwww').value;

}

function soumettre_ordre(choix)
{
document.getElementById('choixordr').value = choix;
document.form_page_admin.submit();
}

function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre)
{
window.open (nom_de_la_page, 'Pass', config='height=220, width=450, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}


var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth() + 1;
ds_c_year = ds_i_date.getFullYear();

// Get Element By Id
function ds_getel(id) {
	return document.getElementById(id);
}

// Get the left and the top of the element.
function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}

// Output Element

var ds_oe = ds_getel('ds_calclass');
// Container
var ds_ce = ds_getel('ds_conclass');

// Output Buffering
var ds_ob = ''; 
function ds_ob_clean() {
	ds_ob = '';
}
function ds_ob_flush() {
	ds_oe.innerHTML = ds_ob;
	ds_ob_clean();
}
function ds_echo(t) {
	ds_ob += t;
}

var ds_element; // Text Element...

var ds_monthnames = [
'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'
]; // You can translate it for your language.

var ds_daynames = [
'Dim', 'Lun', 'Mar', 'Me', 'Jeu', 'Ven', 'Sam'
]; // You can translate it for your language.

// Calendar template
function ds_template_main_above(t) {
	return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'
	     + '<tr>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();">&lt;&lt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();">&lt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Fermer]</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">&gt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">&gt;&gt;</td>'
		 + '</tr>'
	     + '<tr>'
		 + '<td colspan="7" class="ds_head">' + t + '</td>'
		 + '</tr>'
		 + '<tr>';
}

function ds_template_day_row(t) {
	return '<td class="ds_subhead">' + t + '</td>';
	// Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.
}

function ds_template_new_week() {
	return '</tr><tr>';
}

function ds_template_blank_cell(colspan) {
	return '<td colspan="' + colspan + '"></td>'
}

function ds_template_day(d, m, y) {
	return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';
	// Define width the day row.
}

function ds_template_main_below() {
	return '</tr>'
	     + '</table>';
}

// This one draws calendar...
function ds_draw_calendar(m, y) {
	// First clean the output buffer.
	ds_ob_clean();
	// Here we go, do the header
	ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));
	for (i = 0; i < 7; i ++) {
		ds_echo (ds_template_day_row(ds_daynames[i]));
	}
	// Make a date object.
	var ds_dc_date = new Date();
	ds_dc_date.setMonth(m - 1);
	ds_dc_date.setFullYear(y);
	ds_dc_date.setDate(1);
	if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
		days = 31;
	} else if (m == 4 || m == 6 || m == 9 || m == 11) {
		days = 30;
	} else {
		days = (y % 4 == 0) ? 29 : 28;
	}
	var first_day = ds_dc_date.getDay();
	var first_loop = 1;
	// Start the first week
	ds_echo (ds_template_new_week());
	// If sunday is not the first day of the month, make a blank cell...
	if (first_day != 0) {
		ds_echo (ds_template_blank_cell(first_day));
	}
	var j = first_day;
	for (i = 0; i < days; i ++) {
		// Today is sunday, make a new week.
		// If this sunday is the first day of the month,
		// we've made a new row for you already.
		if (j == 0 && !first_loop) {
			// New week!!
			ds_echo (ds_template_new_week());
		}
		// Make a row of that day!
		ds_echo (ds_template_day(i + 1, m, y));
		// This is not first loop anymore...
		first_loop = 0;
		// What is the next day?
		j ++;
		j %= 7;
	}
	// Do the footer
	ds_echo (ds_template_main_below());
	// And let's display..
	ds_ob_flush();
	// Scroll it into view.
	ds_ce.scrollIntoView();
}

// A function to show the calendar.
// When user click on the date, it will set the content of t.
function ds_sh(t) {
	// Set the element to set...
	ds_element = t;
	// Make a new date, and set the current month and year.
	var ds_sh_date = new Date();
	ds_c_month = ds_sh_date.getMonth() + 1;
	ds_c_year = ds_sh_date.getFullYear();
	// Draw the calendar
	ds_draw_calendar(ds_c_month, ds_c_year);
	// To change the position properly, we must show it first.
	ds_ce.style.display = '';
	// Move the calendar container!
	the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight;
	ds_ce.style.left = the_left + 'px';
	ds_ce.style.top = the_top + 'px';
	// Scroll it into view.
	ds_ce.scrollIntoView();
}

// Hide the calendar.
function ds_hi() {
	ds_ce.style.display = 'none';
}

// Moves to the next month...
function ds_nm() {
	// Increase the current month.
	ds_c_month ++;
	// We have passed December, let's go to the next year.
	// Increase the current year, and set the current month to January.
	if (ds_c_month > 12) {
		ds_c_month = 1; 
		ds_c_year++;
	}
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the previous month...
function ds_pm() {
	ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.
	// We have passed January, let's go back to the previous year.
	// Decrease the current year, and set the current month to December.
	if (ds_c_month < 1) {
		ds_c_month = 12; 
		ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
	}
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the next year...
function ds_ny() {
	// Increase the current year.
	ds_c_year++;
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the previous year...
function ds_py() {
	// Decrease the current year.
	ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Format the date to output.
function ds_format_date(d, m, y) {
	// 2 digits month.
	m2 = '00' + m;
	m2 = m2.substr(m2.length - 2);
	// 2 digits day.
	d2 = '00' + d;
	d2 = d2.substr(d2.length - 2);
	// YYYY-MM-DD
//	return y + '-' + m2 + '-' + d2;


return y + '-' + m2 + '-' + d2;
}

// When the user clicks the day.
function ds_onclick(d, m, y) {
	// Hide the calendar.
	ds_hi();
	// Set the value of it, if we can.
	if (typeof(ds_element.value) != 'undefined') {
		ds_element.value = ds_format_date(d, m, y);
		//alert(ds_element.id);
		document.getElementById(ds_element.id+"a").value=d2 + ' ' + m2 + ' ' + y;

		
	// Maybe we want to set the HTML in it.
	} else if (typeof(ds_element.innerHTML) != 'undefined') {
		ds_element.innerHTML = ds_format_date(d, m, y);
	// I don't know how should we display it, just alert it to user.
	} else {
		alert (ds_format_date(d, m, y));
	}
}
function cacher(champ) 
{ 
document.getElementById(champ).style.display = 'none';
}


function montrer(champ,champ_txt,txt,tabsql,chtxt,ch,ch2,ch3) 
{ 
document.getElementById(champ).style.display = 'block';
document.getElementById(champ_txt).innerHTML = txt;

document.getElementById(champ+'a').contentWindow.document.getElementById('champ_en_coursse').value=ch3;

document.getElementById(champ+'a').contentWindow.document.getElementById(chtxt).value=tabsql;
document.getElementById(champ+'a').contentWindow.document.getElementById(ch2).value=ch;





}



function augmenter_ch(champ,nbr_pag) 
{
minch = parseInt(document.getElementById(champ).value)+parseInt(1);
if(minch <= nbr_pag){
document.getElementById(champ).value = minch;
document.form_page_admina.submit(); 
}
}

function diminuer_ch(champ) 
{
minch = parseInt(document.getElementById(champ).value)-parseInt(1);
if(minch>0){
document.getElementById(champ).value = minch;
document.form_page_admina.submit(); 
}
}

function modifier_page_admin(id_page_admin) 
{
window.parent.document.getElementById("id_page_admin").value = id_page_admin;
window.parent.document.getElementById("test_parent_page_admin").value = '0';
window.parent.document.form_page_admin.submit(); 

}
function supprimer_page_admin(id_page_admin) 
{
	if (confirm('Confirmez vous la suppression ?'))
	{
	window.parent.document.getElementById("id_page_admin").value = id_page_admin;
	window.parent.document.getElementById("test_parent_page_admin").value = '3';
	window.parent.document.form_page_admin.submit()	
	}
	else
	{
	return false;	
	}
	
	
; 

}
function remplir_champ_page_admin(val_champ,nom_champ,nbr_champ,type) 
{
	
for(t=val_champ;t<nbr_champ;t++)
{	
nom_du_champ = nom_champ + t;

if(type=="1")
{
val_du_champ =document.getElementById(nom_champ+val_champ).value
document.getElementById(nom_du_champ).value = val_du_champ;
}
else if (type=="2")
{
val_du_champ = document.getElementById(nom_champ+val_champ).selectedIndex;

document.getElementById(nom_du_champ).selectedIndex = val_du_champ;

}

else if (type=="3")
{
	if(document.getElementById(nom_champ+val_champ).checked){testchec="1";}else{testchec="0";}
	
if(testchec=="1")
{
document.getElementById(nom_du_champ).checked=true;
}
else
{
document.getElementById(nom_du_champ).checked=false;

}


}
}

}

function changement_image(nomimg,taillelar) {
	document.getElementById("image").innerHTML = "<a rel=\"lightbox[roadtrip2]\" href=\"administration/catalogue/images/"+nomimg+"\" target=\"_blank\"><img src=\"administration/catalogue/images/"+nomimg+"\" "+taillelar+"=\"250\" class=\"bloc_produit_bordure\" /></a>";
}
function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


// Open the lightbox

function voir_panier()
{ 

vu = document.getElementById('valu').value;



document.forms["fiche_prod"+vu].testajout.value="2";

document.forms["fiche_prod"+vu].submit();

}
function continuer_achat()
{ 

vu = document.getElementById('valu').value;
//alert(vu);
document.forms["fiche_prod"+vu].submit();

}


function openbox(formtitle, fadin)
{ 
window.scrollTo('0','0');
var box = document.getElementById('box'); 
  document.getElementById('valu').value=fadin;
  
  document.getElementById('filter').style.display='block';

  var btitle = document.getElementById('boxtitle');
  btitle.innerHTML = "";
  
  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }  return false;
}


// Close the lightbox

function verif_conditions(texte)
{
  if(document.getElementById('verifmention').checked==false){
alert(texte);return false;}

  if(document.getElementById('code_reduction').value!=""){
alert("Vous avez oublié de valider votre code promotion");
return false;}


}

function closebox()
{
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
}
function box_alert(txt)
{
alert(txt);
}
function blocspecial_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
 
var divz = document.getElementById("blocspecial" )

var currentLocation =  document.location.href;

a=currentLocation.split('/');


/*if (a[3]!='administration') { 
 
jQuery(document).ready(function() {
    jQuery('#blocspecial').carousel({
        vertical: true,
		auto: 2,
        scroll: 1,
		wrap: 'last',
		buttonNextHTML: null,
		buttonPrevHTML: null,
        initCallback:blocspecial_initCallback
    });
});
						   }*/
function vider_password()
{
document.getElementById('divpass').innerHTML = '<input type="password" id="pass" value="" class="champ_texte_mini_compte" name="pass"/>';

setTimeout("focus_champ_txt('pass')",10); 

}

function vider_mail()
{
document.getElementById('divmail').innerHTML = '<input type="text" id="mail" value="" class="champ_texte_mini_compte" name="mail"/>';

setTimeout("focus_champ_txt('mail')",10); 

}

function focus_champ_txt(idch)
{document.getElementById(idch).focus();

}


function remplacertxtadm(ch,ch2)
{


var newtxt = tinyMCE.getInstanceById(ch).getBody().innerHTML + document.getElementById(ch2).value;
tinyMCE.get(ch).setContent(newtxt); 




}


function ajoutertxtadm(ch,ch2)
{
if (confirm("Confirmer le remplacement du texte ?")) 
	{	
var newtxt = document.getElementById(ch2).value;


tinyMCE.get(ch).setContent(newtxt); 
	}
}

function affiche_menu(t){

var aret='testme'+t;
	
 if(document.getElementById(aret).value == "1")
 {
document.getElementById(t).style.display="block";	 
// new Effect.SlideDown(t);   

document.getElementById(aret).value = "2";
 }
 else
 {
  document.getElementById(t).style.display="none";

    if(t=="id_menu_entreprise"){
	if(document.getElementById('sous_sous_menu_entrepriseadd')){document.getElementById('sous_sous_menu_entrepriseadd').style.display="none";}
	}else{
 if(document.getElementById('sous_sous_menu_entrepriseadd2')){ document.getElementById('sous_sous_menu_entrepriseadd2').style.display="none";}
  }

 //new Effect.SlideUp(t); 
document.getElementById(aret).value = "1";

 }

	
	


        }
		
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("Cap & Sens Ressources Humaines","http://www.capetsens-rh.fr",""); }
else { window.external.AddFavorite("http://www.capetsens-rh.fr","Cap & Sens Ressources Humaines"); } }




		
function change_img(ch) {

if(ch =='1')
{
	document.getElementById('img1_hover').innerHTML='<img src="../images/menu-ressouce-humaine-vannes-1.png" width="104" height="30" border="0"  alt="Cabinet de ressources humaines et formations a vannes dans le morbihan"/>';
}
if(ch =='2')
{
document.getElementById('img2_hover').innerHTML='<img alt="Présentation cabinet de ressources humaines et formations a vannes" src="../images/menu-ressouce-humaine-vannes-2.png" width="106" height="30" border="0" />';		
}
if(ch =='3')
{
document.getElementById('img3_hover').innerHTML='<img alt="Actualité cabinet de ressources humaines et formations dans le morbihan" src="../images/menu-ressouce-humaine-vannes-3.png" width="105" height="30" border="0" />';	
}
if(ch =='4')
{
document.getElementById('img4_hover').innerHTML='<img alt="Contact cabinet de ressources humaines et formations dans le morbihan" src="../images/menu-ressouce-humaine-vannes-4.png" width="109" height="30" border="0" />';	
}

 }


function change_img2(ch) {
if(ch =='1')
{
document.getElementById('img1_hover').innerHTML='<img src="../images/ressources-humaines-vannes-morbihan.gif" width="104" height="30" border="0"  alt="Cabinet de ressources humaines et formations a vannes dans le morbihan"/>';	
}
if(ch =='2')
{
document.getElementById('img2_hover').innerHTML='<img alt="Présentation cabinet de ressources humaines et formations a vannes" src="../images/ressources-humaines-vannes-morbihan.gif" width="106" height="30" border="0" />';	
}
if(ch =='3')
{
document.getElementById('img3_hover').innerHTML='<img alt="Actualité cabinet de ressources humaines et formations dans le morbihan" src="../images/ressources-humaines-vannes-morbihan.gif" width="105" height="30" border="0" />';	
}
if(ch =='4')
{
document.getElementById('img4_hover').innerHTML='<img alt="Contact cabinet de ressources humaines et formations dans le morbihan" src="../images/ressources-humaines-vannes-morbihan.gif" width="109" height="30" border="0" />';	
}

 }

function img_change(ch) {
chact=document.getElementById('equipe_actif').value;
chactmax=parseInt(document.getElementById('equipe_max').value)-parseInt(1);


if(ch=='1')
{


if(chactmax > chact){
chact = parseInt(chact)+parseInt(1);

document.getElementById('main_page_texte_img_equipe').innerHTML='<img src="administration/equipe/images/thb_'+ document.getElementById('equipe_img'+chact).value +'"/>';	
document.getElementById('main_page_texte_img_txt').innerHTML=document.getElementById('equipe_txt'+chact).value;	

document.getElementById('equipe_actif').value=chact;
}
}

if(ch=='2')
{
	

if(chact > 0){	
chact = parseInt(chact)-parseInt(1);
document.getElementById('main_page_texte_img_equipe').innerHTML='<img src="administration/equipe/images/thb_'+ document.getElementById('equipe_img'+chact).value +'"/>';	
document.getElementById('main_page_texte_img_txt').innerHTML=document.getElementById('equipe_txt'+chact).value;	


document.getElementById('equipe_actif').value=chact;

}
}	
}
