



if (document.images) {
	// TRy preloading the images, to avoid a delay	 when clicking the javascript
	minImage = new Image;
	plusImage = new Image;
	minImage.src = "/_img/icons/min.gif";
	plusImage.src = "/_img/icons/plus.gif";
}
function checkStock(Current, Max) {
	if (Current > Max) {
		alert('D?sol?, vous ne pouvez pas commander plus de ' + Max + ' unit?s de cet article');
		return Max;
	} else {
		return Current;
	}
}

function popwindow(name, url, width, height, toolbar, menubar, statusbar, scrollbar, resizable) {
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;


	var posLeft=0;
	var posTop=0;

	top =  ((h-(scrHeight/lift)-adj)/2);
	left = ((w-(scrWidth)-adj)/2);

	toolbar_str = toolbar ? 'yes' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}



function ShopToggle(spanId) {
	if (document.getElementById) {
		currentStyle 			= document.getElementById(spanId).style;
		currentStyle.display 		= (currentStyle.display == "block")? "none" : "block";
		if (document.images) {
			newImage						= (currentStyle.display == "none") ? "plusImage.src" : "minImage.src";
			currentImage 				= spanId + 'img';
			if (currentImage != 'img') { 
				document[currentImage].src 	= eval(newImage);
			}
		}
	}
}	

