	function addOnloadEvent(fnc)
	{
	  if ( typeof window.addEventListener != "undefined" )
		window.addEventListener( "load", fnc, false );
	  else if ( typeof window.attachEvent != "undefined" ) {
		window.attachEvent( "onload", fnc );
	  }
	  else {
		if ( window.onload != null ) {
		  var oldOnload = window.onload;
		  window.onload = function ( e ) {
			oldOnload( e );
			window[fnc]();
		  };
		}
		else 
		  window.onload = fnc;
	  }
	}
    function resizeimg(max_size)
    {
       if (document.getElementsByTagName)
       {
          for (i=0; i<document.getElementsByTagName('img').length; i++)
          {
             im = document.getElementsByTagName('img')[i];
             if (im.width > max_size && im.className != 'noresize')
             {
                eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=" + (im.width + 20) + ",height=" + (im.height + 20) + "'); pop.focus();\")");
                eval("im.onclick = pop" + String(i) + ";");
                im.style.width = max_size + 'px';
				if (document.all) im.style.cursor = 'hand';
                if (!document.all) im.style.cursor = 'pointer';
                im.title = 'Click Here To See Image Full Size ';
				im.style.borderTop="20px solid #FFFFCC";
				
				dv = document.createElement('div'); // create dynamically div tag
				dv.style.position = 'relative';
				dv.style.top = '20px';
				dv.innerHTML='This image has been resized. Click to see full size.';
				im.parentNode.insertBefore(dv, im);
             }
          }
       }
    }