RE:¿Como proteger el codigo?
Aquí te mando el código completo, no sirve de mucho ya que se queda la imagen en la cache del navegador y además se la pueden bajar por otras maneras...
<HTML>
<HEAD>
<script language=JavaScript>
<!--
<!--
var message="NO TIENES AUTORIZACION PARA BAJARTE ESTA FOTO";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
var DefMsg='no';
function SetDefMsg()
{
window.status=DefMsg;
}
// -->
</script>
</HEAD>
<BODY>
<b>Intenta bajarte la foto</b><br>
<img src="7.GIF"></img>
</BODY>
</HTML>