
function showFlashItem(id) {
	jQuery(".hp_flashcarroussel_item").hide();
	jQuery("#hp_flash_" + id).show();
	jQuery(".flashNav a").removeClass('active');
	jQuery("#hp_flash_link_" + id).addClass('active');
}

function showFlashItemPrepare(id) {
	if(cPlaying) clearTimeout(cTimer);
	showFlashItem(id);
	for (var i = 0; i < cItems.length; i++) {
		if(cItems[i] == id) cCurrentActive = i + 1;
	}
	if(cPlaying) {
		cTimer = setTimeout("playHPCarrousel()", cHold * 1000);
	}
}

function playHPCarrousel() {
	if(cPlaying) {
		if(cCurrentActive == cItems.length) {
			showFlashItem(cItems[0]);
			cCurrentActive = 1;
		} else {
			showFlashItem(cItems[cCurrentActive]);
			cCurrentActive += 1;
		}
		cTimer = setTimeout("playHPCarrousel()", cInterval * 1000);
	}
}

function showNextHPCarrousel() {
	var k = cCurrentActive + 1;
	if(cCurrentActive == cItems.length) k = 1;
	showFlashItemPrepare(cItems[k - 1]);
}

function showPrevHPCarrousel() {
	var k = cCurrentActive - 1;
	if(cCurrentActive == 1) k = cItems.length;
	showFlashItemPrepare(cItems[k - 1]);
}

function hoverCarrouselImg(img, s) {
	if(s == 'over') img.src = img.src.replace('.png', 'Hover.png');
	if(s == 'out') img.src = img.src.replace('Hover.png', '.png');
}

function toggleHPCarrousel() {
	if(cPlaying) {
		clearTimeout(cTimer);
		cPlaying = false;
		jQuery("#hp_flash_button_playpause").attr('src', '/static/site_images/ill_play.gif');
	} else {
		cPlaying = true;
		playHPCarrousel();
		jQuery("#hp_flash_button_playpause").attr('src', '/static/site_images/ill_stop.gif');
	}
}

						var cTemp;
						var cInterval = "3";
						var cHold = "10";
						
						
						cTemp = "8";
						if(parseInt(cTemp)) cInterval = parseInt(cTemp);
						cTemp = "";
						if(parseInt(cTemp)) cHold = parseInt(cTemp);
						
						
							var cTimer;
							cTimer = setTimeout("playHPCarrousel()", cInterval * 1000);
							var cCurrentActive = 1;
							var cPlaying = true;
						
						
