vk65535,
Подожди, я правильно все сделал?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link id="dyncss" rel="stylesheet" type="text/css" href=">
<script type="text/javascript">
function setDynCSS(url) {
if (!arguments.length) {
url = (url = document.cookie.match(/\bdyncss=([^;]*)/)) && url[1];
if (!url) return '';
}
document.getElementById('dyncss').href = url;
var d = new Date();
d.setFullYear(d.getFullYear() + 1);
document.cookie = ['dyncss=', url, ';expires=', d.toGMTString(), ';path=/;'].join('');
return url;
}
setDynCSS();
</script>
</head>
<body>
<input onchange="setDynCSS(this.value);" />
<input type="submit" value="Нажать" onclick="bg(2)" /><br />
<div>
<img src="img1.png" onclick="bg(1)" />
<img src="img2.png" onclick="bg(2)" />
<img src="img3.png" onclick="bg(3)" />
</div>
<script>
function bg(param){
var bodyNode = document.getElementsByTagName('body').item(0)
bodyNode.style.background = 'url(img'+param+'.png)'
}
</script>
</body>
</html>