
function FadeE(page)
{
	FadeOpacity('column', 0, 100, 2, 20000, "a");
	FadeOpacity('ptitle', 0, 100, 2, 20000, "d");
	if(page == "home")
	{
		FadeOpacity('firm', 0, 100, 2, 20000, "home");
	}
}

function SetOpacity(elem, opacityAsInt)
{
	var opacityAsDecimal = opacityAsInt;
	
	if (opacityAsInt > 100)
		opacityAsInt = opacityAsDecimal = 100; 
	else if (opacityAsInt < 0)
		opacityAsInt = opacityAsDecimal = 0; 
	
	opacityAsDecimal /= 100;
	if (opacityAsInt < 1)
		opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
	
	elem.style.opacity = opacityAsDecimal;
	elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}

function FadeOpacity(elemId, fromOpacity, toOpacity, time, fps, page)
{
	var steps = Math.ceil(fps * (time / 1000));
	var delta = (toOpacity - fromOpacity) / steps;

	FadeOpacityStep(elemId, 0, steps, fromOpacity, delta, (time / steps), page);
}

function FadeOpacityStep(elemId, stepNum, steps, fromOpacity, delta, timePerStep, page)
{
	
    SetOpacity(document.getElementById(elemId), Math.round(parseInt(fromOpacity) + (delta * stepNum)));

    if (stepNum < steps){
        setTimeout("FadeOpacityStep('" + elemId + "', " + (stepNum+1) + ", " + steps + ", " + fromOpacity + ", " + delta + ", " + timePerStep + ", '" + page + "');", timePerStep);
    }
    else if (stepNum >= steps && page == "home"){
    	startFade();
    	/*
    	  $(function() {
    $('#fadeloop').crossSlide({
      sleep: 2,
      fade: 1
    }, [
      { src: 'http://67.225.240.111/azaphp/AZALAW/images/OneColumn.jpg' },
      { src: 'http://67.225.240.111/azaphp/AZALAW/images/Court.jpg' },
      { src: 'http://67.225.240.111/azaphp/AZALAW/images/JusticeColumns.jpg' }
    ]);
  });
  */
    }
}

function mouseo(msg)
{
	alert(msg);
}
