programming zero crossing at existing program

Hello everyone,
I got a problem with my project. I wanna control halogen-bulbs which is powered by 12V AC (there is my problem)
I wrote a program for led’s and now I wanna use this for the halogen-bulbs. So I have a Arduino Nano V3 and Ac-Dimmer for the bulbs. So how I get the zero crossing in this code? Thats my first time to control AC-power and I have absolut no idea how I can fix this code to fade the bulbs automaticly.

Thanks a lot for every help.

Here is the code:

int ledPin1 = 5;
int ledPin2 = 9;
int ledPin3 = 10;
int ledPin4 = 11;
int ledPin5 = 6;
//int ledPin6 = 13;
//int ledPin7 = 2;
//int ledPin8 = 3;
//int ledPin9 = 4;

void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
//pinMode(ledPin6, OUTPUT);
//pinMode(ledPin7, OUTPUT);
//pinMode(ledPin8, OUTPUT);
//pinMode(ledPin9, OUTPUT);

}
void loop() {
analogWrite(ledPin1,
random(120)+135);
analogWrite(ledPin2,
random(120)+135);
analogWrite(ledPin3,
random(120)+135);
delay(random(100));
analogWrite(ledPin4,
random(120)+135);
analogWrite(ledPin5,
random(120)+135);
//analogWrite(ledPin6,
//random(120)+135);
delay(random(100));
//analogWrite(ledPin7,
//random(120)+135);
//analogWrite(ledPin8,
//random(120)+135);
//analogWrite(ledPin9,
//random(120)+135);
//delay(random(100));

}

You forgot to tell us how the dimmer is to be controlled by the Arduino. A schematic is required!

Paul

Hello,
I tried my first time to draw a schematic, hope is good enough.

Thank you.