
// URLs of slides
var chemin= "../img_fam/";
//var chemin= "";
// Ajouter images ici entre guillemets , separées par des virgules .


var slideurl=new Array( 
	"ph_prod_281/ph_prod_1040_v.jpg", 
	"ph_prod_281/ph_prod_1041_v.jpg", 
	"ph_prod_279/ph_prod_1039_v.jpg", 
	"ph_prod_285/ph_prod_1037_v.jpg", 
	"ph_prod_285/ph_prod_1038_v.jpg", 
	"ph_prod_205/ph_prod_1033_v.jpg", 
	"ph_prod_205/ph_prod_1025_v.jpg", 
	"ph_prod_281/ph_prod_1027_v.jpg", 
	"ph_prod_281/ph_prod_1029_v.jpg" 
)


var slideurl_g=new Array( 
	"ph_prod_281/ph_prod_1040_g.jpg", 
	"ph_prod_281/ph_prod_1041_g.jpg", 
	"ph_prod_279/ph_prod_1039_g.jpg", 
	"ph_prod_285/ph_prod_1037_g.jpg", 
	"ph_prod_285/ph_prod_1038_g.jpg", 
	"ph_prod_205/ph_prod_1033_g.jpg", 
	"ph_prod_205/ph_prod_1025_g.jpg", 
	"ph_prod_281/ph_prod_1027_g.jpg", 
	"ph_prod_281/ph_prod_1029_g.jpg" 
)
	



					
					   
// Ajouter les commentaire pour chaque vignette entre guillemets , separées par des virgules .

var slidealt=new Array( 
	"Dolomiti Race Jersey Sportful\n59.0 \u20AC", 
	"Dolomiti Race Cuissard Sportful\n69.0 \u20AC", 
	"Cols des Dolomites \n1650.0 \u20AC", 
	"Energy Source High5\n42.0 \u20AC", 
	"Energy Source 4:1 High5\n53.0 \u20AC", 
	"Argyle Racing Rolosports\n59.0 \u20AC", 
	"Mont-Blanc Rolosports\n59.0 \u20AC", 
	"Pro Zero Dri knicker Men Craft \n30.0 \u20AC", 
	"Pro Zero Wn col ras de cou Craft\n35.0 \u20AC" 

)

					

var prod_id = new Array( 
	"281,1040", 
	"281,1041", 
	"279,1039", 
	"285,1037", 
	"285,1038", 
	"205,1033", 
	"205,1025", 
	"281,1027", 
	"281,1029" 

)


// comments displayed below the slides
//var slidecomment=new Array("ali1","ali2","ali0")

// the width of the slideshow (pixels)
//var scrollerwidth=900  // mettre la largeur voulue
var scrollerwidth=680  // mettre la largeur voulue

// the height of the slideshow (pixels)
var scrollerheight=100 // mettre la hauteur des images.

// font-attributes for the comments
var slidefont="Arial"
var slidefontcolor="blue"
var slidefontsize="2"

// do not edit below this line
var allpicturewidth
var distancepictopic=0
var scrollerleft=0
var scrollertop=0
var pause=1
var step=1
var newstep=step
var clipleft,clipright,cliptop,clipbottom
var i_picture=0
var timer
var picturecontent=""
var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0
var ie=document.all?1:0

var preloadedimages=new Array()
for (i=0;i<slideurl.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=slideurl[i]
}

function init_ins() {
    if (ie) {
		allpicturewidth=document.all.picturediv.offsetWidth
		document.all.picturediv.style.posTop=scrollertop
        document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth
		clipleft=0
		clipright=0
		cliptop=0
		clipbottom=scrollerheight
		document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.all.picturediv.style.visibility="visible"
		scrollpicture()

    }
	if (ns6) {
		allpicturewidth=document.getElementById('emptypicturediv').offsetWidth
		document.getElementById('picturediv').style.top=scrollertop
        document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth
		clipleft=0
		clipright=0
		cliptop=0
		clipbottom=scrollerheight
		document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.getElementById('picturediv').style.visibility="visible"
		scrollpicture()
    }
	if (ns4) {
		allpicturewidth=document.roof.document.picturediv.document.width
		document.roof.document.picturediv.top=scrollertop
		document.roof.document.picturediv.left=scrollerleft+scrollerwidth
		document.roof.document.picturediv.clip.left=0
		document.roof.document.picturediv.clip.right=0
		document.roof.document.picturediv.clip.top=0
		document.roof.document.picturediv.clip.bottom=scrollerheight
		document.roof.document.picturediv.visibility="visible"
        scrollpicture()
    }
}

function scrollpicture() {
    if (ie) {
		if (document.all.picturediv.style.posLeft>=scrollerleft-allpicturewidth) {
			document.all.picturediv.style.posLeft-=step
			clipright+=step
			if (clipright>scrollerwidth) {
				clipleft+=step
			}
			document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			var timer=setTimeout("scrollpicture()",pause)
		}
		else {
			//resetposition()
			setTimeout('scrollpicture_reverse()',3000)
		}
	}
	if (ns6) {
		if (parseInt(document.getElementById('picturediv').style.left)>=scrollerleft-allpicturewidth) {
	document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step
			clipright+=step
			if (clipright>scrollerwidth) {
				clipleft+=step
			}
			document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			var timer=setTimeout("scrollpicture()",pause)
		}
		else {
			resetposition()
		}
	}
   if (ns4) {
		if (document.roof.document.picturediv.left>=scrollerleft-allpicturewidth) {
			document.roof.document.picturediv.left-=step
			document.roof.document.picturediv.clip.right+=step
			if (document.roof.document.picturediv.clip.right>scrollerwidth) {
				document.roof.document.picturediv.clip.left+=step
			}
			var timer=setTimeout("scrollpicture()",pause)
		}
		else {
			resetposition()
		}
	}
}

function scrollpicture_reverse() {
    if (ie) {
		if (document.all.picturediv.style.posLeft<=scrollerwidth) {
			document.all.picturediv.style.posLeft+=step
			clipleft-=step
			if (clipright>scrollerwidth) {
				clipright+=step
			}
			//document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			var timer=setTimeout("scrollpicture_reverse()",pause)
		}
		else {
			resetposition()
		}
	}
	if (ns6) {
		if (parseInt(document.getElementById('picturediv').style.left)>=scrollerleft-allpicturewidth) {
	document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step
			clipright+=step
			if (clipright>scrollerwidth) {
				clipleft+=step
			}
			document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			var timer=setTimeout("scrollpicture()",pause)
		}
		else {
			resetposition()
		}
	}
   if (ns4) {
		if (document.roof.document.picturediv.left>=scrollerleft-allpicturewidth) {
			document.roof.document.picturediv.left-=step
			document.roof.document.picturediv.clip.right+=step
			if (document.roof.document.picturediv.clip.right>scrollerwidth) {
				document.roof.document.picturediv.clip.left+=step
			}
			var timer=setTimeout("scrollpicture()",pause)
		}
		else {
			resetposition()
		}
	}
}

function onmsover(val) {
	step=0
}
function onmsout() {
	step=newstep
}

function resetposition() {
	if (ie) {
        document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth
		clipleft=0
		clipright=0
		document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrollpicture()
	}
	if (ns6) {
		allpicturewidth=document.getElementById('emptypicturediv').offsetWidth
        document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth
		clipleft=0
		clipright=0
		document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrollpicture()
	}
	if (ns4) {
		document.roof.document.picturediv.left=scrollerleft+scrollerwidth
		document.roof.document.picturediv.clip.left=0
		document.roof.document.picturediv.clip.right=0
        scrollpicture()
	}
}

picturecontent=""
picturecontent+="<table cellpadding=1 cellspacing=1 border=0 bgcolor=f0e0d0>"
picturecontent+="<tr>"
for (i=0;i<=slideurl.length-1;i++) {
	picturecontent+="<td bgcolor=ffffff>"
	picturecontent+="<a href='javascript:sh_g_img(\""+chemin+slideurl_g[i]+"\","+prod_id[i]+")' onMouseOver=\"javascript:onmsover(this)\" onMouseOut=\"javascript:onmsout()\" >"
	picturecontent+="<img src=\""+chemin+slideurl[i]+"\" border=0 hspace=10 vspace=10 title='"+slidealt[i]+"'></a>"
	picturecontent+="</td>"
}

picturecontent+="</tr></table>"

if (ie || ns6) {
	document.write('<div style="position:relative;width:'+scrollerwidth+'px;height:'+scrollerheight+'px;overflow:hidden">')
	document.write('<div id="picturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>')
	document.write('</div>')
	document.write('<div id="emptypicturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>')
}
	
// mouse position functions
var tempX,tempY,x,y
function getMouseXY(e) {  
	var IE = document.all?true:false 
	// If NS -- that is, !IE -- then set up for mouse capture
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	if (IE) { 
	// grab the x-y pos.s if browser is IE    
	tempX = event.clientX + document.body.scrollLeft    
	tempY = event.clientY + document.body.scrollTop  
	} 
	else {  
	// grab the x-y pos.s if browser is NS    
	tempX = e.pageX    
	tempY = e.pageY  
	}    
	// catch possible negative values in NS4  
	if (tempX < 0){tempX = 0}  
	if (tempY < 0){tempY = 0}    
	return true
}

function sh_g_img(val,fam,prod) {

	url="../boutique/show_produit.cfm?fam_id="+fam+"&id_prod="+prod
	x=tempX
	y=tempY

	document.getElementById('grande_image_div').style.visibility='visible'
	document.getElementById('grande_image').src=val
	document.getElementById('href_img').href=url
	document.getElementById('href_img_2').href=url
	document.getElementById('grande_image_div').style.left=x
	document.getElementById('grande_image_div').style.top=y

	move_img()
}

var nb_step=30
var x_step,y_step
function move_img() {
	pos_x=(screen.width/2)-200
	if (pos_x <= x) x_gap=x-pos_x
	else x_gap=pos_x-x
	x_step=x_gap/nb_step
	x_step=parseInt(x_step,10)
	y_step=430/nb_step
	y_step=parseInt(y_step,10)
	setTimeout('move_img_step()',10)
}

function move_img_step() {
	if (nb_step >= 0) {
		current_x=document.getElementById('grande_image_div').style.left
		current_x=current_x.substring(0,current_x.length-2)
		current_y=document.getElementById('grande_image_div').style.top
		current_y=current_y.substring(0,current_y.length-2)
		if (pos_x <= x) {
			new_x=current_x-x_step
			document.getElementById('grande_image_div').style.left=new_x
		}
		else { 
			new_x=current_x+x_step
			document.getElementById('grande_image_div').style.left=new_x
		}
		new_y=current_y-y_step
		document.getElementById('grande_image_div').style.top=new_y
		nb_step=nb_step-1
		setTimeout('move_img_step()',10)
	}
	else nb_step=30
}

function hi_g_div_img() {
	document.getElementById('grande_image_div').style.visibility='hidden'
	document.getElementById('grande_image').src=''
}

	 //document.write(picturecontent) // this verify the display of images



