function beforeSlide(currSlideElement, nextSlideElement, options, forwardFlag) {
	var parameters = this.name.split(",");
	var currSlide = parameters[0];
	var top = parameters[1];
	var left = parameters[2];
	var textAlign = parameters[3];
	var color = parameters[4];

	if (top == null) top = "220";
	if (left == null) left = "30";
	if (textAlign == null) textAlign = "left";
	if (color == null) color = "FFF";
	
	$('#imageCaption').html("<a href=\"" + this.id + "\" id=\"imageCaptionLink\">" + this.alt + "</a>");
	$('#imageCaptionLink').css( { "left": left + "px", "top":top + "px", "text-align":textAlign, "color":"#" + color} );

	$('.imageMenuLink').css({"color":"#000"});
	
	$('#imageMenuGotoCol0').css({"background-color":""});
	$('#imageMenuGotoCol1').css({"background-color":""});
	$('#imageMenuGotoCol2').css({"background-color":""});
	$('#imageMenuGotoCol3').css({"background-color":""});
	$('#imageMenuGotoCol' + currSlide).css({"background-color":"#adcedf"});

	$('#imageMenuGotoCol' + currSlide).children("a").css({"color":"#000000"});	
}

$(document).ready(function() {
	$('#imageBlockImages').cycle({ 
	    delay:  3000, 
	    speed:  1000,
	    before: beforeSlide,
	    random: 0
	});
	
	$('#imageMenuGotoCol0').click(function() { 
//	    $('#imageBlockImages').cycle('pause');  
//	    $('#imageBlockImages').cycle(0); 
//	    return false; 
	    return true; 
	});
	$('#imageMenuGotoCol1').click(function() { 
//	    $('#imageBlockImages').cycle('pause');  
//	    $('#imageBlockImages').cycle(1); 
//	    return false; 
	    return true; 
	});
	$('#imageMenuGotoCol2').click(function() { 
//	    $('#imageBlockImages').cycle('pause');  
//	    $('#imageBlockImages').cycle(2); 
//	    return false; 
	    return true; 
	});
	$('#imageMenuGotoCol3').click(function() { 
//	    $('#imageBlockImages').cycle('pause');  
//	    $('#imageBlockImages').cycle(2); 
//	    return false; 
	    return true; 
	});
	$('#imageBlock').hover(function() {
	    $('#imageBlockImages').cycle('pause');  
	},
	function () {
	    $('#imageBlockImages').cycle('resume');  
	});
});

