/*
Blending Image Slide Show Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com
*/


//change number of images below 
//var numimgs=imatges.length-1

//Nom base
//nombase='../images/Foto_Ofertes_Slide'

//tipus d'imatges
tipusimg='.jpg'

//change speed below (in seconds)
var speed=2
var noimg=0
var step=1
ie=document.all
var imatges=new Array()

function Inislide(base,ims,velocitat)
{
 speed=velocitat
 imact=document.images.slide.src+''
 nombase=base!=''?base:imact.substring(0,imact.length-5)
 numimgs=ims
 for (t=0;t<numimgs;t++)
 {
  imatges[t]=new Image()
  imatges[t].src=nombase+(t+'')+tipusimg
 }
setTimeout("slideit()",velocitat*1000)
}




function slideit()
{
 if (imatges[step].complete || !ie)
 {
  noimg=0;
  if(ie) slidefx=slide.filters[0]
  if (ie){slidefx.apply()}
  document.images.slide.src=imatges[step].src
  if (ie) {slidefx.play()}
 }
 else noimg++;
 if (noimg>2 || !noimg) {noimg=0;step=(step+1)%numimgs}
 setTimeout("slideit()",speed*1000+(ie?2000:0))
}








//Gradual-Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
{which2.style.MozOpacity=0.7;}
else if (which2.filters)
which2.filters.alpha.opacity=70
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.05
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}

