/***********************************************
* 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=100
var browserdetect

function slowhigh(which2){
	imgobj=which2
	
	if(which2.filters){
		browserdetect="ie"
	} else if(typeof which2.style.opacity=="string") {
		browserdetect="standar"
	} else if(typeof which2.style.KhtmlOpacity=="string") {
		browserdetect="konqueror"
	}
	
	instantset(baseopacity)
	highlighting=setInterval("gradualfadein(imgobj)",30)
}

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

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

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

function gradualfadeout(cur2){
	if (browserdetect=="standar" && cur2.style.opacity<1)
		cur2.style.opacity=Math.min(parseFloat(cur2.style.opacity)+0.1, 0.99)
	else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=10
	else if (browserdetect=="konqueror" && cur2.style.KhtmlOpacity<1)
		cur2.style.KhtmlOpacity=Math.min(parseFloat(cur2.style.KhtmlOpacity)+0.1, 0.99)
	else if (window.highlighting)
		clearInterval(highlighting)
}

function gradualfadein(cur2){
	if (browserdetect=="standar" && cur2.style.opacity>0.5){
		cur2.style.opacity=Math.min(parseFloat(cur2.style.opacity)-0.1, 0.99)
	}else if (browserdetect=="ie" && cur2.filters.alpha.opacity>50){
		cur2.filters.alpha.opacity-=10
	}else if (browserdetect=="konqueror" && cur2.style.KhtmlOpacity>0.5){
		cur2.style.KhtmlOpacity=Math.min(parseFloat(cur2.style.KhtmlOpacity)-0.1, 0.99)
	}else if (window.highlighting){
		clearInterval(highlighting)
		//instantset(baseopacity)
	}
}
