<html><div style='background-color:'><P>Hello All,</P>
<P>I have figured out how to do what I wanted. I know you cannot stop someone getting your images, but to please a client, I managed a solution.</P>
<P>For anyone who may want it, here it is:</P>
<P>You basically reference an external JS file, as so,</P>
<P>&lt;script src="js/noright.js" type="text/javascript"&gt;&lt;/script&gt;</P>
<P>Place it in the head of the doc if you like.</P>
<P>Then, the contents of the JS file are as such:</P>
<P>---------------------------------------------------------------------------------</P>
<P>// Site wide no-right click</P>
<P>var clickmessage="Sorry! Images cannot be downloaded from this site."</P>
<P>function disableclick(e) {<BR>if (document.all) {<BR>&nbsp;if (event.button==1) {<BR>&nbsp;&nbsp;if (event.srcElement.tagName=="IMG" &amp;&amp; event.srcElement.parentNode.tagName !='A'){<BR>&nbsp;&nbsp;alert(clickmessage);<BR>&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else if (event.button==2||event.button==3) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (event.srcElement.tagName=="IMG"){<BR>&nbsp;&nbsp;&nbsp;&nbsp;alert(clickmessage);<BR>&nbsp;&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else if (document.layers) {<BR>&nbsp;&nbsp;&nbsp;if (e.which == 3) {<BR>&nbsp;&nbsp;&nbsp;alert(clickmessage);<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else if (document.getElementById){<BR>&nbsp;&nbsp;&nbsp;if 
(e.which==3&amp;&amp;e.target.tagName=="IMG"){<BR>&nbsp;&nbsp;&nbsp;alert(clickmessage);<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</P>
<P>function associateimages(){<BR>for(i=0;i&lt;document.images.length;i++)<BR>document.images[i].onmousedown=disableclick;<BR>}</P>
<P>if (document.all)<BR>document.onmousedown=disableclick<BR>else if (document.getElementById)<BR>document.onmouseup=disableclick<BR>else if (document.layers)<BR>associateimages()<BR></P>
<P>&nbsp;</P>
<P>----------------------------------------------------------------------------------</P>
<P><BR>Hope this helps someone..............</P>
<P>Alan...<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">
<HR color=#a0c6e5 SIZE=1>
From: <I>"John Warner" &lt;john@jwarner.com&gt;</I><BR>Reply-To: <I>"\[JavaScript List\]" &lt;javascript@LaTech.edu&gt;</I><BR>To: <I>"'[JavaScript List]'" &lt;javascript@LaTech.edu&gt;</I><BR>Subject: <I>RE: [Javascript] Disable left mouse click and drag on images</I><BR>Date: <I>Fri, 21 Jul 2006 10:20:09 -0400</I><BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<DIV><SPAN class=412351614-21072006><FONT face="Comic Sans MS" color=#000080 size=2>I'm not where I can double check myself right now, but I'm sure the mouse Down event can be fired for an &lt;img&gt; tag. But this will be your least effective method of stopping your images from being downloaded if someone wants them. Getting around this requires the least amount of knowledge on the part of the user.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><FONT color=#000080 size=2>John Warner</FONT></DIV>
<BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> javascript-bounces@LaTech.edu [mailto:javascript-bounces@LaTech.edu] <B>On Behalf Of </B>Alan Easton<BR><B>Sent:</B> Friday, July 21, 2006 9:41 AM<BR><B>To:</B> javascript@LaTech.edu<BR><B>Subject:</B> RE: [Javascript] Disable left mouse click and drag on images<BR><BR></FONT></DIV>
<DIV>
<DIV class=RTE>
<P>Thanks for the comments so far guys.</P>
<P>One thing I was thinking of is this. In Javascript, can I detect what I click on. So basically, on a Mousedown event, I want to know the property of that object I have just clicked on, so is it text, a link, and image......is there a way of doing this.</P>
<P>Can I detect if it is an image I have just left cliked on.......any ideas.........<BR><BR></P></DIV>
<DIV></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">
<HR color=#a0c6e5 SIZE=1>

<DIV></DIV>From:&nbsp;&nbsp;<I>"John Warner" &lt;john@jwarner.com&gt;</I><BR>Reply-To:&nbsp;&nbsp;<I>"\[JavaScript List\]" &lt;javascript@LaTech.edu&gt;</I><BR>To:&nbsp;&nbsp;<I>"'[JavaScript List]'" &lt;javascript@LaTech.edu&gt;</I><BR>Subject:&nbsp;&nbsp;<I>RE: [Javascript] Disable left mouse click and drag on images</I><BR>Date:&nbsp;&nbsp;<I>Fri, 21 Jul 2006 07:51:50 -0400</I><BR>&gt;This can be dealt with on the server side with some reasonable success<BR>&gt;(watermarks and the like) what is your server side tool(s). I've seen<BR>&gt;any number of articles in for dotnet discussing protecting images. Note<BR>&gt;without disabling the mouse.<BR>&gt;<BR>&gt;Oh the suggestion about the GIF in the foreground by Triche Osborne<BR>&gt;works reasonably well if you keep the path to the actual images hidden<BR>&gt;from the client. That's why I suggest doing this at the server. Also 
as<BR>&gt;pointed out, it is stored on the client computer if the client is<BR>&gt;viewing it,, a clever user will still get the images.<BR>&gt;<BR>&gt;<BR>&gt;John Warner<BR>&gt;-----Original Message-----<BR>&gt;From: javascript-bounces@LaTech.edu<BR>&gt;[mailto:javascript-bounces@LaTech.edu] On Behalf Of Alan Easton<BR>&gt;Sent: Friday, July 21, 2006 4:58 AM<BR>&gt;To: javascript@LaTech.edu<BR>&gt;Subject: [Javascript] Disable left mouse click and drag on images<BR>&gt;<BR>&gt;<BR>&gt;Hello People,<BR>&gt;<BR>&gt;Now I know the issues surrounding trying to stop people stealing images<BR>&gt;off your website, it basically cannot be done, you can make life<BR>&gt;awkward, but essentially it cannot be done.<BR>&gt;<BR>&gt;Well, I have a client who wants me to make it as difficult as possible<BR>&gt;for any visitor trying to save their images.<BR>&gt;<BR>&gt;I have disabled right-click on 
images, but you can still left click on<BR>&gt;an image, and drag it to either the location bar, then save it once the<BR>&gt;image shows, or drag it to your desktop.<BR>&gt;<BR>&gt;Question is, does anyone have a trick that I can use to stop this<BR>&gt;"left-click and drag" on images....????<BR>&gt;<BR>&gt;Any help would be appreciated.<BR>&gt;<BR>&gt;Alan..<BR></FONT></BLOCKQUOTE></DIV></BLOCKQUOTE><BR>
<P>&gt;_______________________________________________<BR>&gt;Javascript mailing list<BR>&gt;Javascript@LaTech.edu<BR>&gt;https://lists.LaTech.edu/mailman/listinfo/javascript<BR>
<P></FONT></P></BLOCKQUOTE></div></html>