Touchsensor sleep toggle

Hi guys,

I need some help with the coding of my system. My prototype has a led(pin 13) and a catalex digital capacitive touch sensor signal to pin 3. I want to make a toggle system when I press the button the first time the arduino is going to sleep when I pressed it again it will wake and start to blink the LED.

As always, post your sketch.

// hardware interrupt stuff
#include <avr/sleep.h>
#define INT0 0 
#define INT0_PIN 2
#define INT1 1 
#define INT1_PIN 3

// touch sensor pin
#define TOUCH_PIN 2

// led pin 
#define BLINK_PIN 13

// global flags
int buttonPushed;

void wakeUp(){
 // blink
 digitalWrite(BLINK_PIN, HIGH);
 //delay(1000);
 //digitalWrite(BLINK_PIN, LOW);
 delay(300);           
}

void prepareToSleep(){
 //prepare actions for sleep
 digitalWrite(13, LOW);
}

void wake(){

 // reset button state
 buttonPushed=0;

}

void toggle(){
 detachInterrupt(1);    // this seems to be allowed in callback

 if(digitalRead(TOUCH_PIN) == HIGH)
 {
   Serial.println("Touch");
   if(buttonPushed == 0)
   {
     buttonPushed = 1;
   }
   else
   {
     buttonPushed = 0;
   }
 }
}

void sleep(){
 wakeUp();  //application specific

 set_sleep_mode(SLEEP_MODE_PWR_DOWN);  

 attachInterrupt(INT1,wake,CHANGE); // rebind interrupt
 
 sleep_mode(); // sleeping
}

void setup() {                

 Serial.begin(9600);
 
 // On Off Toggle setup
 pinMode(INT1_PIN, INPUT);  // set switch pin to input 
                            // to limit current 
 attachInterrupt(INT1,toggle,CHANGE);
 buttonPushed=0; // set to 1 = sleep after reset
                 //        0 = run loop after reset

 // app specific setup here
 pinMode(BLINK_PIN, OUTPUT);  
}

void loop() {

 // debug message
 Serial.println(buttonPushed);
 
 if (buttonPushed == 1) {
   sleep();
 } else {
   // reset button events to sleep
   attachInterrupt(INT1,toggle,CHANGE);
 }
 // do important things
 wakeUp();
}