/*
function Artwork( previewPath, imagePath, title, creationDate, media, dimensions, uniqueID )
{
    // Properties
    this.preview = new Image();
    this.preview.src = imagePath;
    this.image = new Image();
    this.image.src = previewPath;
    this.title = title;
    this.creationDate = creationDate;
    this.media = media;
    this.dimensions = dimensions;
    this.uniqueID = uniqueID;
    
    // Methods
    this.getInfoString = getInfoString;
    function getInfoString()
    { return "<BR>" + this.title + " <i><BR>(" +  this.media + ", " + this.dimensions ", " + this.creationDate + ")</i>"; }
        
    this.getAsTableCell = getAsTableCell;
    function getAsTableCell()
    { return "<A HREF=\"#top\"><div class=\"img-shadow\"><IMG SRC=\"" + this.imagePath + "\" onclick=\"presentImage(" + this.uniqueID + ");\"></div></A>"; }

    this.present = present;
    function present()
    {
        var displayBox = document.getElementById( "largepiece" );
        if( displayBox != null )
        {
            displayBox.src = this.image.src;
            var caption = document.getElementById( "artinfo" );
            if( caption != null ) caption.innerHTML = this.getInfoString();
        }
    }
    
}
*/

function presentImage( theImage, theInfo )
{
    var displayBox = document.getElementById( "selectedArtwork" );
    if( displayBox != null )
    {
        displayBox.src = "graphics/loading.gif";
        var caption = document.getElementById( "artinfo" );
        if( caption != null ) caption.innerHTML = "<p>" + theInfo + "</p>";
        displayBox.src = theImage;
    }
}

function showSection( theSectionID )
{
    var theSection = document.getElementById( theSectionID );
    if( theSection != null )
    {
        hideSection( "main" );
        hideSection( "portraits" );
        hideSection( "paintings" );
        hideSection( "drawings" );
        hideSection( "sketches" );
        hideSection( "photography" );
        hideSection( "icons" );
        hideSection( "branding" );
        hideSection( "illustration" );
        hideSection( "interface" );
        hideSection( "goodies" );
        hideSection( "about" );
        theSection.style.display = "block";
    }
}

function hideSection( theSectionID )
{
    var theSection = document.getElementById( theSectionID );
    if( theSection != null ) theSection.style.display = "none";
}

function start()
{
    var randomnumber = Math.round( 10 * Math.random() );
    
    switch( randomnumber  )  
    {    
        case 0:
            presentImage( 'images/portraits/soappreview.jpg', 'Soap <i><BR>(Oil on canvas, 4.5in. x 3in. X 2.5, 2008)</i>' );
            break;
            
        case 1:
            presentImage( 'images/portraits/joannepreview.jpg', 'Joanne <i><BR>(Oil on canvas, 4.5in. x 3in. X 2.5, 2009)</i>' );
            break;
            
        case 2:
            presentImage( 'images/paintings/invisiblemanpreview.jpg', 'Invisible Man Walking <i><BR>(Oil on canvas, 12in. x 12in., 2009)</i>' );
            break;
            
        case 3:
            presentImage( 'images/paintings/backawaypreview.jpg', 'Back Away <i><BR>(Acrylic on canvas board, 18in. x 24in., 2005)</i>' );
            break;
            
        case 4:
            presentImage( 'images/paintings/mandownpreview.jpg', 'Man Down! Leave him! Leave him! <i><BR>(Oil on canvas, 12in. x 12in., 2009)</i>' );
            break;
            
        case 5:
            presentImage( 'images/paintings/doasyouretoldbluepreview.jpg', 'Do As You\'re Told: Blue <i><BR>(Acrylic on canvas, 10in. x 10in., 2005)</i>' );
            break;
            
        case 6:
            presentImage( 'images/paintings/americathebeautifulpreview.jpg', 'America The Beautiful <i><BR>(Oil on canvas, 20in. x 16in., 2007)</i>' );
            break;
        
        case 7:
            presentImage( 'images/paintings/dendraphiliacpreview.jpg', 'Dendraphiliac <i><BR>(Oil on canvas, 10in. x 10in., 2007)</i>' );
            break;
            
        case 8:
            presentImage( 'images/toys/familypreview.jpg', 'Family <i><BR>(Acrylic & Sculpey on blank Munnys, 4.5in. x 3in. X 2.5 each, 2009)</i>' );
            break;
            
        case 9:
            presentImage( 'images/portraits/hallie01preview.jpg', 'Hallies <i><BR>(Watercolor & Ink on paper, 8in. x 10in., 2004)</i>' );
            break;
    
        default:
            presentImage( 'images/toys/petepreview.jpg', 'Pete <i><BR>(Acrylic & Sculpey on blank Munny, 4.5in. x 3in. X 2.5, 2009)</i>' );
            break;
    }
}
