/*
 * Customized settings for Cycle Plugin:
 * 
 * Assembled by: DENALImultimedia.com
 * Created: 18-Nov-2011
 * 
 * Requires: cycle plugin 2.30+
 *
 * Changes:
 * 2011-mm-dd / DENALImultimedia: ... desc ...
 *
 */
 
//<script type="text/javascript">
$.fn.cycle.defaults.timeout = 6000;
$(function() {
    // run the code in the markup!

    
    $('#s4').before('<div id="nav" class="nav" style="">').cycle({
        fx:     'fade',
        speed:  300,
        timeout: 3000,
        pager:  '#cyclenav',
		after: onAfter,
		pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#cyclenav li:eq(' + (idx) + ') a';
        }


    });
});


//<!-- following not needed for #s4 -->
function onBefore() {
    $('#output').html("Scrolling image:<br/>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    var Link = "";
    var test = this.href;
    if (test !=undefined) {
        Link = '<br/><a href="' + this.href + '">' + 'Click here to view project...' + '</a>';
    }


    $('#output').html("")
        .append('<strong>' + this.title + '</strong>')
    //.append('<h3>' + this.title + '</h3>' + this.href + '')  //test what href's value is
    
    //***un-comment following if the link shall be displayed
    //.append(Link);

   
   
   
}
//</script>

