Help! I have a script to open a new window when a thumbnail is clicked, but how can I disable right click in the new wiondow?
This is the script I have:
<script>
<!— Hide script from old browsers
function OpenNewWindow2(cPicture,nWidth,nHeight,cMessage,nBorder)
{
NewWindow=window.open(“”,”NewOne”,”HEIGHT=”+nHeight+”,WIDTH=”+nWidth+”,scrollbars=no,resizable=no,top=5,left=5″);
NewWindow.document.write (“<HTML><HEAD><TITLE>”);
NewWindow.document.write (“</TITLE></HEAD>”);
NewWindow.document.write (“<BODY BGCOLOR=’#993333′>”);
NewWindow.document.write (“<P ALIGN=CENTER>”);
NewWindow.document.write (“<FONT FACE=’Arial’ SIZE=’+2′ COLOR=’Black’><B>”);
NewWindow.document.write (cMessage);
NewWindow.document.write (“</B></FONT>”);
NewWindow.document.write (“<IMG SRC=”);
NewWindow.document.write (cPicture);
NewWindow.document.write (“>”);
NewWindow.document.write (“</P>”);
NewWindow.document.write (“<center><FORM><INPUT TYPE=’button’ VALUE=’Close This Window’ onClick=’self.close()’>”);
NewWindow.document.write (“</FORM></CENTER>”);
NewWindow.document.write (“<p>”);
NewWindow.document.close();
return false;
}
var message=”Function Disabled!”;
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function(“alert(message);return false”)
// end hiding from old browsers –>
</script>
<!– This is the thumbnail //–>
<div align=”center”><a href=# onClick=”OpenNewWindow2(‘cr1252.jpg’,400,320,’CR125R’);return false;”><img src=”../../../javascripts/cr125r.gif” width=”136″ height=”99″ alt=”” border=”0″></a></div>