var _img_max_width = 480; //change this if you want another size
var _img_mouseover_title = 'Click here to view image in full size.'; //Change here for the message to display when the mouse is over the resized image

//Don't touch anything after here if you don't know what are you doing.
function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}else{
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

addLoadEvent(function () {

    	
	if (document.getElementsByTagName) {
		var imgs = document.getElementsByTagName('img');
		for (i = 0; i < imgs.length; i++) {
			var im = imgs[i];
			// if (im.getAttribute('class') != 'resize')	continue;
			var src = im.src;
			var width = im.width;
			var height = im.height;
			if (width > _img_max_width) {
				im.style.width = _img_max_width + 'px';
				 im.onclick = function() {
               var pop=window.open(this.src, 'imgbig', 'height=768,width=1024,resizable=1,scrollbars=1');
               //Changed from var pop = window.open(this.src, 'imgbig', 'width='+width+',height='+height+', scrollbars=0,resizable=0,toolbar=0');
               //Removed pop.resizeBy(width-pop.document.body.clientWidth,height-pop.document.body.clientHeight);
               pop.focus();
            }
				im.style.cursor = document.all ? 'hand' : 'pointer' ;
				im.style.border = '1px dotted #000';
				im.style.margin = '2px';
				im.title = _img_mouseover_title;
			}
		}
	}
   
});