//===============================================
//editable area
    
    //change this structure to add images
    var image_info = new Array(
                            new Object({ image: "ricardoadvantage.jpg", url: " library/closerlookricardoca.html ", title: "David Ricardo on comparative advantage" }),
                            new Object({ image: "smithinvisiblehand.jpg", url: "library/closerlooksmithih.html", title: "Adam Smith on the invisible hand" }),
                            new Object({ image: "macaulayfreely.jpg", url: " library/closerlookmacaulaydf.html ", title: "Macaulay on free discussion" })                                          
                            );

//===============================================
//DON'T EDIT CODE FROM HERE DOWN
    
    function getRandomImage(){
        var rn = Math.floor(Math.random()*image_info.length);
        
        if(rn < 0){ rn = 0; }//make sure num in in range
        if(rn > image_info.length - 1){ rn = image_info.length - 1; }//make sure num in in range
        
        return getImageHTML(image_info[rn]);
    }
    
    function getImageHTML(info){
        return "<div class=\"button\" onclick=\"openPopup('"+ info.url +"');\"><img src=\"res/img/home_img_cycle/"+ info.image +"\" title=\" "+info.title +"\" /></div>";
    }
    
