$(function() {
    
    $('#slideshow').cycle({ 
        fx:     'fade',
    	timeout: 6000,
    	delay:  -2000,
    	pause:   1,
    	pager:  '#nav', 
    	pagerAnchorBuilder: function(idx, slide) { 
     	   // return selector string for existing anchor 
     	   return '#nav li:eq(' + idx + ') a'; 
    } 
}); 
});

function onBefore() {
    $('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}

$(function() {
    
    $('#tweet').cycle({
        fx:     'scrollUp',
    	timeout: 6000,
    	delay:  -2000,
    	pause:   1,
    });
});

function onBefore() {
    $('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}

$(function() {
    	
		$('#product-slideshow').cycle({ 
        fx:     'fade',
    	timeout: 6000,
    	delay:  -2000,
    	pause:   1,
/*    	autostop: 1,*/
    	pager:  '#product-arrow', 
    	pagerAnchorBuilder: function(idx, slide) { 
     	   // return selector string for existing anchor 
     	   return '#product-arrow li:eq(' + idx + ') a'; 
        } 
    });
	
});

function onBefore() {
    $('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}


$(function() {
    
    $('#quote').cycle({
        fx:     'fade',
    	timeout: 6000,
    	delay:  -2000,
    	pause:   1,
    });
});

function onBefore() {
    $('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}

/*Add carrot to subnav menu*/
$(function() {
	 if ($('.SmartOnMobileMenu .current_page_parent').length > 0)
	 {
	 $('.SmartOnMobileMenu .current_page_parent').append('<div class="addCarrot"><img src = "/wp-content/themes/smartie/images/arrow_8.png" /></div>');
	 }
	 else
	 {
		 $('.SmartOnMobileMenu .current_page_item').append('<div class="addCarrot"><img src = "/wp-content/themes/smartie/images/arrow_8.png" /></div>');
	 }
});



