<html>
<head>
<style type="text/css">
img
{
position:absolute;
top:100px;
}
</style>
<script type="text/javascript">
function clipImage()
{
document.getElementById("img1").style.clip="rect(0px,50px,50px,0px)";
}
</script>
</head>
<body>
<img id="img1" border="0" src="/i/eg_sun.gif" />
<input type="button" onclick=clipImage() value="Clip image" />
</body>
</html>