function getRandomPic1(){
	var myimages=new Array()
	myimages[0]="includes/swap/swap-01.jpg";
	myimages[1]="includes/swap/swap-02.jpg";
	myimages[2]="includes/swap/swap-03.jpg";
	myimages[3]="includes/swap/swap-04.jpg";
	
	var ry=Math.floor(Math.random()*myimages.length);
	
	return myimages[ry]
}

function getRandomPic2(){
	var myimages=new Array()
	myimages[0]="includes/swap/swap-05.jpg";
	myimages[1]="includes/swap/swap-06.jpg";
	myimages[2]="includes/swap/swap-07.jpg";
	
	var ry=Math.floor(Math.random()*myimages.length);
	return myimages[ry]
}

function getRandomPic3(){
	var myimages=new Array()
	myimages[0]="includes/swap/swap-08.jpg";
	myimages[1]="includes/swap/swap-09.jpg";
	myimages[2]="includes/swap/swap-10.jpg";
	
	var ry=Math.floor(Math.random()*myimages.length);
	return myimages[ry]
}


function getObject(name)
{
       if(typeof name == "string") {
         if (document.getElementById)
         {
               return document.getElementById(name);
         }
         else if (document.all)
         {
               return document.all[name];
         }
         else if (document.layers)
         {
               return document.layers[name];
         }
       }
       else {
               return name;
       }
       return null;
}



function setRandPic() {

	// alert("Setting Random Pictures")

        var randPic = getRandomPic1(); //which calles your randomising code and returns an image name
        var picName = getObject("pic1"); // find the pic1 object on the page
        if (picName != null)  {  //check that image object is not null
                picName.src = randPic; // changes the source of pic1 to the random image
        }
        var randPic = getRandomPic2(); //which calles your randomising code and returns an image name
        var picName = getObject("pic2"); // find the pic1 object on the page
        if (picName != null)  {  //check that image object is not null
                picName.src = randPic; // changes the source of pic1 to the random image
        }
        var randPic = getRandomPic3(); //which calles your randomising code and returns an image name
        var picName = getObject("pic3"); // find the pic1 object on the page
        if (picName != null)  {  //check that image object is not null
                picName.src = randPic; // changes the source of pic1 to the random image
        }
}