var fondDiv = false;
var dataDiv = false;
//var href_compatibility_regexp	=	/^([a-z0-9]+:\/\/)?([^\/:]+)?(:[\d]+)?(\/)?(.*$)?/g ;// Permet de retraiter les hrf et autres pathname quelque soit le navigateur
var href_compatibility_regexp	=	/^(?:\w+:\/\/[^\s\/]+)?\/?(.*)/;// Permet de retraiter les hrf et autres pathname quelque soit le navigateur

function menu(obj)
{
	if(!$(obj).hasClass('active'))
		$(obj).addClass('hover').addClass('jshover');
}

function hidemenu(item)
{
	$$('#'+item+' li.jshover').removeClass('hover').removeClass('jshover');
}

function file(fichier)

{

	if(window.XMLHttpRequest) // FIREFOX

	  xhr_object = new XMLHttpRequest(); 

	else if(window.ActiveXObject) // IE

	  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 

	else 

	  return(false); 

	xhr_object.open("GET", fichier, false); 

	xhr_object.send(null); 

	if(xhr_object.readyState == 4) return(xhr_object.responseText);

	else return(false);

}





function popup(href, id, w, h, r, s) {

	if(id == 'taille')
	{
		if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
			
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   backgroundColor: '#dcdcdc',
		   width: '640px',
		   height: '450px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-320px',	   
		   marginTop: (getScrollTop()-225) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});
	
		new Ajax(
			href,
			{
				update: dataDiv,
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true,
				method:'get'
			}
		).request();
	}
	else if(id == 'amis')
	{
	if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
			
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
		//alert(getHeight());
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   backgroundColor: '#dcdcdc',
		   width: '640px',
		   height: '350px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-320px',	   
		   marginTop: (getScrollTop()-175) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});
	
		new Ajax(
			href,
			{
				update: dataDiv,
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true,
				method:'get'
			}
		).request();
	}
	else if(id == 'image')
	{
	if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
	
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
		//alert(getHeight());
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   /*backgroundColor: '#FFF',*/
		   width: '452px',
		   height: '514px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-226px',	   
		   marginTop: (getScrollTop()-257) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});

		new Ajax(
			'/image.php',
			{
				update: dataDiv,
				data:'url='+href+'&produit_id='+r,
				
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true
			}
		).request();
	}
	else
		window.open(href, id, 'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+',toolbar=0,directories=0,status=0,menubar=0');

}



function affectPrix(bon_achat_id,valeur,panier,ports)

{

	if(document.getElementById(bon_achat_id).checked)

	{

		texte = file('/ajax/ajax_ba.php?bon_achat_id='+ bon_achat_id);

		if(texte=="ok")

		{

			document.getElementById(bon_achat_id).checked=true;

			$('total').innerHTML=Math.round((parseFloat(panier) - parseFloat(valeur))*100)/100;

		}

		else if(texte=="ok2")

		{

			//document.getElementById(bon_achat_id).disabled=true;

			//$('total').innerHTML=Math.round((parseFloat(panier) - parseFloat(valeur))*100)/100;

			$('total').innerHTML=ports;

			

			erreur_ba = file('/ajax/ajax_txt.php?erreur_ba=1');

			alert(erreur_ba);

		}

		else

		{

			document.getElementById(bon_achat_id).checked=false;

			alert(texte);

		}

	}

	else

	{

		texte = file('/ajax/ajax_ba.php?del=1&bon_achat_id='+ bon_achat_id);

		$('total').innerHTML=panier;

	}

}



function SecureConfirm(obj)

{

	if(confirm('Voulez-vous supprimer votre adresse du carnet ?')) {

		obj.submit();

	}else{

		return false;

	}

}



function SecureConfirm2(obj)

{

	if(confirm('Voulez-vous supprimer ce flux?')) {

		obj.submit();

	}else{

		return false;

	}

}



function ActionSelect(Objet){  

	var val = Objet.value.toLowerCase();       

	var dest;        

	switch(val){            

		case "nouvelle_adresse" :                

			dest="/account_address_book.html?cmd=add&origin=panier";                

			break;            

		default:                

			return false;            

	}        

	location.href=dest;

}

function gotourl(obj)
{
	if($(obj).value) location.href=$(obj).value;
}



function filter_art(Obj)

{



	if(Obj == 'all')

	{

		

		arrArt = $$('#listing_art option').setStyle('display', 'block');

		arrArt2 = $$('#listing_art2 option').setStyle('display', 'none');

		

		numArt = arrArt.length;

		numArt2 = arrArt2.length;

		

		$('num_arti').setHTML(numArt2);

		

		if(document.all)

		{



			document.getElementById('listing_art').options.length = 0;

			var obj = document.getElementById('listing_art');



			for(i=0;i<numArt2;i++)

			{

				obj.options[obj.options.length] = new Option(arrArt2[i].text,arrArt2[i].value)

			}

			

		}				

				

		

	}

	else

	{

		$$('#listing_art option').setStyle('display', 'none');

		arrArt = $$('#listing_art option.'+Obj).setStyle('display', 'block');

		arrArt2 = $$('#listing_art2 option.'+Obj).setStyle('display', 'block');

		

		

		numArt = arrArt.length;

		numArt2 = arrArt2.length;

		

		

		$('num_arti').setHTML(numArt2);				

		

		

		if(numArt>1) $('is_two').setStyle('display', 'inline');

		else $('is_two').setStyle('display', 'none');

		

		

		if(document.all)

		{



			document.getElementById('listing_art').options.length = 0;

			var obj = document.getElementById('listing_art');



			for(i=0;i<numArt2;i++)

			{

				obj.options[obj.options.length] = new Option(arrArt2[i].text,arrArt2[i].value)

			}



			for(i=0;i<numArt;i++)

			{

				obj.options[obj.options.length] = new Option(arrArt[i].text,arrArt[i].value)

			}		

			

		}

	}

}



function showHide(id) {

	

	var obj = document.getElementById(id);



	if (obj.style.display == 'inline')

	{

		obj.style.display = 'none'

	}else{

		obj.style.display = 'inline'

	}	

	

}



var curForm = false;



function addNewsletter(obj)

{

	

	curForm = obj;

	new Ajax(

		obj.action,

		{

			data:$(obj).toQueryString(),

			onComplete: displayError

		}

	).request();

}



function displayError(txt)

{

	alert(txt);	

	if(txt.indexOf('notre') != -1)

		curForm.reset();

}



var xtoAdd = 475;

/*

function leftClick() {

	leftx = document.getElementById('innercontent');

	x = leftx.style.left.toInt();

	if(x == "" || isNaN(x)){

		x = 0;

	}

	

	//alert(x);

	if(x>-10 || x>=0) x=x-xtoAdd;



	//alert(x);



	if(x<=-xtoAdd)

		$('innercontent').effect('left',{ duration: 800, transition: Fx.Transitions.Quad.easeOut, wait:true }).start(x, x + xtoAdd );

}



function rightClick() {

	rightx = document.getElementById('innercontent');

	x = rightx.style.left.toInt();

	if(x == "" || isNaN(x)) {

		x = 0;

	}

	

	alert(rightx.style.width.toInt() + xtoAdd+' = '+ (-x));

	if(-x < rightx.style.width.toInt() + xtoAdd)

		$('innercontent').effect('left',{ duration: 800, transition: Fx.Transitions.Quad.easeIn, wait:true }).start(x, x - xtoAdd )

}

*/

/*

	window.addEvent("domready", function() {  

	    new iCarousel("example_3_content", {  

	        idPrevious: "example_3_previous",  

	        idNext: "example_3_next",  

	        idToggle: "undefined",  

	        item: {  

	            klass: "example_3_item",  

	            size: 93  

	        },  

	        animation: {  

	            duration: 500,  

	            amount: 5  

	        }  

	    });  

	});

	*/

/*

window.addEvent("domready", function() {  

 



	if($('innercontent')) {

    new iCarousel("innercontent", {  

        idPrevious: "slide_artiste_left",  

        idNext: "slide_artiste_right",  

        idToggle: "undefined",  

        item: {  

            klass: "slide_artiste_image",  

            size: 85  

        },  

        animation: {  

            duration: 1000,  

            amount: 4,  

            type: "scroll"

        }  

    });  

   }

});

*/



function displayArtisteRSS(obj,p,artiste_rss_nom_id,artiste)

{

	

	$$('#info_bio a').removeClass('active');

	$(obj).addClass('active');



	texte = file('/ajax/artiste_rss.php?artiste_rss_nom_id='+ artiste_rss_nom_id +'&artiste_id='+artiste);

	document.getElementById(p).innerHTML=texte;

	return false;





		

}





function check_add_panier(toto)

{

	if(!toto)

		nVarNom = prompt("Entrez un nom pour votre panier :");

	else

		nVarNom = prompt("Vous devez entrer un nom pour votre panier :");

		

	if(nVarNom != null) //check_add_panier('toto')

	{

		if(!nVarNom)

			check_add_panier('toto');

		else

		{

			document.forms['savepanier'].elements['panier_nom'].value = nVarNom;	

			document.forms['savepanier'].submit();	

		}

			

		

	}

}





function addPanier(idForm)

{

	if(!fondDiv){

		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();

		document.body.appendChild(fondDiv);

	}

	fondDiv.innerHTML = '';

	//alert(getHeight());



	$(fondDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '100%',

	   height: getScrollHeight(),

	   position: 'absolute',

	   opacity: '0.75',

	   overflow: 'hidden',

	   top: '0px',

	   zIndex: '1500',

	   visibility: 'hidden'

	});



	if(!dataDiv){

		dataDiv = document.createElement('div');

		dataDiv.style.position = 'absolute';

		document.body.appendChild(dataDiv);

	}



	$(dataDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '455px',

	   height: '175px',

	   position: 'absolute',

	   border: '1px solid #000',

	   top: '50%',

	   left: '50%',	   

	   marginLeft: '-227px',	   

	   marginTop: (getScrollTop()-87) + 'px',	   	   	   

	   zIndex: '1600',

	   visibility: 'hidden'

	});



	new Ajax(

		'/panier-change-ajax.php',

		{

			method: 'get',

			update: dataDiv,

			data:$(idForm).toQueryString(),

			onSuccess: function(req) {

				$$(fondDiv).setStyles({visibility: 'visible' });

				//$$('select').setStyles({visibility: 'hidden' });

				$$(dataDiv).setStyles({visibility: 'visible' });



				new Ajax(

					'/ajax/updatePanier.php',

					{

						update: $('account')

					}

				).request();

				

			},

			evalScripts: true

		}

	).request();

	

}

function addPanierPerso(idForm)
{
	
	if($(idForm).produit_attribut_id.value=="") {
		alert('Veuillez choisir une taille');
		return false;
	}
	
	if($(idForm).perso_id.checked==true) {
		var i=1;
		while($('texte'+i) && i<=10) {
			if($('texte'+i).value == "") {
				alert('Veuillez renseigner toutes les lignes de la personnalisation');
				return false;
			}
			i++;
		}
	}
	
	if(!fondDiv){

		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();
		document.body.appendChild(fondDiv);
	}
	fondDiv.innerHTML = '';

	//alert(getHeight());

	$(fondDiv).setStyles({
	   backgroundColor: '#000000',
	   width: '100%',
	   height: getScrollHeight(),
	   position: 'absolute',
	   opacity: '0.75',
	   overflow: 'hidden',
	   top: '0px',
	   zIndex: '1500',
	   visibility: 'hidden'

	});

	if(!dataDiv){
		dataDiv = document.createElement('div');
		dataDiv.style.position = 'absolute';
		document.body.appendChild(dataDiv);
	}

	$(dataDiv).setStyles({
	   backgroundColor: '#000000',
	   width: '455px',
	   height: '175px',
	   position: 'absolute',
	   border: '1px solid #000',
	   top: '50%',
	   left: '50%',	   
	   marginLeft: '-227px',	   
	   marginTop: (getScrollTop()-87) + 'px',	   	   	   
	   zIndex: '1600',
	   visibility: 'hidden'

	});

	new Ajax(
		'/panier-change-ajax.php',
		{
			method: 'get',
			update: dataDiv,
			data:$(idForm).toQueryString(),
			onSuccess: function(req) {
				$$(fondDiv).setStyles({visibility: 'visible' });
				//$$('select').setStyles({visibility: 'hidden' });
				$$(dataDiv).setStyles({visibility: 'visible' });

				new Ajax(
					'/ajax/updatePanier.php',
					{
						update: $('account')
					}
				).request();
			},
			evalScripts: true
		}
	).request();

}



function addCadeau(nom,nb)

{

	

	if(!fondDiv){

		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();


		document.body.appendChild(fondDiv);

	}

	fondDiv.innerHTML = '';

	//alert(getHeight());



	$(fondDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '100%',

	   height: getScrollHeight(),

	   position: 'absolute',

	   opacity: '0.75',

	   overflow: 'hidden',

	   top: '0px',

	   zIndex: '1500',

	   visibility: 'hidden'

	});



	if(!dataDiv){

		dataDiv = document.createElement('div');

		dataDiv.style.position = 'absolute';

		document.body.appendChild(dataDiv);

	}



	$(dataDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '455px',

	   height: '175px',

	   position: 'absolute',

	   border: '1px solid #000',

	   top: '50%',

	   left: '50%',	   

	   marginLeft: '-227px',	   

	   marginTop: (getScrollTop()-87) + 'px',	   	   	   

	   zIndex: '1600',

	   visibility: 'hidden'

	});

	

		

	for (var j = 0; j < nb; j++) {

		frm = 'cadeau_' + nom + '_' + j;

		new Ajax(

			'/panier-change-ajax.php',

			{

				method: 'get',

				data:$(frm).toQueryString(),

				EvalScripts: true

			}

		).request();

	}

		

	frm = 'cadeau_' + nom;

	

	new Ajax(

		'/panier-change-ajax.php',

		{

			method: 'get',

			update: dataDiv,

			data:$(frm).toQueryString(),

			onSuccess: function(req) {

				$$(fondDiv).setStyles({visibility: 'visible' });

				//$$('select').setStyles({visibility: 'hidden' });

				$$(dataDiv).setStyles({visibility: 'visible' });



				new Ajax(

					'/ajax/updatePanier.php',

					{

						update: $('account')

					}

				).request();

				

			},

			evalScripts: true

		}

	).request();

	

}

function initPopUp()
{
	$(fondDiv).onclick = function() {removeDivPanier();};
	$(fondDiv).style.cursor = 'pointer';
}

function removeDivPanier()

{

	if(fondDiv){

		$(fondDiv).remove();

		fondDiv = false;

	}	



	if(dataDiv){

		$(dataDiv).remove();

		dataDiv = false;

	}	

	

	//$$('select').setStyles({visibility: 'visible' });

}









function addNoel(page)

{

	if(!fondDiv){

		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();

		document.body.appendChild(fondDiv);

	}
	
	fondDiv.innerHTML = '';

	//alert(getHeight());



	$(fondDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '100%',

	   height: getScrollHeight(),

	   position: 'absolute',

	   opacity: '0.75',

	   overflow: 'hidden',

	   top: '0px',

	   zIndex: '1500',

	   visibility: 'hidden'

	});



	if(!dataDiv){

		dataDiv = document.createElement('div');

		dataDiv.style.position = 'absolute';

		document.body.appendChild(dataDiv);

	}



	$(dataDiv).setStyles({

	   backgroundColor: '#000000',

	   width: '800px',

	   height: '200px',

	   position: 'absolute',

	   border: '1px solid #000',

	   top: '50%',

	   left: '50%',	   

	   marginLeft: '-400px',	   

	   marginTop: (getScrollTop()-50) + 'px',	   	   	   

	   zIndex: '1600',

	   visibility: 'hidden'

	});



	new Ajax(

		'/livraison-noel.php',

		{

			method: 'get',

			update: dataDiv,

			data: 'page='+page,

			onSuccess: function(req) {

				$$(fondDiv).setStyles({visibility: 'visible' });

				//$$('select').setStyles({visibility: 'hidden' });

				$$(dataDiv).setStyles({visibility: 'visible' });

				

			},

			evalScripts: true

		}

	).request();

	

}



function updateRestant(id_avoir,statut)

{

	new Ajax(

		'/ajax/ajax_av.php',

		{

			method: 'get',

			update: $('tr_paiement'),

			data: 'avoir_id='+id_avoir+'&statut='+statut,

			onComplete: function(req) {

				var myTips = new Tips($$('.infobulle'),

					{

						maxTitleChars: 50

					}

				);

			}

		}

	).request();	

	

}





function ticketnet(div,artiste)

{

	$(div).innerHTML='<iframe src="http://www.ticketnet.fr/shop/fr/resultat.asp?recherche=mots&mots='+artiste+'&idtier=5214971" width="640" height="950" />';

	

}



var supatimer = false;

var blogDiv = false;

var CURblogDiv = false;



function showPopup(pwaaaaa,datafsfs)

{

	toto = $(pwaaaaa).getPosition();

	if($(datafsfs))

	{

	if(CURblogDiv != datafsfs)

	{

		CURblogDiv = datafsfs;

		killPopup2();

			blogDiv = document.createElement('div');

			blogDiv.style.position = 'absolute';

			document.body.appendChild(blogDiv);

			blogDiv.innerHTML = $(datafsfs).innerHTML;

		

	

			blabla = $(blogDiv).getSize();

			blabla = blabla.size.y;

		

			$(blogDiv).setStyles({

			   width: '260px',

			   position: 'absolute',

			   top: toto.y-blabla+20+'px',

			   left: toto.x+72+'px',

			   zIndex: '1600'

			});

			

			blabla = $(blogDiv).getSize();

			blabla = blabla.size.y;	

			

			$(blogDiv).setStyles({

			   width: '260px',

			   position: 'absolute',

			   top: toto.y-blabla+20+'px',

			   left: toto.x+72+'px',

			   zIndex: '1600'

			});		

			

	}

	}	

	else

	{

		killPopup2();

		CURblogDiv = false;

	}

		 

}



function killPopup()

{

 setTimeout("killPopup2()",500);

}



function killPopup2()

{



	if(blogDiv){

		$(blogDiv).remove();

		blogDiv = false;

	}	

}


function addAlerteStock(idForm)
{
			
	if(!fondDiv){
		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();
		
		document.body.appendChild(fondDiv);
	}
	fondDiv.innerHTML = '';
	//alert(getHeight());

	$(fondDiv).setStyles({
	   backgroundColor: '#000000',
	   width: '100%',
	   height: getScrollHeight(),
	   position: 'absolute',
	   opacity: '0.75',
	   overflow: 'hidden',
	   top: '0px',
	   zIndex: '1500',
	   visibility: 'hidden'
	});

	if(!dataDiv){
		dataDiv = document.createElement('div');
		dataDiv.style.position = 'absolute';
		document.body.appendChild(dataDiv);
	}

	$(dataDiv).setStyles({
	   backgroundColor: '#000000',
	   width: '300px',
	   height: '200px',
	   position: 'absolute',
	   top: '50%',
	   left: '50%',	   
	   marginLeft: '-150px',	   
	   marginTop: (getScrollTop()-100) + 'px',	   	   	   
	   zIndex: '1600',
	   visibility: 'hidden'
	});

	new Ajax(
		'/ajax/addAlerteStock.php',
		{
			update: dataDiv,
			data:$(idForm).toQueryString(),
			onSuccess: function(req) {

					$$(fondDiv).setStyles({visibility: 'visible' });
					//$$('select').setStyles({visibility: 'hidden' });
					$$(dataDiv).setStyles({visibility: 'visible' });
					
			},
			evalScripts: true
		}
	).request();
}





/* ILOVE */

function loadTextile(idCategorie) {
	
	//$('ilove_spinner').style.display = 'block';
	
	
	new Ajax(
		'/ajax/ilove_init.php',
		{
			update: $('ilove_editor'),
			data:"ilove_categorie_id="+idCategorie+"&itype_id="+$('ilove_type_id').value+"&ilove_picto_nom="+$('ilove_picto_nom').value,
			onSuccess: function(req) {
				selectSexe($('produit_sexe_id').value);
			},
			evalScripts: true
		}
	).request();	
}

function selectSexe(id)
{
	
	loadLoveCouleur(id);
	/*
	loadLoveImg(id);
	loadLoveTaille(id);--ok
	setProduit(id);--ok
	*/
}

function loadLoveCouleur(id) {
	
	new Ajax(
		'/ajax/ilove_couleur.php',
		{
			update: $('ilove_couleur'),
			data:"produit_sexe_id="+id+"&ilove_categorie_id="+$('ilove_categorie_id').value+"&itype_id="+$('ilove_type_id').value,
			onSuccess: function(req) {
				loadLoveTaille(id);
				loadLovePicto2(id);
			},
			evalScripts: true
		}
	).request();	
}

function loadLovePicto2(id) {
	new Ajax(
		'/ajax/ilove_pictos.php',
		{
			update: $('bloc_pictos_form_love'),
			data:"produit_sexe_id="+$('produit_sexe_id').value+"&ilove_categorie_id="+$('ilove_categorie_id').value+"&ilove_couleur_id="+$('ilove_couleur_id').value+"&itype_id="+$('ilove_type_id').value+"&ilove_picto_id="+$('ilove_picto_id').value+"&ilove_picto_nom="+$('ilove_picto_nom').value,
			/*
			onSuccess: function(req) {
					loadEcriture($('ilove_ecriture_id').value);	
			},
			*/
			evalScripts: true
		}
	).request();	
}

function selectLoveCouleur(idColor) {
	
	loadLoveTaille($('produit_sexe_id').value);
	loadLovePicto2();
}

function loadLoveTaille(id) {
	
	new Ajax(
		'/ajax/ilove_taille.php',
		{
			update: $('ilove_taille'),
			data:"produit_sexe_id="+id+"&ilove_categorie_id="+$('ilove_categorie_id').value+"&ilove_couleur_id="+$('ilove_couleur_id').value,
			onSuccess: function(req) {
				loadLoveAttribut($('produit_attribut_id').value);
				setProduit(id);
			},
			evalScripts: true
		}
	).request();	
}

function setProduit(id) {
	new Ajax(
		'/ajax/ilove_produit.php',
		{
			data:"produit_sexe_id="+id+"&ilove_categorie_id="+$('ilove_categorie_id').value+"&ilove_couleur_id="+$('ilove_couleur_id').value,
			onSuccess: function(req) {
				$('produit_id').value=req;
				
				calculPrixLove(req,$('ilove_picto_id').value);
				
				loadLoveImg(req);
			},
			evalScripts: true
		}
	).request();
	
}


function calculPrixLove(id,ilove_picto_id) {
		if (typeof(id)!='undefined'&&id!=''&&!isNaN(id))
		{
			if (typeof(ilove_picto_id)=='undefined')	var ilove_picto_id	=	0;
			new Ajax
			(
				'/ajax/ilove_prix.php',
				{
					update: $('ilove_prix_vo'),
					data:"produit_id="+id+"&ilove_picto_id="+ilove_picto_id,
					onSuccess: function(req) {
					},
					evalScripts: true
				}
			)
			.request()
			;
	}
}

function calculPrixPerso(idForm,id,check) {
	
		if($(idForm).perso_id.checked==true) {
			var i=1;
			while($('texte'+i) && i<=10) {
				$('texte'+i).disabled = false;
				i++;
			}
		}
		else {
			var i=1;
			while($('texte'+i) && i<=10) {
				$('texte'+i).disabled = true;
				i++;
			}
		}
	
		new Ajax(
		'/ajax/perso_prix.php',
		{
			update: $('perso_prix_vo'),
			data:"produit_id="+id+"&check="+check,
			onSuccess: function(req) {

			},
			evalScripts: true
		}
	).request();	
}


function loadLoveImg(id) {
	new Ajax(
		'/ajax/ilove_img.php',
		{
			update: $('image_ilove'),
			data:"produit_id="+id,
			onSuccess: function(req)
			{			
			}			
		}
	).request();	
}




function loadLoveAttribut(id) {
				
	
	new Ajax(
		'/ajax/ilove_attribut.php',
		{
			update: $('ilove_stock'),
			data:"produit_attribut_id="+id,
			onSuccess: function(req) {

			},
			evalScripts: true
		}
	).request();	
}


function getElementsByClassName(className, tag, elm){
	var testClass = new RegExp("(^|s)" + className + "(s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
}

function loadLovePicto(id, src, type_id)
{
	if (typeof type_id=='undefined')	var type_id	=	false;
	var picto = $('ilove_picto_tshirt');

	var arr=getElementsByClassName('ligne2_cadre');
	for( i=0; i < arr.length; i++){
		arr[i].className = "ligne2_cadre";
	}	
	var arr=getElementsByClassName('ligne2_cadre_hover');
	for( i=0; i < arr.length; i++){
		arr[i].className = "ligne2_cadre";
	}	

	if($('ilove_categorie_picto_rotate')) rotate = $('ilove_categorie_picto_rotate').value;
	else rotate = 0;

	if($('ilove_categorie_picto_reduce')) reduce = $('ilove_categorie_picto_reduce').value;
	else reduce = 0;

	$('ilove_picto_id').value = id;
	if (type_id)
		$('ilove_type_id').value = type_id;

	img_mini = $('ilove_picto_id_'+id);
	img_mini.className="ligne2_cadre_hover";

	picto.style.display = "block";
	picto.src = src+'?rotate='+rotate+'&reduce='+reduce;
	
	if ($('ilove_ecriture_id')===null)
	{
	}
	else
		loadEcriture($('ilove_ecriture_id').value);

	// Selon le type du picto on cache ou on montre les zones d'écriture
	if ($('bloc_text_form_love')!=null)
	{
		if (type_id==3)
		{
			var visibility		=	'hidden';
		}
		else
		{
			var visibility		=	'visible';
		}
		$('bloc_text_form_love').setStyle('visibility',visibility);
		$('bloc_ecriture_form_love').setStyle('visibility',visibility);
		$('btn_apercu_ilove').setStyle('visibility',visibility);
		$('bloc_txt_aperc').setStyle('visibility',visibility);
	}
	(function($)
		{
			var $picto_element	=	$('#ilove_picto_tshirt');
			if ($picto_element.length==1)
			{
				$picto_element
					.css
					(
						{
							top:	(parseFloat($('#ilove_categorie_picto_top').val())+parseFloat(($('.onglet_zone:visible .ilove_type_picto_top').val())?$('.onglet_zone:visible .ilove_type_picto_top').val():$('#tabs'+$('#ilove_type_id').val()+' .ilove_type_picto_top').val()))+'px',
							left:	(parseFloat($('#ilove_categorie_picto_left').val())+parseFloat(($('.onglet_zone:visible .ilove_type_picto_left').val())?$('.onglet_zone:visible .ilove_type_picto_left').val():$('#tabs'+$('#ilove_type_id').val()+' .ilove_type_picto_left').val()))+'px'
						}
					)
				;
			}
		}
	)(jQuery)

	calculPrixLove(jQuery('#produit_id').val(),$('ilove_picto_id').value);
}

function changeDesc(id, def) {
	
	var texte1 = $('texte1').value;
	if($('texte2')) var texte2 = $('texte2').value;
	else var texte2 = '';

	new Ajax(
		'/ajax/ilove_ecriture.php',
		{
			update: $('bloc_text_form_love'),
			data:"ilove_ecriture_id="+id+"&texte1="+texte1+"&texte2="+texte2+"&ilove_categorie_id="+$('ilove_categorie_id').value,
			onSuccess: function(req) {
			},
			evalScripts: true
		}
	).request();
	
	loadEcriture(id, def);
			
}


function loadEcriture(id, def) {
	
	if($('ilove_picto_id').value!="") {
		if($('ilove_ecriture_id').value!="") {
			if(def!="1") {
				if($('texte1').value!="") {
		
					new Ajax(
						'/ajax/ilove_ecriture.php',
						{
							update: $('bloc_txt_aperc'),
							data:"ilove_ecriture_id="+id+"&traitement=1&ilove_couleur_font="+$('ilove_couleur_font').value+"&ilove_categorie_id="+$('ilove_categorie_id').value,
							onSuccess: function(req) {
								
								$('apercu_texte1').innerHTML = $('texte1').value;
								$('apercu_texte1').style.display = "block";
								if($('texte2')) 
								{
									$('apercu_texte2').innerHTML = $('texte2').value;
									$('apercu_texte2').style.display = "block";						
								}
								else
								{
									$('apercu_texte2').innerHTML = '';
									$('apercu_texte2').style.display = "none";
								}
								
								document.getElementById('etatgallerie').value='1';
							
							},
							evalScripts: true
						}
					).request();			
					
				}else{
					//alert("Vous devez saisir un texte sur la ligne 1");
				}
			}			
		}else{
			alert("Vous devez selectionner une taille de texte");
		}
	}else{
		alert("Vous devez selectionner une image I love");
	}
}


function loadEcriturePerso() {

			new Ajax(
				'/ajax/perso_ecriture.php',
				{
					update: $('bloc_txt_aperc'),
					data:$('produit').toQueryString(),
					onSuccess: function(req) {
						
						var i=1;
						while($('texte'+i) && i<=10) {
							$('perso_apercu_texte'+i).innerHTML = $('texte'+i).value;
							$('perso_apercu_texte'+i).style.display = "block";
							i++;
						}
					
					},
					evalScripts: true
				}
			).request();			
			
}

var regExpBeginning = /^\s+/;
var regExpEnd = /\s+$/;  

// Supprime les espaces inutiles en d�but et fin de la cha�ne pass�e en param�tre.
function trim(aString) {
    return aString.replace(regExpBeginning, "").replace(regExpEnd, "");
}

function panierValideLove() {
	if
	(
			$('produit_id').value==""
		||	$('produit_attribut_id').value==""
		||	$('ilove_picto_id').value==""
		||
		(
			//$('itype_id').value==3
			//||
			(
				$('ilove_type_id').value!=3
				&&
				(
						$('ilove_ecriture_id').value==""
					||	trim($('texte1').value) == ""
				)
			)
		)
	)
	{
		alert('Erreur : veuillez selectionner tous les criteres !');
	}
	else
	{
		if ($('ilove_type_id').value==3)
		{
			$('texte1').value='';
			if ($('texte2'))
				$('texte2').value='';
		}
		addPanier('produit');
	}
}



function addGallerie(client_id, produit_id) {
	if($('etatgallerie').value!="") {
		if($('produit_id').value == "" ||  $('ilove_picto_id').value == "" || $('ilove_ecriture_id').value == "" || $('texte1').value == "") {
			alert('error');
		}
		else
		{
			var ilove_ecriture_id = $('ilove_ecriture_id').value;
			var ilove_picto_id = $('ilove_picto_id').value;
			var texte1 = $('texte1').value;
			var texte2 = $('texte2').value;
			
			new Ajax(
			'/ajax/ilove_addgallerie.php',
			{
				data:$('produit').toQueryString(),
				onSuccess: function(req) {
					alert(req);
				},
				evalScripts: true
			}
		).request();			
			
			//alert(produit_id + " - " + client_id + " - " +ilove_ecriture_id + " - " + ilove_picto_id + " - " + texte1 + " - " + texte2 );
			
			//addPanier('produit');
		}	
	}
	else
	{
		alert('Veuillez faire un apercu de votre creation !');
	}
}


/* ILOVE */


function selectatt(obj, id_att)
{
	$('produit_attribut_id').value = id_att;
	$$('#list_att li.active').removeClass('active');
	$(obj).addClass('active');
	
	$$('.div_status').removeClass('dsactive');
	$('div_status_' + id_att).addClass('dsactive');
	
	
}


function AlerteStock(idprod, idatt)
{
			
	if(!fondDiv){
		fondDiv = document.createElement('div');
		fondDiv.style.position = 'absolute';
		initPopUp();

		document.body.appendChild(fondDiv);
	}
	fondDiv.innerHTML = '';
	//alert(getHeight());

	$(fondDiv).setStyles({
	   backgroundColor: '#000000',
	   width: '100%',
	   height: getScrollHeight(),
	   position: 'absolute',
	   opacity: '0.75',
	   overflow: 'hidden',
	   top: '0px',
	   zIndex: '1500',
	   visibility: 'hidden'
	});

	if(!dataDiv){
		dataDiv = document.createElement('div');
		dataDiv.style.position = 'absolute';
		document.body.appendChild(dataDiv);
	}

	$(dataDiv).setStyles({
	   backgroundColor: '#dcdcdc',
	   width: '640px',
	   height: '325px',
	   position: 'absolute',
	   top: '50%',
	   left: '50%',	   
	   marginLeft: '-320px',	   
	   marginTop: (getScrollTop()-163) + 'px',	   	   	   
	   zIndex: '1600',
	   visibility: 'hidden'
	});

	var type_id_value	=	($('ilove_type_id'))?$('ilove_type_id').value:'';
	new Ajax(
		'/ajax/addAlerteStock.php',
		{
			update: dataDiv,
			data:'produit_id='+ idprod +'&produit_attribut_id='+ idatt +'&itype_id='+type_id_value,
			onSuccess: function(req) {

					$$(fondDiv).setStyles({visibility: 'visible' });
					//$$('select').setStyles({visibility: 'hidden' });
					$$(dataDiv).setStyles({visibility: 'visible' });
					
			},
			evalScripts: true,
			method:'get'
		}
	).request();
}

function AlerteStock2()
{

	new Ajax(
		'/ajax/addAlerteStock.php',
		{
			update: dataDiv,
			data: $('form_rupture').toQueryString(),
			onSuccess: function(req) {

					$$(fondDiv).setStyles({visibility: 'visible' });
					//$$('select').setStyles({visibility: 'hidden' });
					$$(dataDiv).setStyles({visibility: 'visible' });
					
			},
			evalScripts: true
		}
	).request();
}


function envoyeramis()
{
	new Ajax(
		'/envoyer_amis.php',
		{
			update: dataDiv,
			data: $('envoyeramis_form').toQueryString(),
			onSuccess: function(req) {
	
					$$(fondDiv).setStyles({visibility: 'visible' });
					//$$('select').setStyles({visibility: 'hidden' });
					$$(dataDiv).setStyles({visibility: 'visible' });
					
			},
			evalScripts: true
		}
	).request();
}		

function envoyerblogamis()
{
	new Ajax(
		'/blog_envoyer_amis.php',
		{
			update: dataDiv,
			data: $('envoyeramis_form').toQueryString(),
			onSuccess: function(req) {
	
					$$(fondDiv).setStyles({visibility: 'visible' });
					//$$('select').setStyles({visibility: 'hidden' });
					$$(dataDiv).setStyles({visibility: 'visible' });
					
			},
			evalScripts: true
		}
	).request();
}	

function verifrss1() {
	
	var zoom_id = $('produit_zoom_id').value;
	var lecteur_id = $('lecteur_rss_id').value;
	
	if(zoom_id=="" || lecteur_id =="") {
		alert("Merci de remplir tous les champs.");
		return false;
	}else{
		return true;
	}
}

function verifrss2() {
	
	var zoom_id = $('produit_zoom_id2').value;
	var lecteur_id = $('lecteur_rss_id2').value;
	var genre_id = $('genre_id').value;
	
	if(zoom_id=="" || lecteur_id=="" || genre_id=="") {
		alert("Merci de remplir tous les champs.");
		return false;
	}else{
		return true;
	}
}

function verifrss3() {
	
	var zoom_id = $('produit_zoom_id3').value;
	var lecteur_id = $('lecteur_rss_id3').value;
	var artist_id = $('artiste_id').value;
	
	if(zoom_id=="" || lecteur_id=="" || artist_id=="") {
		alert("Merci de remplir tous les champs.");
		return false;
	}else{
		return true;
	}
}

function verifrss4() {
	
	var zoom_id = $('produit_zoom_id4').value;
	var lecteur_id = $('lecteur_rss_id4').value;
	var artist_id = $('artiste_id2').value;
	
	if(zoom_id=="" || lecteur_id=="" || artist_id=="") {
		alert("Merci de remplir tous les champs.");
		return false;
	}else{
		return true;
	}
}

divRollover = false;

function rollover_over(obj, img)
{
	var Pos = $(obj).getPosition();

	if(!divRollover){
		divRollover = document.createElement('img');
		divRollover.style.position = 'absolute';
		document.body.appendChild(divRollover);
	}	
	
	divRollover.src = img;
	divRollover.style.top = (Pos.y - 115) + 'px';
	divRollover.style.left = (Pos.x - 115) + 'px';			
	divRollover.style.border = '1px solid #CECECE';
	divRollover.style.cursor = 'pointer';
	
	divRollover.onmouseout = function ()
	{
		if(divRollover)
		{
			$(divRollover).remove();
			divRollover = false;
		}
	}
	
}


function showRelaisColis(cp)
{
	if($('liv_rco').style.display="none")
	{
		new Ajax(
			'/ajax/relaiscolis.php',
			{
				update: $('liv_rco'),
				data:'cp='+cp,
				onSuccess: function(req) {
						$('liv_rco').style.display="block";
				},
				evalScripts: true,
				method:'get'
			}
		).request();
		
		
		/*
		$('liv_rco').setHTML('test');
		$('liv_rco').style.display="block"
		*/
	}
}

function hideRelaisColis()
{
	if($('liv_rco').style.display="block")
	{
		$('liv_rco').setHTML('');
		$('liv_rco').style.display="none"
	}
}


function showPreviewBig(idProd)
{

	div = 'prod'+idProd;
	$(div).style.display='block';	
}


function cachePrevisu(idProd)
{
	div = 'prod' + idProd;
	$(div).style.display='none';	
}


function popup_galerie(href, id, w, h, r, s) {

	if(id == 'taille')
	{
		if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
			
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   backgroundColor: '#dcdcdc',
		   width: '640px',
		   height: '450px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-320px',	   
		   marginTop: (getScrollTop()-225) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});
	
		new Ajax(
			href,
			{
				update: dataDiv,
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true,
				method:'get'
			}
		).request();
	}
	else if(id == 'amis')
	{
	if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
			
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
		//alert(getHeight());
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   backgroundColor: '#dcdcdc',
		   width: '640px',
		   height: '350px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-320px',	   
		   marginTop: (getScrollTop()-175) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});
	
		new Ajax(
			href,
			{
				update: dataDiv,
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true,
				method:'get'
			}
		).request();
	}
	else if(id == 'image')
	{
	if(!fondDiv){
			fondDiv = document.createElement('div');
			fondDiv.style.position = 'absolute';
			initPopUp();
	
			document.body.appendChild(fondDiv);
		}
		fondDiv.innerHTML = '';
		//alert(getHeight());
	
		$(fondDiv).setStyles({
		   backgroundColor: '#000000',
		   width: '100%',
		   height: getScrollHeight(),
		   position: 'absolute',
		   opacity: '0.75',
		   overflow: 'hidden',
		   top: '0px',
		   zIndex: '1500',
		   visibility: 'hidden'
		});
	
		if(!dataDiv){
			dataDiv = document.createElement('div');
			dataDiv.style.position = 'absolute';
			document.body.appendChild(dataDiv);
		}
	
		$(dataDiv).setStyles({
		   /*backgroundColor: '#FFF',*/

		   height: '514px',
		   position: 'absolute',
		   top: '50%',
		   left: '50%',	   
		   marginLeft: '-226px',	   
		   marginTop: (getScrollTop()-257) + 'px',	   	   	   
		   zIndex: '1600',
		   visibility: 'hidden'
		});

		new Ajax(
			'/image_galerie.php',
			{
				update: dataDiv,
				data:'url='+href+'&produit_id='+r,
				
				onSuccess: function(req) {
	
						$$(fondDiv).setStyles({visibility: 'visible' });
						//$$('select').setStyles({visibility: 'hidden' });
						$$(dataDiv).setStyles({visibility: 'visible' });
						
				},
				evalScripts: true
			}
		).request();
	}
	else
		window.open(href, id, 'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+',toolbar=0,directories=0,status=0,menubar=0');

}

function PageGalerie(id,page,type_id)
{
	if ((typeof type_id == 'undefined')||(type_id!='artiste'))	type_id	=	'produit';
	new Ajax(
		'/ajax/pageGalerie.php',
		{
			update: $('liste_galerie_perso'),
			data:type_id+'_id='+id+'&page='+page,
			onSuccess: function(req) {
			},
			evalScripts: true
		}
	).request();

}

// Execution au chargement
(function($) {
  $(function() {
  	
  	// Gestion des recherches sur mots clefs
		var $motclef_elements	=	$('input[type=text][name=motclef]');
		if ($motclef_elements.length)
		{
			$motclef_elements
				.filter('.recherche_gauche,.recherche_bas')
					.each
					(
						function()
						{
							var $motclef_element	=	$(this);
							$motclef_element.data('valeur_initial',$motclef_element.val())
						}
					)
					.bind
					(
						'focus'
						,
						function()
						{
							var $motclef_element	=	$(this);
							if ($motclef_element.val()==$motclef_element.data('valeur_initial'))
							{
								$motclef_element.val('');
							}
						}
					)
					.bind
					(
						'blur'
						,
						function()
						{
							var $motclef_element	=	$(this);
							if ($motclef_element.val()=='')
							{
								$motclef_element.val($motclef_element.data('valeur_initial'));
							}
						}
					)
				.end()
				.each
				(
					function()
					{
						var $motclef_element	=	$(this);
						var innerWidth				=	$motclef_element.innerWidth();
						$motclef_element
							.autocomplete
							(
								'/ajax/ajax_recherche.php'
								,
								{
									delay: 100,
									selectFirst: false,
									matchContains: true,
									width:	innerWidth
								}
							)
							.result
							(
								function(e,data)
								{
									if (e.type=='result')
									{
										$motclef_element
											//.val('"'+$motclef_element.val()+'"')
											.parents('form:first')
												.bind
												(
													'submit'
													,
													function()
													{
															return false;
													}
												)
											.end()
										;
										window.location.href	=	'/search/?motclef="'+$motclef_element.val()+'"';
									}
								}
							)
						;
					}
				)
			;
		}
  	
  	// Gestion des champs NewsLetter
		var $nl_email_elements	=	$('#header_newsletter input[type=text][name="newsletter_email"]');
		if ($nl_email_elements.length)
		{
			$nl_email_elements
				.each
				(
					function()
					{
						var $nl_email_element	=	$(this);
						$nl_email_element.data('valeur_initial',$nl_email_element.val())
					}
				)
				.bind
				(
					'focus'
					,
					function()
					{
						var $nl_email_element	=	$(this);
						if ($nl_email_element.val()==$nl_email_element.data('valeur_initial'))
						{
							$nl_email_element.val('');
						}
					}
				)
				.bind
				(
					'blur'
					,
					function()
					{
						var $nl_email_element	=	$(this);
						if ($nl_email_element.val()=='')
						{
							$nl_email_element.val($nl_email_element.data('valeur_initial'));
						}
					}
				)
			;
		}
  });
})(jQuery);
function displayMSG(msg) {
   alert(msg);
}
