Default ArduinoMega 2560 PORTA-PORTK configurations

I read that Arduino (Atmega) pins default to inputs.
So, is evere pin, except the one connected to the MB led, initially (after power on) an input?
I quess not? there are the OCnx, the Analog pins ext. inerrupts etc.
So actually my question is:
Where can I find out what functions are given to thePorts A-K and their pins when Arduino is powered up?
I have tried to search the net, but I havn't found a complete description.
Thanks!

Page 100 shows the default register values for the IO ports.
Page 411 summarises all the registers and gives links to the pages on which the initial values are specified.

Thanks Tom!
So you mean that my Arduino Mega 2560 does not change the Atmel's default values for the ports at all?

The Arduino Mega is just an Atmega2560 - you can change the defaults, they are built into the fabric of the chip. Anything that may or may not get changed is all down to your code/Arduino core/bootloader. The only pins which will change are the Serial pins and Pin13, these are changed by the bootloader.

Ok, thanks a lot.So if I use for ex. the AnalogWrite function, there is "invisible" code that sets a port pin as PWM output?
Because in the AnalogWrite example I don't see any code that configures the ports.
Hmmm... I want to take a look at my Arduino's boot section, where is the prgm list?

There are two places where the PWM registers are setup.
The first is in the init() function in "wiring.c" which sets up the timers to PWM mode, but doesn't connect the PWM generation to the output registers.
The second is in the analogWrite() function in "wiring_analog.c" which has the following:

			case TIMER0A:
				// connect pwm to pin on timer 0
				sbi(TCCR0, COM00);
				OCR0 = val; // set pwm duty
				break;
			#endif

			#if defined(TCCR0A) && defined(COM0A1)
			case TIMER0A:
				// connect pwm to pin on timer 0, channel A
				sbi(TCCR0A, COM0A1);
				OCR0A = val; // set pwm duty
				break;
			#endif
.... //and so on

That connects the PWM from the timer to the output register whenever you call analogWrite(). When you call digitalWrite() or digitalRead(), these are disconnected again.

All is clear now, thanks a lot Tom!