$(document).ready(function(){
						   
$('#dodajKom').toggle(function(){ 
$('#komentari-container').slideUp();
}, function(){
$('#komentari-container').slideDown();    
});
    
$('.1').show();
$('.2').hide();
$('.3').hide();
$('.4').hide();
$('.5').hide();
$('.6').hide();
$('.7').hide();

                $('#container-1').tabs();
                $('#container-2').tabs(2);
                $('#container-3').tabs({ fxSlide: true });
                $('#container-4').tabs({ fxFade: true, fxSpeed: 'fast' });
                $('#container-5').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'normal' });
                $('#container-6').tabs({
                    fxFade: true,
                    fxSpeed: 'fast',
                    onClick: function() {
                        alert('onClick');
                    },
                    onHide: function() {
                        alert('onHide');
                    },
                    onShow: function() {
                        alert('onShow');
                    }
                });
                $('#container-7').tabs({ fxAutoHeight: true });
                $('#container-8').tabs({ fxShow: { height: 'show', opacity: 'show' }, fxSpeed: 'normal' });
                $('#container-9').tabs({ remote: true });
                $('#container-10').tabs();
                $('#container-11').tabs({ disabled: [3] });

                $('<p><a href="#">Disable third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).disableTab(3);
                    return false;
                });
                $('<p><a href="#">Activate third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).triggerTab(3);
                    return false;
                });
                $('<p><a href="#">Enable third tab<\/a><\/p>').prependTo('#fragment-28').find('a').click(function() {
                    $(this).parents('div').eq(1).enableTab(3);
                    return false;
                });

//News Slider Start
//Setup all the slides.

var currentSlide = -1; //keeps track of current slide
var prevSlide = null; //keeps track of last selected slide.
var slides = $('#sviSlajdovi div'); // all the slides
var interval = null; //For setInerval
var FADE_SPEED = 500;  //How long it takes to transition.
var DELAY_SPEED = 2000; //How long each slide stays up.

//Set the click event for each tab.
for (var i = 7;i >= 1 ; i--){
    $('[name='+i+']').bind("click",{index:i},function(event){
        //Sets the current slide to the one clicked.
        currentSlide = event.data.index;
        //Go to the slide.
        gotoSlide(event.data.index);
    });
};

//Goes to the next slide.
function nextSlide(){

    //if the current slide is at the end, loop to the first slide.
    
    if (currentSlide >= 7){
        currentSlide = 1;
    }else{
        currentSlide++
    }

   
    //Go to the slide.
    gotoSlide(currentSlide);

}


//Go to the slide specified in the argument.
function gotoSlide(slideNum){

    //If the slide they're trying to access isn't
    //the currently selected slide...
    if (slideNum != prevSlide){

        //The very first slide the prevSlide will be null.
        //No point in trying to hide the slide when it doesn't
        //exist yet.
        if (prevSlide != null){
           
            //Hide previoius slide and deselect old tab.
            $('.'+prevSlide).hide();
            $('[name='+prevSlide+']').attr('id','');
        }
       
       
        //Select new tab.
        $('[name='+slideNum+']').attr('id','ActiveN');
        $('.'+slideNum).show();

        //Display new slide.
        //$(slides[slideNum]).stop().slideDown(FADE_SPEED);
       
        //Make the currentSlide the old slide for next transition.
        prevSlide = currentSlide;

        //if the auto slide advance is set, stop it, then start again.
        if (interval != null){
            clearInterval(interval);
        }
       
        //Goes to next slide every couple of seconds.
        interval = setInterval(nextSlide, DELAY_SPEED);
    }

}

    $('ul#listticker > li > a').hover(
      function () {

        $(this).attr('id','ActiveN');
        broj_vijesti = $(this).attr('name');
        
          for(i = 1;i<=7;i++)
          {
            if(i != broj_vijesti)
            $('.'+i).hide();
          }
        //Sets the current slide to the one clicked.
        currentSlide = broj_vijesti;
        //Go to the slide.
        gotoSlide(broj_vijesti);
        clearInterval(interval);
      }, 
      function () {
        $(this).attr('id','ActiveN');
        broj_vijesti = $(this).attr('name');
        interval = setInterval(nextSlide, DELAY_SPEED);
      }
      );
      
//get things started.
nextSlide();


//News Slider End
                
            });
			