function getPromo(lnk) {
	window.location = promo_href;
}

function setPromo(index) {
	var cycle = true;
	if (index != null) {
		promo_index = index;
		cycle = false;
	} else if(promo_index == promoImages.length-1) {
		promo_index = 0;
	} else {
		promo_index++;
	}
	document.images['promomain'].src = promoImages[promo_index].src;
	getFormElement('promoMap_main').href = promoLinks[promo_index];
	promo_href = promoLinks[promo_index];
  if(cycle) {
		startTimer();
	}
}
            	
function setPreviousPromo() {
	var index;
	if(promo_index == 0) {
		index = promoImages.length - 1;
	} else {
		index = promo_index - 1;
	}
	stopTimer();
	setPromo(index);
}
            	
function startTimer() {
	stop = setTimeout('setPromo()', 5000);
}

function stopTimer() {
	clearTimeout(stop);
}
        
function getFormElement(formElement) {
	var elementOnForm;
	if (document.getElementById) {
		// this is the way the standards work
		elementOnForm = document.getElementById(formElement);
	}	else if (document.all) {
		// this is the way old msie versions work
		elementOnForm = document.all[formElement];
	} else if (document.layers) {
		// this is the way nn4 works
		elementOnForm = document.layers[formElement];
	}
	return elementOnForm;
}
		
function initPromo() {
	setPromo();
}