interfacing dc-motor, H-bridge and arduino

I have a probrem in running my dc motor connected to a H-bridge using an arduino diecimila. The sketch is successfully uploading to the board but the motor can't run.
I am using pololu MDO3A as a h-bridge, 12 volt dc motor. I am using the sketch below:

#define motorpin1 2
#define motorpin2 3
#define motorpin3 4
#define motorpin4 5
#define enablepin 8

void setup() {
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
pinMode(motorpin3, OUTPUT);
pinMode(motorpin4, OUTPUT);

// set speedPin high so that motor can turn on:
digitalWrite(enablepin, HIGH);
}

void loop() {
digitalWrite(motorpin1, LOW);
digitalWrite(motorpin2, HIGH);
digitalWrite(motorpin3, LOW);
digitalWrite(motorpin4, HIGH);
delay(500);
digitalWrite(motorpin1, LOW);
digitalWrite(motorpin2, LOW);
digitalWrite(motorpin3, LOW);
digitalWrite(motorpin4, LOW);
}

Is my sketch okey? Or what my be the problem?
please assist.
Thank you in advance.

Please use the hash button in the reply box for posting code in future.

Code looks OK apart from the fact that it will never turn off. Well it turns off and then immediately on again. You need another delay at the end of the loop().

it's probably the hardware that's not wired up right. Are the grounds connected together?

#define motorpin1 2
#define motorpin2 3
#define motorpin3 4
#define motorpin4 5
#define enablepin 8

void setup() {
 pinMode(motorpin1, OUTPUT);
 pinMode(motorpin2, OUTPUT);
 pinMode(motorpin3, OUTPUT);
 pinMode(motorpin4, OUTPUT);

 // set speedPin high so that motor can turn on:
 digitalWrite(enablepin, HIGH);
}

void loop() {
   digitalWrite(motorpin1, LOW);  
   digitalWrite(motorpin2, HIGH);  
   digitalWrite(motorpin3, LOW);  
   digitalWrite(motorpin4, HIGH);
}

Why don't you try this sketch first. As you can see, I simply modified your loop() to only turn on the motor. Your sketch was turning on the motor for half a second and then turning it off and back on again.

Also, why bother with the enablepin? You should just connect that pin to +5v directly so as to tie it high (might as well free up a pin on the arduino). If you want to stop your motors you can just set each of the motor pins to LOW.