$(function() {

	$('#banner_img_placement').cycle({
	fx:     'scrollLeft',
	//pager:  '#banner_nav',
	timeout: 10000,
	speed: "fast",
	//random: 1,        
	random: 0,        
	after: onAfterBanner,
	next:   '#bNext',
	prev:	'#bPrev',
	slideExpr: 'img'
	
	});
    
     function onAfterBanner() { 
     	var nurl = '';
	    $('#bannerHeadlineLi').html( this.alt );
	    $('div.banner_text p.summary').html( jQuery(this).next("span").html() );
	    if(jQuery(this).attr('longdesc') != ''){ nurl = "<a href='"+jQuery(this).attr('longdesc')+"'>Leer Más</a>";}
	    $('div.banner_text p.banner_readMore').html( nurl );
	}

	
	
	$('#spotlight_pictures').cycle({ 
	    fx:     'uncover', 
	    speed:  'fast', 
	    timeout: 0, 
	    next:   '#next',
	    prev:	'#prev',
	    after: onAfterSpotlight
	});
	
	function onAfterSpotlight() {
		var nurl = '';
		if(jQuery(this).attr('longdesc') != ''){ nurl = "<a href='"+jQuery(this).attr('longdesc')+"'>Más</a>";} 
	    $('#spotlight_content').html( "<h5><a href='"+jQuery(this).attr('longdesc')+"'>" + this.title + "</a></h5><p>" + this.alt + "</p><div class='link'>"+nurl+"</div>" );
	}	
	
	$('#bNext').click(function() {
		$('#banner_img_placement').cycle('pause');
	});
	$('#bPrev').click(function() {
		$('#banner_img_placement').cycle('pause');
	});	
	
   	$(".hideNoScript").show();	
});
