// Imulus Global Javscript Code

$(document).ready(function() {
	$('.home #main').css('display', 'block');
	$('.home #sidebar').css('display', 'block');
});

//Cycle homepage scripts and setup
$(document).ready(function() {
	$('.home #main').cycle({ 
		fx: 		'fade',
	    speed:       500, 
	    timeout:     3000, 
	    pager:      '#teasers', 
	    pagerEvent: 'mouseover',
		pause: 		true, 
	    cleartype:     true,
		cleartypeNoBg: true,
	    pauseOnPagerHover: true, 
	    pagerEvent: 'mouseover', 
	    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#teasers li:eq(' + (idx) + ') a';
        }
	});

	$('#teasers li a').click(function() {
		location.href=$(this).attr("href");
	});

    $('.home #ticker').cycle({
		fx: 			'fade', 
		cleartype:     	true,
		cleartypeNoBg: 	true
	});
});

// Create an external link icon using an image
$(document).ready(function() {
	$('a:not(:has(img)|.button)').filter(function() {
		return this.hostname && this.hostname !== location.hostname;
	}).after(' <img class="external" src="/images/icons/external.gif" alt="external link"/>');
});
