LED LIGHT SYSTEM , TOY CAR WITH IR REMOTE

My project is to light up a diecast model car,

Headlights,tail light, break lights, fog lights and signal lights with IR remote

everything working fine, except the signal lights delay with switch. (case 0xFD20DF: and case 0xFD609F)

#include <IRremote.h>
int RECV_PIN = 3;
int HL = 6;   // HEAD LIGHTS
int RL = 5;   //REAR LIGHTS + 
int BK = 12;  // BREAK LIGHTS
int RI = 11;  // RIGHT SIGNAL LIGHT
int LI = 10;  // LEFT SIGNAL LIGHT
int FOG = 9;  // FOG LIGHT                                              
int togglestate = 0;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
irrecv.enableIRIn();

  pinMode(HL, OUTPUT);
  pinMode(RL, OUTPUT);
  pinMode(BK, OUTPUT);
  pinMode(RI, OUTPUT);
  pinMode(LI, OUTPUT);
  pinMode(FOG, OUTPUT);                          

}

void loop() {
  if (irrecv.decode(&results)) {
    switch(results.value){
      
case 0xFD807F:  // HEAD LIGHT and REAR LIGHT should light up 100
      if (togglestate==0){
  analogWrite(HL, 100);
  analogWrite(RL, 100);
 togglestate=1;
}
 else{
digitalWrite(HL,LOW);
digitalWrite(RL,LOW);
 togglestate=0;   
 }
   break;
 
 case 0xFD40BF: // FOG LIGHT ON/OFF
      if (togglestate==0){
  digitalWrite(FOG, HIGH);
 togglestate=1;
}
 else{
digitalWrite(FOG,LOW);
 togglestate=0;   
 }
   break;
      
 case 0xFD00FF: // BREAK LIGHT and REAR LIGHT ON/OFF,
      if (togglestate==0){
  digitalWrite(BK, HIGH);
  digitalWrite(RL, HIGH);       
 togglestate=1;
}
 else{
digitalWrite(BK, LOW);
digitalWrite(RL, LOW);
 togglestate=0;   
 }
   break;     
 
      case 0xFD20DF: // LEFT SIGNAL LIGHT BLINK ON/OFF ,
                 
  if (togglestate==0){
  digitalWrite(LI, HIGH);
    delay(300);
  digitalWrite(LI, LOW);
    delay(300);
 digitalWrite(LI, HIGH);
    delay(300);
  digitalWrite(LI, LOW);  
   delay(300);
 digitalWrite(LI, HIGH);
    delay(300);
 digitalWrite(LI, LOW); 
  delay(300);
 digitalWrite(LI, HIGH);
    togglestate=1;
}
 else{
digitalWrite(LI, LOW);
 togglestate=0;   
 }
     break;      
 
   case 0xFD609F: // RIGHT SIGNAL LIGHT BLINK ON/OFF ,
                 
if (togglestate==0){
  digitalWrite(RI, HIGH);
    delay(300);
  digitalWrite(RI, LOW);
    delay(300);
 digitalWrite(RI, HIGH);
    delay(300);
  digitalWrite(RI, LOW);  
   delay(300);
 digitalWrite(RI, HIGH);
    delay(300);
 digitalWrite(RI, LOW); 
  delay(300);
 digitalWrite(RI, HIGH);
    togglestate=1;
}
 else{
digitalWrite(RI, LOW);
 togglestate=0;   
 }
     break;  
}    
    irrecv.resume();
  }
}

can any one suggest any alternative code.

i'm guessing its down to the delay command , as nothing else can happen while in a state of delay
everything stops waits a while then resumes

millis or micros would be a better way as this would prevent the code from waiting to finish the delay period

take a look at the blink without delay lesson in digital examples

Hai,
i tried millis instead of delay but failed..can i get help for coding.

RIGHT & LEFT SIGNAL TO TURN ON/OFF BLINKING WHEN IR SWITCH PRESSED,