﻿function initquotes() {

    var quote = new Array();

    quote[1] = document.getElementById("quote1");
    quote[2] = document.getElementById("quote2");
    quote[3] = document.getElementById("quote3");
    quote[4] = document.getElementById("quote4");




    var quotebtn = new Array();

    quotebtn[1] = document.getElementById("quotebtn1");
    quotebtn[2] = document.getElementById("quotebtn2");
    quotebtn[3] = document.getElementById("quotebtn3");
    quotebtn[4] = document.getElementById("quotebtn4");

    
    for (i = 1; i < quote.length; i++) {
        quotebtn[i].onmouseover = borderon;
        quotebtn[i].onmouseout = borderoff;
    }
    
    quotebtn[1].onclick = function() { startquotecycle(quote,1) }
    quotebtn[2].onclick = function() { startquotecycle(quote,2) }
    quotebtn[3].onclick = function() { startquotecycle(quote, 3) }
    quotebtn[4].onclick = function() { startquotecycle(quote, 4) }
   
          
   

}

function borderon() {
    this.firstChild.style.borderColor = "#bfd1df";
}
function borderoff(){
    this.firstChild.style.borderColor = "#ffffff";
}




function startquotecycle(divarray,num){
    flipquote(divarray, num);
    
}

function flipquote(divarray, newnum) {

   // alert("newnum = " + newnum);
   // alert(divarray[1].toString);
  
    switch (newnum) 
    {
        case 1:

            divarray[1].style.visibility = "visible";
            divarray[2].style.visibility = "hidden";
            divarray[3].style.visibility = "hidden";
            divarray[4].style.visibility = "hidden";

            break;
        case 2:
            divarray[1].style.visibility = "hidden";
            divarray[2].style.visibility = "visible";
            divarray[3].style.visibility = "hidden";
            divarray[4].style.visibility = "hidden";
            break;
        case 3:
            divarray[1].style.visibility = "hidden";
            divarray[2].style.visibility = "hidden";
            divarray[3].style.visibility = "visible";
            divarray[4].style.visibility = "hidden";
            break;
        case 4:
            divarray[1].style.visibility = "hidden";
            divarray[2].style.visibility = "hidden";
            divarray[3].style.visibility = "hidden";
            divarray[4].style.visibility = "visible";
            break;
        default:

            break;
           
    }
}