﻿function fnInitProtectImages(){
    if (!document.getElementsByTagName){ return; }
	var images = document.getElementsByTagName('img');
	
	for (var index = 0, len = images.length; index < len; ++index) {
        if (images[index]){
            images[index].oncontextmenu = function(){ return false; };
        }      
    }	
    
    var anchors = document.getElementsByTagName('a');

	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];		
		var relAttribute = String(anchor.getAttribute('rel'));
		
		if (anchor.getAttribute('href')){
		    if (relAttribute.toLowerCase().match('lightbox') || relAttribute.toLowerCase().match('disableright')){
		        anchor.oncontextmenu = function(){ return false; };
		    }
		}
	}
}