function number_format(valeur,decimal,separateur)
{
// formate un chiffre avec 'decimal' chiffres après la virgule et un separateur
	var deci=Math.round( Math.pow(10,decimal)*(Math.abs(valeur)-Math.floor(Math.abs(valeur))));
	var val=Math.floor(Math.abs(valeur));
	if ((decimal==0)||(deci==Math.pow(10,decimal)))
	{
		val=Math.floor(Math.abs(valeur)); deci=0;
	}
	var val_format=val+"";
	var nb=val_format.length;
	for (var i=1;i<4;i++)
	{
		if (val>=Math.pow(10,(3*i)))
		{
			val_format=val_format.substring(0,nb-(3*i))+separateur+val_format.substring(nb-(3*i));
		}
	}
	if (decimal>0)
	{
		var decim="";
		for (var j=0;j<(decimal-deci.toString().length);j++)
		{
			decim+="0";
		}
		deci=decim+deci.toString();
		val_format=val_format+"."+deci;
	}
	if (parseFloat(valeur)<0)
	{
		val_format="-"+val_format;
	}
	return val_format;
}
function preloadImages()
{
	if(document.images)
	{
		if(!document.imageArray) document.imageArray = new Array();
		var i,j = document.imageArray.length, args = preloadImages.arguments;
		for(i=0; i<args.length; i++)
		{
			if (args[i].indexOf("#")!=0)
			{
				document.imageArray[j] = new Image;
				document.imageArray[j++].src = args[i];
			}
		}
	}
}
//preloadImages("http://images.grosbill.com/i/hkd.gif","http://images.grosbill.com/i/fdkd.gif","http://images.grosbill.com/i/cv.gif","http://images.grosbill.com/i/tc.gif","http://images.grosbill.com/i/cv.gif");
var dispstatus=0;
var dispinit=0;
var dispdel=0;
var dispotimer;
function showdispovideo(st,nb,fichier,larg,haut)
{
	var buffer_disp = '';
	var nbitem = 0;
	window.clearTimeout(dispotimer);
	//window.setTimeout('hidedispo(1)', 2000);
	dispdel = 0;
	if(dispstatus < 1 || dispinit < 1)
	{
		var dispb=document.getElementById('dispbarre');
	}
	if(st > 0 && dispstatus < 1)
	{
		var dispodiv=document.getElementById('dyndispoplace'+nb);
		var c = getAnchorPosition('dispopos'+nb);
		if (navigator.appName !='Netscape')
		{
			dispodiv.style.left = eval(c.x+50)+'px';
			dispodiv.style.top = eval(c.y+0)+'px';
		}
		else
		{
			dispodiv.style.left = eval(c.x-50)+'px';
			dispodiv.style.top = eval(c.y)+'px';
		}
		dispodiv.style.height='';
		//dispodiv.style.width='255px';
		dispodiv.innerHTML='';
		dispodiv.style.visibility='visible';
		dispodiv.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="'+haut+'" height="'+larg+'">          <param name="movie" value="'+fichier+'">          <param name="quality" value="high">          <embed src="'+fichier+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"  width="'+haut+'" height="'+larg+'></embed>        </object>';
		dispstatus=1;
	}
}
function hidedispovideo(ht,nb2,fichier,larg,haut)
{
	if(ht > 0 && dispstatus > 0 && dispdel > 0)
	{
		for (toto = 1; toto <= nb2; toto++)
		{
			if (document.getElementById('dyndispoplace'+toto))
			{
				var dispodiv=document.getElementById('dyndispoplace'+toto);
				dispodiv.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+haut+'" height="'+larg+'>          <param name="movie" value="'+fichier+'">          <param name="quality" value="high">          <embed src="'+fichier+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+larg+'" height="'+haut+'"></embed>        </object>';
				dispodiv.style.visibility='hidden';
				dispodiv.style.height='0px';
				dispodiv.style.width='0px';
				dispstatus=0;
				dispdel=0;
			}
		}
	}
	else if(dispstatus > 0)
	{
		dispotimer=window.setTimeout('hidedispovideo(1,'+nb2+')', 000);
		dispdel = 1;
	}
}
var ev1 = '';
if(isNaN(parseInt(versionstat)))
{
	var versionstat = 1;
}
if(isNaN(parseInt(etapestat)))
{
	var etapestat = 0;
}
if(isNaN(parseInt(idproduitstat)))
{
	var idproduitstat = 0;
}
var com = '';
var listeid = '';
function MM_swapImgRestore()
//v3.0
{
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function setCookie(name, value, expires, path, domain, secure)
{
	document.cookie= name + "=" + escape(value) +
	((expires) ? "; expires=" + expires : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}
//var provenance=parent.main.location+'';
var provenance=document.referrer;
if(provenance.indexOf('monpanierv2')==-1 && provenance.indexOf('commande')==-1 && provenance.indexOf('grosbill')>0 && provenance.indexOf('optin')==-1)
{
	setCookie('provenance',provenance,'Sat, 28-Nov-20 20:00:01 GMT','/','grosbill.com','');
}
else
{
	setCookie('provenance','http://www.grosbill.com','Sat, 28-Nov-20 20:00:01 GMT','/','grosbill.com','');
}
function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
	{
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
	{
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain)
{
	if (getCookie(name))
	{
		/*document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";Sat, 28-Nov-20 20:00:01 GMT*/
		setCookie(name, '', 'Thu, 01-Jan-70 00:00:01 GMT', path, domain);
	}
}
function MM_swapImage()
//v3.0
{
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages()
//v3.0
{
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function preloadImages()
{
	if(document.images)
	{
		if(!document.imageArray) document.imageArray = new Array();
		var i,j = document.imageArray.length, args = preloadImages.arguments;
		for(i=0; i<args.length; i++)
		{
			if (args[i].indexOf("#")!=0)
			{
				document.imageArray[j] = new Image;
				document.imageArray[j++].src = args[i];
			}
		}
	}
}
function buildcamgbm()
{
	var tmp1=MM_findObj('filtre1');
	var tmp2=MM_findObj('filtre2');
	var tmp3=MM_findObj('filtre3');
	var tmp4=MM_findObj('filtre4');
	var tmp5=MM_findObj('filtre5');
	var tmp=MM_findObj('p1');
	tmp.value=tmp1.options[tmp1.selectedIndex].value+"+"+tmp2.options[tmp2.selectedIndex].value+"+"+tmp3.options[tmp3.selectedIndex].value+"+"+tmp4.options[tmp4.selectedIndex].value;
}
function MM_findObj(n, d)
//v4.01
{
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_jumpMenu(targ,selObj,restore)
//v3.0
{
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
function findObj(theObj, theDoc)
{
	var p, i, foundObj;
	if(!theDoc) theDoc = document;
	if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
	{
		theDoc = parent.frames[theObj.substring(p+1)].document;
		theObj = theObj.substring(0,p);
	}
	if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
	for (i=0; !foundObj && i < theDoc.forms.length; i++)
	foundObj = theDoc.forms[i][theObj];
	for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
	foundObj = findObj(theObj,theDoc.layers[i].document);
	if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
	return foundObj;
}
function preloadImages()
{
	if(document.images)
	{
		if(!document.imageArray) document.imageArray = new Array();
		var i,j = document.imageArray.length, args = preloadImages.arguments;
		for(i=0; i<args.length; i++)
		{
			if (args[i].indexOf("#")!=0)
			{
				document.imageArray[j] = new Image;
				document.imageArray[j++].src = args[i];
			}
		}
	}
}
function buyItem(newItem, newPrice, newPort,newID,newQuantity)
{
	// deleteCookie('TheBasket','/', 'grosbill.com');
	if ( newQuantity <= 0 )
	{
		rc = alert('La quantitï¿½ spï¿½cifiï¿½e est incorrecte !');
	}
	else if (confirm('Ajouter '+newQuantity+' fois le produit '+newItem+' dans votre caddie ?'))
	{
		rbuyItem(newItem, newPrice, newPort,newID,newQuantity)
	}
	//document.itemsform.image_caddie.src='/intitule5.php3?a='+totprice;
	//document.itemsform.image_caddie.alt=''+totoalt;
}
function rbuyItem(newItem, newPrice, newPort,newID,newQuantity)
{
	{
		index = document.cookie.indexOf('TheBasket');
		countbegin = (document.cookie.indexOf('=', index) + 1);
		countend = document.cookie.indexOf(';', index);
		if (countend == -1)
		{
			countend = document.cookie.length+1;
		}
		var itemstart=0;
		moreItem=true;
		toto='TheBasket=';
		totoalt='';
		var fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++)
		{
			if (fulllist.substring(i,i+1) == '[')
			{
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == ']')
			{
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				totprice=itemtotal+totprice;
				temptotal = itemtotal * 100;
				itemlist=itemlist+1;
				qtemp=0;
				qtemp2=0;
				qtemp=parseInt(thequantity);
				qtemp2=parseInt(thequantity2);
				qtemp3=qtemp2+qtemp;
				indextoto = toto.indexOf('TheBasket');
				countbegintoto = (toto.indexOf('=', indextoto) + 1);
				countendtoto = toto.indexOf(';', indextoto);
				if (countendtoto == -1)
				{
					countendtoto = toto.length;
				}
				toto='TheBasket='+toto.substring(countbegintoto, countendtoto)+'['+theitem+','+theprice+'#'+theport+'!'+theiditem+'|'+qtemp3+']';
				totoalt = totoalt+' '+qtemp3+'x '+theitem+'\r\n';
			}
			else if (fulllist.substring(i,i+1) == ',')
			{
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == '#')
			{
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == '!')
			{
				theport = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == '|')
			{
				theiditem = fulllist.substring(itemstart, i);
				if (newID == theiditem )
				{
					thequantity2 = newQuantity;
					moreItem=false;
				}
				else
				{
					thequantity2 = 0;
				}
				itemstart = i+1;
			}
		}
		indextoto = toto.indexOf('TheBasket');
		countbegintoto = (toto.indexOf('=', indextoto) + 1);
		countendtoto = toto.indexOf(';', indextoto);
		if (countendtoto == -1)
		{
			countendtoto = toto.length;
		}
		if (moreItem)
		{
			document.cookie='TheBasket='+toto.substring(countbegintoto, countendtoto)+'['+newItem+','+newPrice+'#'+newPort+'!'+newID+'|'+newQuantity+']'+';path=/'+';domain=grosbill.com';
			totoalt = totoalt+' '+newQuantity+'x '+newItem+'\r\n';
		}
		else
		{
			document.cookie='TheBasket='+toto.substring(countbegintoto, countendtoto)+';path=/'+';domain=grosbill.com';;
		}
	}
	calc_minipanier();
}
function resetShoppingBasket()
{
	index = document.cookie.indexOf('TheBasket');
	document.cookie='TheBasket=.';
}
function popUp(page,name,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,name,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function buyItem2(newItem, newPrice, newPort,newID,newQuantity)
{
	rbuyItem(newItem, newPrice, newPort,newID,newQuantity);
	location='http://www.grosbill.com/monpanierv2.php3?b='+Stamp.getMinutes()+Stamp.getSeconds();
}
// Ma'ndien KAKEZ - créé le 29/07/2008
function b4u(newItem, newPrice, newPort,newID,newQuantity) 
{
	rbuyItem(newItem, newPrice, newPort,newID,newQuantity);
	location = 'http://www.grosbill.com/stickers.php3?idb4u='+newID;
}
function resetShoppingBasket()
{
	index = document.cookie.indexOf('TheBasket');
	document.cookie='TheBasket=.';
}
function popUp(page,name,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,name,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function ajoute(pm,name)
{
	nb=document[pm][name].value;
	nb++;
	if (nb>999)
	{
		nb=999;
	}
	document[pm][name].value=nb;
}
function enleve(pm,name)
{
	nb=document[pm][name].value;
	nb--;
	if (nb<1)
	{
		nb=1;
	}
	document[pm][name].value=nb;
}
function MM_reloadPage(init)
{
	if (init==true) with (navigator)
	{
		if ((appName=="Netscape")&&(parseInt(appVersion)==4))
		{
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
var carttime;
var popcontent;
function stringToInteger (inputString)
{
	return parseInt(inputString);
}
function changeAdresse(form)
{
	var valeur=form.livraison.options[form.livraison.selectedIndex].value.valueOf();;
	if (form.livraison.selectedIndex > 0)
	{
		var l=valeur.length;
		var valeurs=valeur.split("#", 11);
		form.livraison_nom.value=valeurs[0];
		form.livraison_prenom.value=valeurs[1];
		form.livraison_societe.value=valeurs[2];
		form.livraison_tel.value=valeurs[3];
		form.livraison_adresse.value=valeurs[4];
		form.livraison_codepostal.value=valeurs[5];
		form.livraison_ville.value=valeurs[6];
		//civilite / typeclient /pays
	}
}
function gbm_switchclienttype(type,fieldtype)
{
	if(fieldtype=="client")
	{
		var tmpclientsoc=findObj("client_societe");
		if(type!="entreprise")
		{
			tmpclientsoc.disabled=true;
		}
		else
		{
			tmpclientsoc.disabled=false;
		}
	}
	else
	{
		var tmpclientsoc=findObj("livraison_societe");
		if(type!="entreprise")
		{
			tmpclientsoc.disabled=true;
		}
		else
		{
			tmpclientsoc.disabled=false;
		}
	}
}
function quickaredirect()
{
	this.document.location=this.document.location+'#hautcat';
}
function alterError(value)
{
	if (value<=0.99)
	{
		newPounds = '0';
	}
	else
	{
		newPounds = parseInt(value);
	}
	newPence = parseInt((value+.0008 - newPounds)* 100);
	if (eval(newPence) <= 9) newPence='0'+newPence;
	newString = newPounds + '.' + newPence;
	return (newString);
}
var totprice;
function showItems()
{
	index = document.cookie.indexOf("TheBasket");
	countbegin = (document.cookie.indexOf("=", index) + 1);
	countend = document.cookie.indexOf(";", index);
	if (countend == -1)
	{
		countend = document.cookie.length;
	}
	fulllist = document.cookie.substring(countbegin, countend);
	totprice = 0;
	totport  = 0;
	totqt_mini = 0;
	if (fulllist.length>10){}
	itemlist = 0;
	var itemstart=0;
	for (var i = 0; i <= fulllist.length; i++)
	{
		if (fulllist.substring(i,i+1) == '[')
		{
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == ']')
		{
			itemend = i;
			thequantity = fulllist.substring(itemstart, itemend);
			itemtotal = 0;
			itemtotal = (eval(theprice*thequantity));
			temptotal = itemtotal * 100;
			porttotal = 0;
			porttotal = (eval(theport*thequantity));
			thequantitytemp = eval(thequantity);
			totport  = totport + porttotal;
			totprice = totprice + itemtotal;
			totqt_mini = totqt_mini + thequantitytemp;
			itemlist=itemlist+1;
		}
		else if (fulllist.substring(i,i+1) == ',')
		{
			theitem = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '#')
		{
			theprice = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '!')
		{
			theport = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '|')
		{
			theID = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
	}
}
function removeItem(itemno)
{
	newItemList = null;
	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++)
	{
		if (fulllist.substring(i,i+1) == '[')
		{
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '|')
		{
			qpos= i;
			qstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == ']')
		{
			itemend = i;
			theitem = fulllist.substring(itemstart, itemend);
			thequantity = fulllist.substring(qstart, itemend);
			itemlist=itemlist+1;
			if (itemlist != itemno)
			{
				newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
			}
			else if (thequantity>1)
			{
				thequantity--;
				newItemList = newItemList + '[' + fulllist.substring(itemstart,qstart) + thequantity + ']';
				var tmp_quantity=findObj('quantity_'+itemno);
				tmp_quantity.value--;
			}
			else if (thequantity==1)
			{
				//removeItem2(itemno);
				//location = "monpanier.php3";
			}
		}
	}
	index = document.cookie.indexOf("TheBasket");
	document.cookie="TheBasket="+newItemList+';path=/'+';domain=grosbill.com';;
	location = "http://www.grosbill.com/monpanierv2.php3?b="+Stamp.getMinutes()+Stamp.getSeconds();
}
function removeItem2(itemno)
{
	newItemList = null;
	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++)
	{
		if (fulllist.substring(i,i+1) == '[')
		{
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '|')
		{
			qpos= i;
			qstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == ']')
		{
			itemend = i;
			theitem = fulllist.substring(itemstart, itemend);
			thequantity = fulllist.substring(qstart, itemend);
			itemlist=itemlist+1;
			if (itemlist != itemno)
			{
				newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
			}
		}
	}
	index = document.cookie.indexOf("TheBasket");
	document.cookie="TheBasket="+newItemList+';path=/'+';domain=grosbill.com';;
	location = "http://www.grosbill.com/monpanierv2.php3?b="+Stamp.getMinutes()+Stamp.getSeconds();
}
function addItem(itemno)
{
	newItemList = null;
	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++)
	{
		if (fulllist.substring(i,i+1) == '[')
		{
			itemstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == '|')
		{
			qpos= i;
			qstart = i+1;
		}
		else if (fulllist.substring(i,i+1) == ']')
		{
			itemend = i;
			theitem = fulllist.substring(itemstart, itemend);
			thequantity = fulllist.substring(qstart, itemend);
			itemlist=itemlist+1;
			if (itemlist != itemno)
			{
				newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
			}
			else if (thequantity<999)
			{
				thequantity++;
				newItemList = newItemList + '[' + fulllist.substring(itemstart,qstart) + thequantity + ']';
				var tmp_quantity=findObj('quantity_'+itemno);
				tmp_quantity.value++;
			}
		}
	}
	index = document.cookie.indexOf("TheBasket");
	document.cookie="TheBasket="+newItemList+';path=/'+';domain=grosbill.com';;
	location = "http://www.grosbill.com/monpanierv2.php3?b="+Stamp.getMinutes()+Stamp.getSeconds();
	//showItems();
}
function clearBasket()
{
	index = document.cookie.indexOf("TheBasket");
	document.cookie='TheBasket=;path=/'+';domain=grosbill.com';
	location = "http://www.grosbill.com/monpanierv2.php3?b="+Stamp.getMinutes()+Stamp.getSeconds();
}
Stamp = new Date();
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
Mins = Stamp.getMinutes();
if (Mins < 10)
{
	Mins = "0" + Mins;
}
var toto=Stamp.getDate()+""+(Stamp.getMonth() + 1)+""+Stamp.getYear() + Hours +  Mins + Math.round(Math.random()*10000000000000000);
function buyItemlocation(newItem, newPrice, newPort,newID,newQuantity,url)
{
	rbuyItem(newItem, newPrice, newPort,newID,newQuantity);
	location=url;
}
// Variable contenant les informations du moteur de recherche du site (rï¿½cupï¿½rï¿½ par trackingspeed.js)
var pgtimer;
var pgspeed=2;
function pg_move(type)
{
	okscroll=0;
	var lay=document.getElementById('prodgallery_content');
	var lay2=document.getElementById('prodgallery');
	var tmpl=parseInt(lay.style.left)+pgspeed;
	var tmpw=parseInt(lay.style.width);
	var tmpw2=parseInt(lay2.style.width);
	if(tmpl<1 && tmpl>((tmpw-tmpw2)*-1))
	{
		okscroll=1;
	}
	if(type>0 && okscroll>0)
	{
		lay.style.left=tmpl +'px';
	}
	else
	{
		if(type>0)
		{
			clearInterval(pgtimer);
			//alert(tmpw+'-'+tmpl);
		}
	}
	if(type<1)
	{
		pgtimer=setInterval('pg_move(1)',25);
	}
}
// **************************************************
// * MK - 080814     pg_move2(type)                 *
// **************************************************
var pgtimer;
var pgspeed=2;
function pg_move2(type, id_div1, id_div2)
{
	window.alert("Salut");
}
//JP071016 - barre de recherche
function check_client()
{
	if (getCookie("identification"))
	//si loggé
	{
		document.getElementById("client_out").style.display = "none";
		document.getElementById("client_out").style.visibility = "hidden";
		document.getElementById("client_in").style.display = "block";
		document.getElementById("client_in").style.visibility = "visible";
	}
	else
	//si pas loggé
	{
		document.getElementById("client_in").style.display = "none";
		document.getElementById("client_in").style.visibility = "hidden";
		document.getElementById("client_out").style.display = "block";
		document.getElementById("client_out").style.visibility = "visible";
	}
}
function popUpCentrer (page, largeur, hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
//JP071105 - check ie6
function lookout()
{
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	if(!itsAllGood)
	{
		var iesixcheck = "ko";
		return iesixcheck;
	}
	if(typeof document.body.style.maxHeight != 'undefined')
	{
		var iesixcheck = "ko";
		return iesixcheck;
	}
	else
	{
		var iesixcheck = "ok";
		return iesixcheck;
	}
}
//SI MAGASIN, on efface les infos clients au bout de 5 mn
if(parseInt(getCookie('ismagasin'))>0)
{
	function redirection_effacement_cookies()
	{
		location.href="http://www.grosbill.com/h/reset_infos_mag.php";
	}
	//JP071210	setTimeout("redirection_effacement_cookies();", 300000);
}
//flash JP071214
function flash(tag)
{
	document.write(tag);
}
//JP080318 - detection flash firefox
var flashinstalled = 0; 
MSDetect = "false";
if (navigator.mimeTypes && navigator.mimeTypes.length) 
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin) flashinstalled = 2;
	else flashinstalled = 1; 
}
else
{
	MSDetect = "true";
}
//JP080325 - campagne bannieers
sas_tmstp=Math.round(Math.random()*10000000000);sas_masterflag=1;
function SmartAdServer(sas_pageid,sas_formatid,sas_target)
{
	if (sas_masterflag==1)
	{
		sas_masterflag=0;sas_master='M';
	}
	else
	{
		sas_master='S';
	};
	document.write('<scr'+'ipt src="http://www.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></scr'+'ipt>');
}
function voir_nav(nav)
{
	AjaxRequest.get(
	{
		'url':'/gen/nav_pub/t'+nav+'.htm'
		,'onSuccess':function(req) 
		{
			var result;
			result=req.responseText;
			var nom_div = 'div_voir_nav_'+nav;
			document.getElementById(nom_div).innerHTML=result;
		}
	})
}
// Sets cookie value. Expiration date is optional
function setCookie(name, value, expiredays)
{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = name + "=" + escape(value) + ((ExpireDate == null) ? "" : (";expires=" + ExpireDate.toGMTString()));
	//alert("setCookie:"+name+"="+value);
}
// Gets cookie value
function getCookie(name)
{
	var search = name + "=";
	if (document.cookie.length > 0)
	{
	// if there are any cookies
		offset = document.cookie.indexOf(search);
		if (offset != -1) {
		// if cookie exists
			offset += search.length;
		// set index of beginning of value
			end = document.cookie.indexOf(";", offset);
		// set index of end of cookie value
			if (end == -1)end = document.cookie.length;
			//alert("getCookie:"+name+"="+(unescape(document.cookie.substring(offset, end))));
			return unescape(document.cookie.substring(offset, end));
		}
	}
}
// Delete a cookie by setting a past expiration date
function deleteCookie(name)
{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() - (24 * 3600 * 1000));
	document.cookie = name + "=" + "expired" + ";expires=" + ExpireDate.toGMTString();
	//alert("deleteCookie:"+name);
}
function writeCookie(name, value)
{
	document.cookie = name + "=" + value;
}
function readCookie(name)
{
	var search = name + "=";
	if (document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1)end = document.cookie.length;
			return document.cookie.substring(offset, end);
		}
	}
}
function redirigeIframeOney(val1,val2,rep3,rep1,rep5,rep4,rep2)
{
	var a='/'+rep2+'/'+rep3+'.'+rep4+'?'+rep5+'='+val1+'&'+rep1+'='+val2+'';
	document.write(a);
}
var conciergerie = {
	_base16: "0A12B34C56D78E9F",
	_baseClassName:"ob",
	encode: function (str)
	{
		var retour="";
		for(var i=0;i<str.length;i++)
		{
			var cc=str.charCodeAt(i);
			var ch=cc>>4;
			var cl=cc-(ch*16);
			retour+=this._base16[ch]+this._base16[cl];
		}
		return this._baseClassName+retour;
	},
	decode: function (str)
	{
		var retour="";
		for(var i=0;i<str.length;i+=2)
		{
			var ch=this._base16.indexOf(str.charAt(i));
			var cl=this._base16.indexOf(str.charAt(i+1));
			retour+=String.fromCharCode((ch*16)+cl);
		}
		return retour;
	},
	init: function ()
	{
		var tagsA=document.getElementsByTagName("span");
		for(var i=0;i<tagsA.length;i++)
		{
			if (tagsA[i].className.substring(0,this._baseClassName.length)==this._baseClassName)
			{
				var sClass = "";
				if (tagsA[i].className.indexOf(" ") > 0)
				{
					var aTab = tagsA[i].className.split(" ");
					tagsA[i].className = aTab[0];
					
					for(var j=1;j<aTab.length;j++)
					{
						if (j == 1)
							sClass = sClass+aTab[j];
						else
							sClass = sClass+" "+aTab[j];
					}
				}
				var url=this.decode(tagsA[i].className.substring(2));
				var nlink=document.createElement("a");
				if (url.substring(0,1) == "#")
					url = "#";
				nlink.href=url;
				// traitement de l'attribue onclick
				if (tagsA[i].getAttribute("onclick"))
				{
					if (tagsA[i].getAttribute("onclick").length > 0)
					{
						var urlOnclick = this.decode(tagsA[i].getAttribute("onclick").substring(2));
						tab = urlOnclick.split(";");
						nlink.setAttribute("onclick", tab[0]+';');
					}
				}
				// traitement des attribues
				for(var k=0;k<tagsA[i].attributes.length;k++)
				{
					if ((tagsA[i].attributes[k].name != "onclick") && (tagsA[i].attributes[k].name != "class"))
						nlink.setAttribute(tagsA[i].attributes[k].name, tagsA[i].attributes[k].value);
					// traitement special de l'attribut class
					if (sClass != "")
						nlink.className = sClass;
				}
				// traitement des balises fils
				for(var j=0;j<tagsA[i].childNodes.length;j++)
				{
					nlink.appendChild(tagsA[i].childNodes[j]);
				}
				tagsA[i].appendChild(nlink);
				tagsA[i].className = tagsA[i].className.substring(this._baseClassName.length+1);
			}
		}
	}
}
conciergerie.init();

