var textFix = jQuery('.cycleTextFix');
var popupLink = document.getElementById('popupLink');
	
jQuery(window).load(function(){
    
    jQuery('.sectionImagesList').cycle({
		ex: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...         
        speed:  'slow', 
        timeout: 4000,
        next : '.next',
        prev : '.prev', 
        before : function(currSlideElement, nextSlideElement, options, forwardFlag){
            el = jQuery(nextSlideElement);
            image = el.children('.cycleTextContainer').html();;
            textFix.html(image);
        } 
	});
	
	if(popupLink != null)
	{
		window.setTimeout('popupLink.click()',800);    
	}
		
});

if(typeof(HTMLElement) != 'undefined')
{
	HTMLElement.prototype.click = function() {
		var evt = this.ownerDocument.createEvent('MouseEvents');
		evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
		this.dispatchEvent(evt);
	}
}

