$(document).ready(function(){

demopage_switchslider(); 			

$('#frontpage-slider').aviaSlider();
																									
});



var speed = 3000;

            var timer = null;
 
        	$(document).ready(function(){
                $('#control-superior-tabs').click(function(event) {

                    clearTimeout(timer);



                    var last = $('#notes').children(':last');

                    last.remove();

                    $('#notes').prepend(last);

        

                    //timer = setTimeout('timerClick()', speed);

                });



                $('#control-inferior-tabs').click(function(event) {    

                    clearTimeout(timer);



                    $('#notes').css('top', '-101px');



                    var first = $('#notes').children(':first');

                    first.remove();

                    $('#notes').css('top', '0px');

                    $('#notes').append(first);         



                   // timer = setTimeout('timerClick()', speed);

                });



               // if($('#notes').children().length > 4)      

               //     timer = setTimeout('timerClick()', speed);
 
    			
			});
 
            function timerClick() {

                $('#notes').animate({

                        top: '-101px'

                    },

                    1200,

                    'swing',

                    function() {

                        var first = $('#notes').children(':first');

                        first.remove();

                        $('#notes').css('top', '0px');

                        $('#notes').append(first); 

                    }

                );                


//
//                timer = setTimeout('timerClick()', speed);

            }


// the following stuff is only for the demo page to switch sliders
function demopage_switchslider()
{
	var param = window.location.href.substring(window.location.href.indexOf('?')+8);
	
	
	if(param != undefined && param != '' && window.location.href.indexOf('?') > 0)
	{
		$('.aviaslider').attr('id',param); //change the id of the slideshow depending on the url, so another slideshow gets applied
	}
}




