
function setOpacity(eid, level) {
	element=document.getElementById(eid)
	
	browser=element.filters? "ie" : typeof element.style.MozOpacity=="string"? "mozilla" : ""
	
	if(browser=="mozilla") {
		element.style.MozOpacity=level/100
	} else {
		element.filters.alpha.opacity=level
		element.opacity=level/100
	}
}
function getOpacity(eid) {
	element=document.getElementById(eid)
	browser=element.filters? "ie" : typeof element.style.MozOpacity=="string"? "mozilla" : ""
	var theOpacity = 80
	
	if(browser=="mozilla") {
		theOpacity = element.style.MozOpacity*100
	} else {
		theOpacity = element.filters.alpha.opacity
	}
	return theOpacity
}

function updateFade(eid, amount) {
	var currentFade = getOpacity(eid)
	var newFade = currentFade+amount
	if(newFade<80) {
		newFade = 80
	}
	if(newFade>=100||newFade<=80) {
		clearInterval(highlight)
	}
	setOpacity(eid, newFade)
}

function fadeIn(eid) {
	//clearInterval(highlight)
	imgobj=eid
	highlight=setInterval("updateFade(imgobj, 5)", 50);
}
function fadeOut(eid) {
	//clearInterval(highlight)
	imgobj=eid
	highlight=setInterval("updateFade(imgobj, -5)", 50)
}

/***********************************************
* 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=80

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

function slowlow(which2){
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(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}

function rand(n) {
	return ( Math.floor ( Math.random ( ) * n + 1 ) );
}

function throwMonkeyBone(len) {
	var theBone = '';
	for(var i=0;i<len;i++) {
		if(Math.round(i/50)==i/50) {
			theBone+="<br />";
		}
		var group = rand(3);
		switch(group) {
			case 1: // Numbers
				theBone+=String.fromCharCode(rand(10)+47);
				break;
			case 2: // Caps
				theBone+=String.fromCharCode(rand(26)+64);
				break;
			case 3: // Lowercase
				theBone+=String.fromCharCode(rand(26)+96);
				break;
		}
	}
	theBone+="===";
	return theBone;
}
