/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=10

function slowhigh(img){
imgobj=img
browserdetect=img.filters? "ie" : typeof img.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",80)
}

function slowlow(img){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur){
if (browserdetect=="mozilla" && cur.style.MozOpacity<1)
cur.style.MozOpacity=Math.min(parseFloat(cur.style.MozOpacity)+0.02, 0.99)
else if (browserdetect=="ie" && cur.filters.alpha.opacity<100)
cur.filters.alpha.opacity+=3
else if (window.highlighting)
clearInterval(highlighting)
}
