function popupreceive()	{
		var win2 = window.open("https://secure.fia-net.com/wallet/paiement/commentpayer.php",'popup','height=480,width=750,status=yes,scrollbars=yes,menubar=no,resizable=yes');
}http://www.receiveandpay.com/wallet/customer/popup3x.php?logo=2967

function popupreceive2()	{
		var win2 = window.open("http://www.receiveandpay.com/wallet/customer/popup3x.php?logo=10774",'popup','height=750,width=480,status=yes,scrollbars=yes,menubar=no,resizable=yes');
}
function addCart(id, bool){
	var link_id = $('#'+id)[0];
	var w = link_id.offsetWidth;
	var parent = link_id.parentNode;
	parent.style.position = "relative";
	var added = document.createElement('div');
	if(!bool){
		added.className = "elementAd";
	}else{
		added.className = "elementAd elementAdBig";
	}
	added.id="addpanierMove";
	added.style.position = "absolute";
	added.style.left = 0;
	parent.appendChild(added);
	if (!jQuery.browser.msie){
		function removeId(){
			$('#'+added.id).fadeOut(1000 ,function() { parent.removeChild(added); });
		}
		setTimeout(removeId,1000)
	}else{
		function removeId(){
			$('#'+added.id).remove();
		}
		setTimeout(removeId,1000)
	}
}


function swapOnglet(id){
	var onglet = $('#'+id)[0];
	if(onglet.className == ""){
		onglet.className = "actif";
		if(onglet.id == "onglet1"){
			$('#onglets')[0].style.backgroundPosition = "left top";	
			$('#onglet2')[0].className = "";
		}else{
			$('#onglets')[0].style.backgroundPosition = "left -26px";
			$('#onglet1')[0].className = "";
		}
	}else{
		onglet.className = "";	
	}
}


function onFocusVide(obj, chaine) {
	if (obj.value==chaine) {
		obj.value="";
	}
}

function setOpacityetOnclick(div, opa) {
	if (document.getElementById(div)) {
		document.getElementById(div).style.opacity = opa;
		document.getElementById(div).style.filter = 'alpha(opacity='+opa*100+')';
		if (opa==0.1) {
			document.getElementById(div).style.cursor="default";
		}else{
			document.getElementById(div).style.cursor="pointer";
		}
	}
}

function mouvementVignette(direction) {
	if (direction=="flecheDroite" && nbrvignetteplusEncour<nbrvignetteplus) {
		varLeft=varLeft-40;
		nbrvignetteplusEncour++;
		setOpacityetOnclick('flecheGauche', 1);
	}
	if (direction=="flecheGauche" && nbrvignetteplusEncour!=0) {
		varLeft=varLeft+40;
		nbrvignetteplusEncour--;
		setOpacityetOnclick('flecheDroite', 1);
	}
	if (nbrvignetteplusEncour==nbrvignetteplus) {
		setOpacityetOnclick('flecheDroite', 0.1);
	}
	if (nbrvignetteplusEncour==0) {
		setOpacityetOnclick('flecheGauche', 0.1);
	}
	if (nbrvignetteplusEncour<=nbrvignetteplus) {
		$('#ulVignette').animate( {left : varLeft+'px'},100);
		
	}
}



function mouvementMaSelectionVignette(direction) {
	if (direction=="flecheBasMaSelection" && nbrvignetteMaSelectionplusEncour<nbrvignetteMaSelectionplus) {
		varMaSelectionHaut=varMaSelectionHaut-60;
		nbrvignetteMaSelectionplusEncour++;
		setOpacityetOnclick('flecheHautMaSelection', 1);
	}
	if (direction=="flecheHautMaSelection" && nbrvignetteMaSelectionplusEncour!=0) {
		varMaSelectionHaut=varMaSelectionHaut+60;
		nbrvignetteMaSelectionplusEncour--;
		setOpacityetOnclick('flecheBasMaSelection', 1);
	}
	if (nbrvignetteMaSelectionplusEncour==nbrvignetteMaSelectionplus) {
		setOpacityetOnclick('flecheBasMaSelection', 0.1);
	}
	if (nbrvignetteMaSelectionplusEncour==0) {
		setOpacityetOnclick('flecheHautMaSelection', 0.1);
	}
	if (nbrvignetteMaSelectionplusEncour<=nbrvignetteMaSelectionplus) {
		$('#ulMaSelection').animate( {top : varMaSelectionHaut+'px'},100);
		
	}
	
}


function mouvementPanierVignette (direction) {
	if (direction=="flecheBasPanier" && nbrvignettePanierplusEncour<nbrvignettePanierplus) {
		varPanierHaut=varPanierHaut-60;
		nbrvignettePanierplusEncour++;
		setOpacityetOnclick('flecheHautPanier', 1);
	}
	if (direction=="flecheHautPanier" && nbrvignettePanierplusEncour!=0) {
		varPanierHaut=varPanierHaut+60;
		nbrvignettePanierplusEncour--;
		setOpacityetOnclick('flecheBasPanier', 1);
	}
	if (nbrvignettePanierplusEncour==nbrvignettePanierplus) {
		setOpacityetOnclick('flecheBasPanier', 0.1);
	}
	if (nbrvignettePanierplusEncour==0) {
		setOpacityetOnclick('flecheHautPanier', 0.1);
	}
	if (nbrvignettePanierplusEncour<=nbrvignettePanierplus) {
		$('#ulPanier').animate( {top : varPanierHaut+'px'},100);
		
	}
	
}

function evalPerso(div, html) {
	if (div!="") {
		$(div).innerHTML = html;
		scripts = document.getElementById(div).getElementsByTagName("script");
		for(var i=0;i<scripts.length;i++){
		   eval(scripts[i].innerHTML);
		}
	}
}


function verifMail(z) {
	var reg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$/
	if (reg.exec(z)==null){
		return false;
	}else{
		return true;
	}
}


function displayOnOff(id) {
	if (document.getElementById(id).style.display=='none') {
		document.getElementById(id).style.display='block';
	}else{
		document.getElementById(id).style.display='none';
	} 
}

function displayOn(id) {
	document.getElementById(id).style.display='block';
}

function displayOff(id) {
	document.getElementById(id).style.display='none';
}

function displayOnOffTab(id) {
	if (document.getElementById(id).style.display=='none') {
		if (jQuery.browser.msie) {
			document.getElementById(id).style.display='block';
		}else{
			document.getElementById(id).style.display='table-row';
		}
	}else{
		document.getElementById(id).style.display='none';
	} 
}


//////////////////////////////////////// panier ////////////////////////////////////////
function recharge (validCommande) {
	
	if (document.getElementById("facSociete")) {
		facSociete=document.formadresse.facSociete.value;
	}else{
		facSociete="";
	}
	if (document.getElementById("livSociete")) {
		livSociete=document.formadresse.livSociete.value;
	}else{
		livSociete="";
	}
	
	$.get('includes/inc_tableau_panier.php', {validCommande : validCommande, livNom : document.formadresse.livNom.value, livPrenom : document.formadresse.livPrenom.value, livAdresse : document.formadresse.livAdresse.value, livCP : document.formadresse.livCP.value, livVille : document.formadresse.livVille.value, livIdPays : document.formadresse.livIdPays.value, facNom : document.formadresse.facNom.value, facPrenom : document.formadresse.facPrenom.value, facAdresse : document.formadresse.facAdresse.value, facCP : document.formadresse.facCP.value, facVille : document.formadresse.facVille.value, facIdPays : document.formadresse.facIdPays.value, livraison : document.formadresse.livraison.value, livSociete : livSociete, facSociete : facSociete}, function(html){document.getElementById('tableauPanier').innerHTML=html;} );
}
//////////////////////////////////////// panier ////////////////////////////////////////

// menu ie6

function activeMenu(){
	var tabItems = $('.menu_item');
	var nbr = tabItems.length;
	//alert(nbr)
	for(var i=0;i<nbr;i++){
		tabItems[i].id = i;
		tabItems[i].onmouseover = function(){
			$('#sousm'+this.id)[0].style.display ='block';
		}
		tabItems[i].onmouseout = function(){
			$('#sousm'+this.id)[0].style.display='none';
		}
	}
}


