Inny 1 Posting Whiz in Training

Could Somebody Please Write Me a cookie For the following code? I tried several Times But Nothing worked, I just dont understand cookie functions. I want a users selection to remain indefinately until they change it, at which point a new cookie is written.
Please share your skill?

<!-- Background selector-->
<script language="JavaScript1.2" type="text/javascript">
/*******************************************************************  
This Code Free To Use - Providing This Notice Remains
JavaScript Code Effect Found At: Development Resource & JavaScript Code & Generator Public Archive Center
Located: http://www.DesignerWiz.com
Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply

Made by Martial Boissonneault © 2001 http://getElementById.com/
May be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.

Adapted by Roberto de Jesus Asyn Diaz  
           http://www.asynco.net
           rasyn@asynco.net
********************************************************************/
function ChangeBgImg(imgs) {
    bdy[0].style.backgroundImage = 'url('+imgs+')';
}

function ChangeBgImgInit() {
    bdy = document.getElementsByTagName("body");
    bdy[0].style.width = "100%";
    bdy[0].style.height = "100%";
    bdy[0].style.margin = "0px";
    bdy[0].style.backgroundImage = 'url(http://i14.photobucket.com/albums/a345/Instar/greenbgfade17oi.jpg)';
}

onload=ChangeBgImgInit;
</script>

<center><b>Change The background?</b></center>
<center>
<table border=2 cellpadding=3 cellspacing=0 bgcolor="#c0c0c0" bordercolor="#000000">
<tr>
<td>
<img src="http://i14.photobucket.com/albums/a345/Instar/greenbgfade17oi.jpg" width="50px" height="50px" onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/greenbgfade17oi.jpg');return false">
<img src="
http://i14.photobucket.com/albums/a345/Instar/reptile_003-1.jpg" width="50px" height="50px"onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/reptile_003-1.jpg');return false">
<img src="http://i14.photobucket.com/albums/a345/Instar/HornedLizard-1.jpg" width="50px" height="50px"onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/HornedLizard-1.jpg');return false">
<img src="http://i14.photobucket.com/albums/a345/Instar/Croc-1.jpg" width="50px" height="50px" onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/Croc-1.jpg');return false">
</td>
</tr>
<tr>
<td>
<img src="http://i14.photobucket.com/albums/a345/Instar/wheelerii.jpg" width="50px" height="50px"onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/wheelerii.jpg');return false">
<img src="http://i14.photobucket.com/albums/a345/Instar/screenys/5810779220_522928.jpg" width="50px" height="50px" onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/screenys/5810779220_522928.jpg');return false">
<img src="http://i14.photobucket.com/albums/a345/Instar/20per.jpg" width="50px" height="50px"onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/20per.jpg');return false">
<img src="
http://i14.photobucket.com/albums/a345/Instar/basi-1.jpg" width="50px" height="50px"onclick="ChangeBgImg('http://i14.photobucket.com/albums/a345/Instar/basi-1.jpg');return false">
</td>
</tr>
</table>
</center>