I found this code that should do what you need.
Code:
<html>
<head>
<script>
window.onload = setBanner;
function setBanner()
{
var w = screen.availWidth;
var i = document.getElementById('banner');
if (w >= 1000) {
i.src = 'image_big.jpg'
}
else if (w >= 700) {
i.src = 'image_medium.jpg'
}
else {
i.src = 'image_small.jpg'
}
}
</script>
</head>
<body>
<img id='banner' src=''>
</body>
</html>