
// --------------------------------------------------
// our lookup table indexes
// --------------------------------------------------
var _c_href = 0;
var _c_pic1 = 1;
var _c_pic2 = 2;
var _c_name = 3;

// --------------------------------------------------
// set the array
// --------------------------------------------------
var portfolio_array =
[
["http://www.thedibachigroup.com",
"images/thedibachigroup_100.jpg",
"images/thedibachigroup_500.jpg",
"The Dibachi Group"],

["http://www.closdulaccommunity.com/",
"images/closdulaccommunity_100.jpg",
"images/closdulaccommunity_500.jpg",
"Clos du Lac Community\nLoomis, CA"],

["http://www.granitebaycountrydayschool.com/",
"images/granitebaycountrydayschool_100.jpg",
"images/granitebaycountrydayschool_500.jpg",
"Warner's Granite Bay\nCountry Day School"],

["http://www.shahrzadrestaurant.com/",
"images/shahrzadrestaurant_100.jpg",
"images/shahrzadrestaurant_500.jpg",
"Shahrzad Restaurant"],

["http://www.tafollalandscape.com/",
"images/tafollalandscape_100.jpg",
"images/tafollalandscape_500.jpg",
"Tafolla's Landscape"],

//["http://www.chandlerlegalgroup.com/",
//"images/chandlerlegalgroup_100.jpg",
//"images/chandlerlegalgroup_500.jpg",
//"Chandler Legal Group"],

["http://www.wkblaw.com/",
"images/wkblaw_100.jpg",
"images/wkblaw_500.jpg",
"Wagner Kirkman Blaine\nKlomparens &amp; Youmans LLP"],

["http://www.northranchbuilders.com/",
"images/northranchbuilders_100.jpg",
"images/northranchbuilders_500.jpg",
"NORTH RANCH BUILDERS, INC"],

["http://www.jjhappyhour.com/",
"images/jjhappyhour_100.jpg",
"images/jjhappyhour_500.jpg",
"JJ's Happy Hour"],

["http://www.paulhillsconstruction.com/",
"images/paulhillsconstruction_100.jpg",
"images/paulhillsconstruction_500.jpg",
"Paul Hills Design &amp;\nHills Construction, Inc."],

["http://www.snamg.com/",
"images/snamg_100.jpg",
"images/snamg_500.jpg",
"Spine &amp; Neurosurgery Associates"],

["http://www.blakemoreconst.com/",
"images/blakemoreconst_100.jpg",
"images/blakemoreconst_500.jpg",
"Blakemore Construction Co."],

["http://www.rtconst.com/",
"images/rtconst_100.jpg",
"images/rtconst_500.jpg",
"Rick Thompson Construction, Inc."],

["http://www.aveenweddings.com/",
"images/aveenweddings_100.jpg",
"images/aveenweddings_500.jpg",
"Aveen Weddings"]

];

// --------------------------------------------------
// Show the small pictures on the left side
// --------------------------------------------------
function show_small_pictures()
{
    var array_length = portfolio_array.length;
    for (i = 0; i < array_length; i++) {
        //document.write(i);
        //document.write(portfolio_array[0][1]);
        document.write(
              '<a  href="' + portfolio_array[i][_c_href] + '" style="text-decoration:none; " target="_blank">'
            + '<img title="' + portfolio_array[i][_c_name] + '" class="portfolio_item" id="pic_' + i
            + '" src="' + portfolio_array[i][_c_pic1] + '" onclick="" onmouseover="javascript:change_picture(' + i + ')" alt="click to view larger image" />'
            + '</a>'
        );

    }
    
}


// --------------------------------------------------
// Create the big pictures on the right side
// --------------------------------------------------
function create_big_pictures() {
    var array_length = portfolio_array.length;
    for (i = 0; i < array_length ; i++) 
    {
        document.write(
            '<div id="pic_big_' + i + '">'
            +'<img src="' + portfolio_array[i][_c_pic2] +'" />'
            + '</div>'
            );

        //document.getElementById("main_anchor").href = portfolio_array[row][_c_href];
        
        //document.getElementById("pic_big_" + i.toString()).style.visibility = "hidden";
        document.getElementById("pic_big_" + i.toString()).style.display = "none";
        //document.getElementById("pic_big_" + i.toString()).href = portfolio_array[i][_c_href];
        
    }
}

// --------------------------------------------------
// show the big picture that is selected and hide the other bug pictures
// --------------------------------------------------
function change_picture(row) {
    
     
    //document.getElementById("main_picture").src = portfolio_array[row][_c_pic2]; //picture_array[row][2] ;
    //document.getElementById("main_anchor").href = portfolio_array[row][_c_href];

    var array_length = portfolio_array.length;
    for (i = 0; i < array_length ; i++) 
    {
        //document.getElementById("pic_big_" + i.toString()).style.visibility = "hidden";
        document.getElementById("pic_big_" + i.toString()).style.display = "none";
    }

    document.getElementById("pic_big_" + row.toString()).style.display = "block";
    document.getElementById("pic_big_" + row.toString()).style.visibility = "visible";

    //alert(row);
}       

  
