// Fonctions Javascript de gestion du panier

if (parent.frames.length>=1) {
//	window.top.location.href="http://www.alarubriquesport.com/livres/index.html";
}
function isDOM() {
	if (document.getElementById) return true;
	return false;	
}

function augmenter(strID) {
	if (isDOM()) {
		objet = document.getElementById(strID);
		objet.value++;
	}
}
function reduire(strID) {
	if (isDOM()) {
		objet = document.getElementById(strID);
		if (objet.value > 1) {
			objet.value--;
		}
	}
}

function toggle(strID, TF) {
	if (isDOM()) {
		objet = document.getElementById(strID);
		if (TF) objet.style.display = 'none';
		else objet.style.display = 'block';
	}
}

function popup(strURL, strNAME, strOPTS) {
	if (!strOPTS) {
		strOPTS = 'width=600,height=600,toolbar=no,menubar=yes,modal=yes,scrollbars=yes,resizable=yes';
	}
	var w = window.open(strURL, strNAME, strOPTS);
	if (w) w.focus();
	return w;
}

function zoom(strIMG) {
	var w = window.open(strIMG, 'zoom', 'width=500,height=600,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
	if (w) {
		w.focus();
		w.document.writeln('<html>\
	<head>\
		<title>Zoom</title>\
	</head>\
	<body style="margin: 0; padding: 0">\
		<div align="center">\
			<a href="#" onclick="self.close()" title="Cliquez pour fermer la fenêtre"><img src="'+strIMG+'" onload="window.resizeTo(this.width+40, this.height+60)" border="0"></a>\
		</div>\
	</body>\
	</html>');
		return false;
	}
	return true;
	
}

function popdown(strURL) {
	if (window.opener) {
		window.opener.location.href=strURL;
		self.close();
	} else {
		location.href=strURL;
	}
	return true;
}

function upd_command(strURL) {
	if (confirm('Cette action enverra un email à l\'interessé. Vous confirmez ?')) {
		msg = prompt('Souhaitez-vous ajouter un message ? Sinon annulez.', '');
		if (msg) {
			strURL += '&message='+escape(msg);
		}
		return popdown(strURL);
	} else return false;
}

