

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var opacityTimer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(var i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(opacityTimer * speed));
            opacityTimer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(opacityTimer * speed));
            opacityTimer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 


function headerQuote(){
	opacity("headMessage" + headerQuoteOn, 100, 0, 500);
	headerQuoteOn++;
	if(headerQuoteOn > headerQuoteCount)
		headerQuoteOn = 1;

	setTimeout( "opacity('headMessage' + headerQuoteOn, 0, 100, 500)", 550);
	
}


function testimonialSetUp()
{

	document.getElementById("testimonialDiv_1").style.left = "200px";

	for (var i=2;i<=testimonialCount;i++)
	{
		document.getElementById("testimonialDiv_"+i).style.left= "200px";
	}

}

function testimonials(){
	opacity("testimonialDiv_" + testimonialOn, 100, 0, 500);
	testimonialOn++;
	if(testimonialOn > testimonialCount)
		testimonialOn = 1;

	setTimeout( "opacity('testimonialDiv_' + testimonialOn, 0, 100, 500)", 550);
	
}


function gotoTestimonial(gotoNo){

	clearInterval(testimonialRunner);
	opacity("testimonialDiv_" + testimonialOn, 100, 0, 500);
	testimonialOn = gotoNo;
	setTimeout( "opacity('testimonialDiv_' + testimonialOn, 0, 100, 500)", 550);

	testimonialRunner = setInterval("testimonials()", 7000);
}

function ProgressPage(myForm) {
    found = false;
    for (x=0;x<logName.length;x++) {
        if (logName[x].toLowerCase() == myForm.login_name.value.toLowerCase()) {
            if (logPass[x].toLowerCase() == myForm.login_pword.value.toLowerCase()) {
                found = true;
                document.location.href = 'progressreports/framesets/' + logName[x].toLowerCase() + 'Frameset.htm';
            }
        }
    }
    if (found == false) alert('Username and/or Password are incorrect');
    return false;
}



