if (document.images) {
img1 = new Image();
img1.src = "images/quote1.gif";
img2 = new Image();
img2.src = "images/quote2.gif";
img3 = new Image();
img3.src = "images/quote3.gif";
img4 = new Image();
img4.src = "images/text_quote1.gif";
img5 = new Image();
img5.src = "images/text_quote2.gif";
img6 = new Image();
img6.src = "images/text_quote3.gif";
img7 = new Image();
img7.src = "images/text_quote4.gif";
img7 = new Image();
img7.src = "images/text_quote2_brown.gif";
}

function quoteSwitch(num)
{
document.images.txtquote.src="images/text_quote"+(num)+"_brown.gif";
}

function replaceQuote()
{
document.images.txtquote.src="images/txtquote.gif";
}

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.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it invisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
}


function showquote1(){

opacity('quote1', 0, 100, 1000)

setTimeout("hidequote1()",9000);

}

function hidequote1(){

opacity('quote1', 100, 0, 1000)

setTimeout("showquote2()",1000);

}

function showquote2(){

opacity('quote2', 0, 100, 1000)

setTimeout("hidequote2()",9000);

}

function hidequote2(){

opacity('quote2', 100, 0, 1000)

setTimeout("showquote3()",1000);

}

function showquote3(){

opacity('quote3', 0, 100, 1000)

setTimeout("hidequote3()",9000);

}

function hidequote3(){

opacity('quote3', 100, 0, 1000)

setTimeout("showquote1()",1000);

}

function showAddress1()
{
document.getElementById('addie').innerHTML = "115 NW 1st Avenue Suite 201 Portland, OR 97209<br>Phone: (503) 772-0159 &nbsp; Fax: (503) 772-0167";
}


function showAddress2()
{
document.getElementById('addie').innerHTML = "Oakland, CA<br>Phone: (888) 559-0159 &nbsp; Fax: (877) 645-0184";
}

function showAddress3()
{
document.getElementById('addie').innerHTML = "400 Continental Blvd. Suite 600 El Segundo, CA 90245<br>Phone: (888) 559-0159 &nbsp; Fax: (877) 645-0184";
}

function showAddress4()
{
document.getElementById('addie').innerHTML = "Seattle, WA<br>Phone: (888) 559-0159 &nbsp; Fax: (877) 645-0184";
}

function clearAddress()
{
document.getElementById('addie').innerHTML = "&nbsp;";
}

var i = 0
function showquotes(){
i++
if (i > 3)
{
i = 1
}
document.images.quote.src="images/quote" + (i) + ".gif"
timer=setTimeout ('showquotes()',10000)
}


