

var clickmessage="Right click disabled on images!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].oncontextmenu=disableclick;
}

if (document.all)
    {

document.onmousedown=disableclick

    }
else if (document.getElementById)
    {
document.oncontextmenu=disableclick
}
else if (document.layers)
    {
associateimages()
}

//==============================Image Selection============================================

function disableSelection(target)
{
    if(document.all)
        {
                 
                 //target.attachEvent('onselect',rfalse)
                 
                 if (event.srcElement.tagName=="IMG")
                {
                   //alert("dapat image lang")
                   return false;
                    //return false;
                }
                    else
                    {
                       ok
                    }
        }
	
    else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
        {
           target.style.MozUserSelect="none"
        }
	
    else //All other route (ie: Opera)
        {
            target.onmousedown=function(){return false}
        }
	
target.style.cursor = "default"
}

function ok()
{
    return true
}
