


$(document).ready(function () {

    //Script for rotator on home page

    $('#home-pods').css('height', '228px').find('.pods').css({
        height: '215px',
        overflow: 'hidden'
    });


    $('#home-pods .nav a:first').addClass('active');

    //News rotator	



    if (jQuery.fn.NewsRotator) {
        var homePod = $('#home-pods .pods').NewsRotator({
            interval: 8000,
            items_query: '.items',
            item_query: '.item',
            image_query: '.image',
            orientation: 'horizontal',
            current_class: 'current',
            duration: 700,
            easing: "easeInOutExpo",

            beforeSlide: function () {//Before starting the rotation

                var pos = 0;
                $('#home-pods .nav a').each(function ($key, $value) {
                    if ($(this).hasClass('active')) {
                        pos = ($key + 1);
                        $(this).removeClass('active');
                    }
                });
                if (pos > 3) pos = 0;
                $('#home-pods .nav a').eq(pos).addClass('active');

            }

        });


		
		
		$('#home-pods .nav a')
		
			.click(function ($e) {
            	//$e.preventDefault();
			})
			
			.mouseover(function(){
				var obj = this;
				var pos = 0;
				$('#home-pods .nav a').each(function ($key, $value) {
					if ($(this).text() == $(obj).text())pos = $key;
				});
	
				$('#home-pods .nav a').removeClass('active').eq(pos).addClass('active');
	
				homePod.moveTo(pos);
        	});
		
    }


});





/*
$(document).ready(function () {

    //Script for rotator on home page

    $('#home-pods').css('height', '372px').find('.pods').css({
        height: '356px',
        overflow: 'hidden'
    });


    $('#home-pods .nav li:first a').addClass('active');

    //News rotator	



    if (jQuery.fn.NewsRotator) {
        var homePod = $('#home-pods .pods').NewsRotator({
            interval: 8000,
            items_query: '.items',
            item_query: '.item',
            image_query: '.image',
            orientation: 'horizontal',
            current_class: 'current',
            duration: 700,
            easing: "easeInOutExpo",

            beforeSlide: function () {//Before starting the rotation

                var pos = 0;
                $('#home-pods .nav li').each(function ($key, $value) {
                    if ($(this).find('a').hasClass('active')) {
                        pos = ($key + 1);
                        $(this).find('a').removeClass('active');
                    }
                });
                if (pos > 3) pos = 0;
                $('#home-pods .nav li').eq(pos).find('a').addClass('active');

            }

        });

		
		$('#home-pods .nav a').click(function ($e) {
            //$e.preventDefault();
		}).mouseover(function(){
            var obj = this;
            var pos = 0;
            $('#home-pods .nav a').each(function ($key, $value) {
                if ($(this).text() == $(obj).text())pos = $key;
            });

            $('#home-pods .nav a').removeClass('active').eq(pos).addClass('active');

            homePod.moveTo(pos);
        });
		
    }


});
*/


