$j=jQuery.noConflict();

// Use jQuery via $j(...)
$j(document).ready(function(){
    
    $j("div.carousel-buttons").html('<ul id="billy_indicators"></ul>');
       $j('#carousel').billy({
			transition: 'fade',
			slidePause: 5000,
			// We need custom next/prev buttons for this example. If we used the defaults (#billy_next/#billy_prev), every carousel instance on the page would scroll when they're clicked...
			nextLink: $j('#fader_billy_next'),
			prevLink: $j('#fader_billy_prev'),
			indicators: $j('#billy_indicators')
		});

        $j('#js-news').ticker({titleText: ''});
        $j('#ticker-content').css('height', '27px');

		$j(function() {
			$j( '#datepickerfrom' ).datepicker({
				showOn: 'button',
				buttonImage: '/wp-content/themes/numberten/images/calendar.gif',
				buttonImageOnly: true
			});
		});
		$j(function() {
			$j( '#datepickerto' ).datepicker({
				showOn: 'button',
				buttonImage: '/wp-content/themes/numberten/images/calendar.gif',
				buttonImageOnly: true
			});
		});
        

        $j("#carousel-surround2 .item").hover(function () {
            $j(this).css('background-color', '#000');
            $j(this).find('img').fadeTo("slow", 0.50);
        },
            function () {
                $j(this).find('img').fadeTo("slow", 1.0);

            }
        )
        
        $j("#policygallery-wrapper").css({width: '612px', height: '272px', background:'#eeeeee'});
        $j("#policygallery-wrapper #tw-info").css('display', 'inline');
        $j("#policygallery-wrapper #tw-info").html('<h3 style="font-size: 18px; margin-top: 17px; color: #fff">Scroll over the images to view the Government\'s key policy areas</p>');
        Cufon.refresh('#policygallery-wrapper #tw-info h3');
        $j("#policygallery-wrapper .item").css('width', '102px').css('height', '68px').css('background', '#999')
        $j("#policygallery-wrapper .item a img").css('display', 'inline');
        $j("#policygallery-wrapper .item").css('background-color', '#000');
        $j("#policygallery-wrapper .item").find('img').fadeTo("fast", 0.7);
        $j("#policygallery-wrapper .item div").css('display', 'none');
        
        $j("#policygallery-wrapper .item").hover(function () {
            $j("#tw-info").empty();
            $j("#tw-info").html($j(this).find('div').html());
            $j(this).find('img').fadeTo("fast", 1.00);
            Cufon.refresh('#policygallery-wrapper #tw-info h3');
        },
            function () {
                $j(this).find('img').fadeTo("fast", 0.70);

            }
        )
        
    
});
   

jQuery.extend(jQuery.easing, {
    def: 'easeOutQuad',
	easeInOutExpo: function (x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
    }
});
