Timer not initiating

i have a code for photo gallery that has previous and next buttons.but i want to sync them with timer.but the problem is that my timer is not starting…please if anyone can help?

var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
pathToPICS = gallery.attributes.picturePath;
NUMOFPICS = gallery.childNodes.length;
for (var i = 0; i<NUMOFPICS; i++) {
//tempArray.push(gallery.childNodes*.attributes.title);
picArray.push(gallery.childNodes*.attributes.source);
}
}
////////////////////////////////////////////
//loading first picture
picHolder.loadPic(0);
//thumbnail_mc.loadPic(0);
////////////////////////////////////////////
function startTimer() {
timerStartTime = getTimer();
_root.onEnterFrame = function() {
timer = Math.floor((getTimer()-timerStartTime)/1000);
if (timer>2 && timer%2 == 0) {
tottime = tottime+2;
timer = “started”;
//loadpic(0);
showTimer = tottime;
timerStartTime = 0;
timer = 0;
startTimer();
}
};
}
// Button Code
prev.onRelease = function() {
if (cur == 0) {
picHolder.loadPic(picArray.length-1);
//test1= “previous”;
} else {
picHolder.loadPic(cur-1);
//test1= “previous”;
}
};
next.onRelease = function() {
if (cur == picArray.length-1) {
picHolder.loadPic(0);
//test1= “next”;
//loadthumbs(i);
} else {
picHolder.loadPic(cur+1);
//test1= “next”;
}

};

};
test=timer;
// Load the xml file
gallery_xml.load(xmlFILE);
startTimer();
showTimer1 = tottime;

please tell me where am i going wrong?