function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.filter = "alpha(opacity=" + opacity + ")";
	object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    
} 






// The following is for alpha blending of images

var delay=50;
var ie = (navigator.appVersion.indexOf("MSIE")>=0)?true:false;


function jsaim_getDA() {
  var defal=30;
  return (navigator.appVersion.indexOf("MSIE")>=0)?defal:defal/100;
}

function jsaim_delim(ddd) {
  if (ddd==1) return "&nbsp;";
  else if (ddd==2) return "<br>";
  else return "";
}

function jsaim_on(cur2){
	if (window.highlight) clearTimeout(highlight);
	myobject = cur2;
	shine(myobject);	
}

function jsaim_off(which2){
	clearTimeout(highlight);
	if (ie) which2.filters.alpha.opacity=jsaim_getDA(); else which2.style.MozOpacity=jsaim_getDA();
}

function shine(cur2) {
	var ca;
	ca = (ie)?parseInt(cur2.filters.alpha.opacity):cur2.style.MozOpacity*100;
	ca+=5; if (ca>99) ca=100;
	if (ie) cur2.filters.alpha.opacity=ca; else cur2.style.MozOpacity = ca/100;
	myobject = cur2;
	highlight = setTimeout("shine(myobject);",delay);
}
