Quote Originally Posted by mister_e
so you should, once again, open the datasheet in the SLEEP section first.

Have a look at section 14.8 Power-down mode and section 14.8.1 Wake-up from sleep. There, you will discover what can wake-up your PIC
External RESET
Watchdog timer
Interrupt from RB0/INT pin, interrupt on some PORTB pins or peripheral interrupts (comparator, USART... )

without some change to your hardware... i doubt you'll be able to wake your PIC ONLY if you change some dip switch.

to turn your PIC in sleep mode only for 5 secondes, you may have a look in the PBP book at SLEEP section.

SLEEP 5
I have read datasheet many times.(I don't understand datasheet very well because i don't know english very well)
I want to wake PIC ONLY if i change one or some dip switch and after 5 seconds to go to sleep again , until if i change one or some dip switch again.
But i don't know how to write the code.