if (window.opener!=null && is_actu=='true')
{
	try
	{
		window.opener.location.reload();
	}
	catch(e)
	{
	}
}

function supprimer(numouvrage)
{
	document.forms['panier'].elements['_Action'].value='rem';
	document.forms['panier'].elements['_Ouvrage'].value=numouvrage;
	document.forms['panier'].submit();
}

function rafraichir(numouvrage,valeur)
{
	var valeur_champ = document.forms['panier'].elements[valeur].value;

	if (!isEntier(valeur_champ))
	{
		alert('Vous devez rentrer un nombre positif !');
		return;
	}

	if (parseInt(valeur_champ)==0)
	{
		supprimer(numouvrage);
		return;
	}

	document.forms['panier'].elements['_Action'].value='maj';
	document.forms['panier'].elements['_Ouvrage'].value=numouvrage;
	document.forms['panier'].elements['_Nb'].value = valeur_champ;
	document.forms['panier'].submit();
}

function isEntier(uneChaine)
{
	var reference="1234567890";

	if (uneChaine.length == 0)
		return true;

	for (i = 0 ; i < uneChaine.length; i++)
	{
		caractere = uneChaine.substring(i, i+1);
		if (reference.indexOf(caractere, 0) == -1)
			return false;
	}

	return true;
}

function poursuivre()
{
	if (is_aff_nw == 'true')
	{
		window.close();
	}
	else if (is_affilie == "true")
	{
		accueil();
	}
	else
	{
		var thelink = 'index.php';
		if (url_param != '')
			thelink += '?' + url_param;

		window.location.replace(thelink);
	}
}

function terminer()
{
	if (nbelts==0)
	{
		alert('Votre panier est vide !');
	}
	else
	{
		document.forms['panier'].elements['_Action'].value='val';
		document.forms['panier'].submit();
	}
}

function infoslivr()
{
	var top=(screen.height-400)/2;
	var left=(screen.width-950)/2;
	var thelink = 'page.php?_Type='+id_service+'&_Pop=1';
	if (url_param != '')
		thelink += '&' + url_param;
	thelink += '#MD';

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=950),height=400';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

function pcmd()
{
	var top=(screen.height-400)/2;
	var left=(screen.width-590)/2;
	var thelink = 'page.php?_Type='+id_aide+'&_Pop=1';
	if (url_param != '')
		thelink += '&' + url_param;
	thelink += '#commande';

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=590,height=400';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

function infosbons()
{
	var top=(screen.height-400)/2;
	var left=(screen.width-660)/2;
	var thelink = 'page.php?_Type='+id_coupons_reduc+'&_Pop=1';
	if (url_param != '')
		thelink += '&' + url_param;

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=660,height=400';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

function erreur_coupon()
{
	var top=(screen.height-170)/2;
	var left=(screen.width-600)/2;
	var thelink = 'page.php?_Type=21&_Pop=1';
	if (url_param != '')
		thelink += '&' + url_param;

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=600,height=170';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

