﻿
/* ------------------------------------------- */
/*              Global Variables               */
/* ------------------------------------------- */
len = 6;
element_id = "ctl00_ctl00_cphMain_si";
folderPath = "images/services/"; //folder path
t = ""; //true condition
f = "none"; //false condition
//a = "a"; //name of attributes
els = new Array();
/* ------------------------------------------- */

window.onload = function loadArray() {
    //alert("This is a test to see if the loadArray is working");
    for (i = 0; i < len; i++) {
        els[i] = document.getElementById(element_id + (i + 1));
        //alert(els[i]); //for debugging
    }

}

function SwapReplace(number, imageName, IsActive) {
    
    if (IsActive == true)
        state = "_active.jpg";
    else
        state = ".jpg";

    //alert(folderPath + imageName + state); //for debugging
    
    for (i = 0; i < len; i++) {
        if (number == (i + 1)) {
            //console.log(folderPath + imageName + state); //for debugging
            els[i].src = folderPath + imageName + state;          
        }
    }

}