﻿function randomPic() {
var thediv=document.getElementById("divBody");  
   var imgarray = new Array("1.jpg", "2.jpg");  
   var spot =Math.floor(Math.random()* imgarry.length);  
   thediv.style.background="url("+imgarray[spot]+")";  
}

function swapPic()
     {
     if(document.getElementById)
                 {
                 var thePicture=document.getElementById("divBody");
                 var picPath="../icons/"+rnd(2)+".jpg";
                 thePicture.style.backgroundimage="url('"+picPath+"')";
                 alert(thePicture.style.backgroundimage);
                 }
     }
     
function rnd(n)
     {
     return Math.floor(Math.random() * n) + 1;
     }

