  		/* Fade in and out for thumbnails */
    		
    		var p_fade = function(element, mode, type, stop, number) {
    			clearInterval(element.interval);
    			
    			switch(mode) {
    				case 'slow' : var speed = 75; break;
    				case 'fast' : var speed = 25; break;
    				case 'normal' : default: var speed = 50; break;
    			}
 
    			if(number == 0) {
    				element.interval = (type == 'in') ? setInterval(function() { fadeIn(element); }, speed) : setInterval(function() { fadeOut(element); }, speed);
    			} else {
	    			setTimeout(function() {
	    				element.interval = (type == 'in') ? setInterval(function() { fadeIn(element); }, speed) : setInterval(function() { fadeOut(element); }, speed);
	    			}, number * 30);
    			}
    			
    			function fadeIn(element) {
    				var value = parseFloat(element.style.opacity) + 0.1;
    				if(value <= stop) {
    					p_opacity(element, value);
    				} else {
    					clearInterval(element.interval);
    				}
    			}
 
    			function fadeOut(element) {
    				var value = parseFloat(element.style.opacity) - 0.1;
    				if(value >= stop) {
    					p_opacity(element, value);
    				} else {
    					clearInterval(element.interval);
    				}
    			}
    		};
 
    		var p_opacity = function(element, value) {
				element.style.opacity = value;
				element.style.MozOpacity = value;
				element.style.KhtmlOpacity = value;
				element.style.filter = 'alpha(opacity=' + value * 100 + ')';
		    };