
// Code by James Kirkbright 04.04.05


function fade(which, start, end, interval, fade1){

	obj2344 = which

	browserdetect=obj2344.filters? "ie" : typeof obj2344.style.MozOpacity=="string"? "mozilla" : ""

	if (start < end) instantset(start, obj2344)
	else instantset2(start, obj2344)

	highlighting=setInterval("gradualfade(obj2344, " + start + ", " + end + ", " + interval + ", " + fade1 + ")", 1)
}


function instantset(degree, obj2344){

	if (browserdetect=="mozilla")
	obj2344.style.MozOpacity=0.01
	else if (browserdetect=="ie")
	obj2344.filters.alpha.opacity=degree
}

function instantset2(degree, obj2344){

	if (browserdetect=="mozilla")
	obj2344.style.MozOpacity=0.9
	else if (browserdetect=="ie")
	obj2344.filters.alpha.opacity=degree
}



function gradualfade(obj2344, start, end, interval, fade1){

	if (start < end)
	{
		if (browserdetect=="mozilla" && obj2344.style.MozOpacity<0.9)
		obj2344.style.MozOpacity=Math.min(parseFloat(obj2344.style.MozOpacity)+(interval/100 + 0.02), end - 0.01)

		else if (browserdetect=="ie" && obj2344.filters.alpha.opacity<end)
		obj2344.filters.alpha.opacity+=interval

		else { 
			clearInterval(highlighting)
			obj2344.style.MozOpacity=0.99

			document.body.style.cursor = 'default'

		}
	
	}

	else
	{
		if (browserdetect=="mozilla" && obj2344.style.MozOpacity>0)
		obj2344.style.MozOpacity=Math.min(parseFloat(obj2344.style.MozOpacity)-(interval/100 + 0.02), end + 0.01)

		else if (browserdetect=="ie" && obj2344.filters.alpha.opacity>end)
		obj2344.filters.alpha.opacity-=interval

		else { 
			clearInterval(highlighting)
			obj2344.style.MozOpacity=0
		}
					
	}

}

