//this function chooses a random image from a directory of random images
// to use itput the path to your directory in the path variable
// and make sure if you want to use jpgs change the gif to jpg!
// it can use up to 100 images, numbered 1-100.jpg.  If there are less 
// than 100, it keeps choosing until it finds a match.

function randomiseImage(){
             var path="random/";
             var newNo=randomInteger();
             var newSrc=path+newNo+".jpg";
             var randomImage=document.getElementById("randomImage");
             randomImage.setAttribute("src",newSrc);

             var checkImage= new Image();
             checkImage.src=newSrc;

             if (checkImage.width==0)randomiseImage();
}

function randomInteger(){
    var rand_no = Math.random();
    rand_no = rand_no * 200;
    rand_no = Math.ceil(rand_no);

     return rand_no;
}

function checkImages(url){
//               alert("checking + "+url);
  //             var thisImage= new Image();
    //           thisImage.setAttribute("src",url);
      //
        //       var width=0;
          //     if (null==thisImage)
            //    return width;
              // else return thisImage.width;
                 }
