
//========================================================================
//  DEFINE ARRAYS
//========================================================================
var ImageFilePath = new Array()
var ImageURL = new Array()

//========================================================================
//  A.J. : MODIFY THIS SECTION
//========================================================================
var PixelsWide = 520;
var TotalImages = 30;

// these are the URL's to the images that will be displayed

ImageFilePath[0] = "images/2011MainOlive.jpg";
ImageFilePath[1] = "images/2011MainCosgrove.jpg";
ImageFilePath[2] = "images/2011MainVintage.jpg";
ImageFilePath[3] = "images/2011MainPillows.jpg";
ImageFilePath[4] = "images/2011MainBlog.jpg";
ImageFilePath[5] = "images/2011MainModernTables.jpg";
ImageFilePath[6] = "images/2011MainConsole.jpg";
ImageFilePath[7] = "images/2011MainPfeiferFinds.gif";
ImageFilePath[8] = "images/2011MainWasteBins.jpg";
ImageFilePath[9] = "images/2011MainCustom.jpg";
ImageFilePath[10] = "images/2011MainPoufs.jpg";
ImageFilePath[11] = "images/2012MainAspen.jpg";
ImageFilePath[12] = "images/2011MainEcoStools.jpg";
ImageFilePath[13] = "images/2011MainAlison.jpg";
ImageFilePath[14] = "images/2011MainMetPillows.jpg";
ImageFilePath[15] = "images/2011MainBamileke.jpg";
ImageFilePath[16] = "images/2011MainShop.jpg";
ImageFilePath[17] = "images/2011MainStools.jpg";
ImageFilePath[18] = "images/2011MainKuba.jpg";
ImageFilePath[19] = "images/2011MainSaddleBlanket.jpg";
ImageFilePath[20] = "images/2011MainBasketWoven.jpg";
ImageFilePath[21] = "images/2011MainNoren.jpg";
ImageFilePath[22] = "images/2011MainAshanti.jpg";
ImageFilePath[23] = "images/2011MainLacLogs.jpg";
ImageFilePath[24] = "images/2011MainCocktail.jpg";
ImageFilePath[25] = "images/2011MainPineCubes.jpg";
ImageFilePath[26] = "images/2011MainMoroccanTea.jpg";
ImageFilePath[27] = "images/2011MainLighting.jpg";
ImageFilePath[28] = "images/2011MainElephant.jpg";
ImageFilePath[29] = "images/2011MainSpotCow.jpg";


// these are the URL's to the web pages we're linking to

ImageURL[0] = "product/563/Russian-Olive-Stump-Table";
ImageURL[1] = "category/104";
ImageURL[2] = "category/44";
ImageURL[3] = "category/107";
ImageURL[4] = "blogs.aspx";
ImageURL[5] = "category/75";
ImageURL[6] = "product/5/Narrow-Console";
ImageURL[7] = "category/13";
ImageURL[8] = "category/82";
ImageURL[9] = "customdesign.aspx";
ImageURL[10] = "product/460/Moroccan-Leather-Pouf";
ImageURL[11] = "product/661/Aspen-Stump-Stool-Table";
ImageURL[12] = "product/444/Eco-Friendly-Stool-Table";
ImageURL[13] = "product/552/Alison-Occasional-Table";
ImageURL[14] = "product/554/Metallic-Leather-Pillow";
ImageURL[15] = "product/526/Bamileke-Stool-Table";
ImageURL[16] = "ourshop.aspx";
ImageURL[17] = "category/58";
ImageURL[18] = "product/415/Kuba-Cloth-Pillow";
ImageURL[19] = "product/396/Saddle-Blanket";
ImageURL[20] = "product/339/Basket-Woven-Leather-Pillow---Chocolate";
ImageURL[21] = "product/175/Japanese-Noren";
ImageURL[22] = "product/638/Hand-Carved-Ashanti-Stool";
ImageURL[23] = "product/442/Lacquered-Log-Tables";
ImageURL[24] = "product/364/Leather-Cocktail-Table";
ImageURL[25] = "product/489/Solid-Pine-Cube-Table";
ImageURL[26] = "product/537/Moroccan-Tea-Glass";
ImageURL[27] = "category/54";
ImageURL[28] = "product/517/Handmade-Elephant-Quilt";
ImageURL[29] = "product/618/Spotted-Cowhide-Pillow";





//========================================================================
//========================================================================
//  
//
//          DO NOT ALTER ANYTHING BELOW THIS!!!!!!
//
//
//========================================================================
//========================================================================
var TimeToFade = 15;
var FadeValue = 0;
var CurrentImage = 0;

//========================================================================
//  BUILD CSS
//========================================================================
function BuildCSS()
    {
    Style = "<STYLE type=\"text/css\">";
    Style+= ".slideshowframe { font: normal 10pt Arial, Helvetica, sans-serif; color:white;background-color:white; text-align:left; padding-bottom:10px; }";
Style+=".slideshowframe a { font: normal 10pt Arial, Helvetica, sans-serif; color:black; text-decoration: none; border:solid 1px silver; padding-left:5px; padding-right:5px; margin-left:2px; margin-right:2px;background-color:white; }";
Style+=".slideshowframe .next{ border:1px solid silver; background:#fff url(images/up.jpg) no-repeat center center; padding-bottom:0px;padding-top:0px; padding-right:15px; width:18px; height:15px;}";
Style+=".slideshowframe .next:hover{background:#fff url(images/up.jpg) no-repeat center center; border:1px solid #777;}";

Style+=".slideshowframe .prev{border:1px solid silver; background:#fff url(images/down.jpg) no-repeat center center;padding-bottom:0px;padding-top:0px;padding-right:15px; width:18px; height:15px;}";
Style+=".slideshowframe .prev:hover{ background:#fff url(images/down.jpg) no-repeat center center; border:1px solid #777;}";

Style+=".slideshowframe a.prev:visited{border:1px solid silver;-moz-background-clip:border;-moz-background-inline-policy:continuous;-moz-background-origin:padding;background:transparent url(images/down.png)no-repeat scroll 0 0;padding-bottom:0px;padding-top:0px;padding-right:15px;}";
Style+=".slideshowframe a:visited { color:black; text-decoration: none; } ";
Style+=".slideshowframe a:hover { color:white; text-decoration: none; background-color:#777777; } ";
Style+=".slideshow { padding-bottom:10px; -moz-opacity:1.0; opacity:1.0; filter:alpha(opacity:100); text-align:left;}";
Style+=".mainslideshow{overflow:hidden;height:385px;width:870px;}";
Style+=".slideshow a { background-color:white; border:none 0px white; } .slideshow a:visited { text-decoration: none; }";
Style+=".slideshow a:hover { text-decoration: none; background-color:white; } ";    
    Style += "</style>";    
    
    return Style;
    }


    

function gotoImage(X)
{
    $("#mainslideshow").trigger( 'goto', [X] );  
}

function buildImageList()
{
    var imageList="";
    for(i=0;i<TotalImages;i++)
    {
        imageList+="<a href=\"" + ImageURL[i] + "\"><img id=\"mainslideshowimg\" src=\"" + ImageFilePath[i] + "\" border=0></a>";
    }
    return imageList;
}



//========================================================================
//  BUILD SLIDE SHOW
//========================================================================
function BuildSlideShow()
    {
    try
        {
        // init variables
        HTMLMenu = "";
        HTMLCode = "";
        HiddenImages = "";
        
        // loop thru image data
        for(X = 0; X < TotalImages; X++)
            {
            IPath = ImageFilePath[X];
            IURL = ImageURL[X];
			To=X;
            HTMLMenu += "<a href=\"javascript:gotoImage("+To+")\">" + (X+1) + "</a>";            
            }
            
        HTMLMenu = "<a href=\"#\" class=\"prev\"></a>" + HTMLMenu + "<a href=\"#\" class=\"next\"></a>";  
            
        // render images
        document.write("<div style=\"display:none;\">" + HiddenImages + "</div>");
        var TT = setTimeout("", 8000);
        clearTimeout(TT);
                
        HTMLCode += BuildCSS();
        HTMLCode += "<div class=\"slideshowframe\">";
        HTMLCode += "<div class=\"slideshow\" id=\"slideshowcode\" >";
        //HTMLCode += "<a href=\"" + ImageURL[0] + "\"><img id=\"mainslideshowimage\" src=\"" + ImageFilePath[0] + "\" border=0></a>";
        HTMLCode += "<div id=\"mainslideshow\" class=\"mainslideshow\">"+buildImageList()+"</div>";
        HTMLCode += "</div>";
        HTMLCode += HTMLMenu;
        HTMLCode += "</div>";
        document.write(HTMLCode);
        }
    catch(e)
        {
        }
    }




//========================================================================
//  RUN CODE
//========================================================================
BuildSlideShow();


