(function($){
    $.fn.extend({
            caroussel: function(options) {
                var objCont = $(this);
                var images = new Array();
                var startImage;

                var i=0;
                $('img', objCont).each(function(){
                    $(this).css('margin-top', '100px');
                    if (options.start) 
					{
						$(this).removeClass('start');
					}
                    if ((i+1) == options.start) 
					{
						$(this).addClass('start');
					}
                    if (!$(this).hasClass('start')) 
					{
						images[i] = $(this); 
					}
					else
					{
						startImage = $(this);
					}
                    i++;                    
                });
               

var numberOfSlides;
var hide_next_prev = 0;
if($('.one').length>5)
{
	hide_next_prev = 1;
}
else if($('.two').length>5)
{
		hide_next_prev = 1;
}
else if($('.three').length>5)
{
		hide_next_prev = 1;
}
else if($('.six').length>5)
{
		hide_next_prev = 1;
}



if($('.one').length>0)
{
	numberOfSlides = $('.one').length;
	
}
else if($('.two').length>0)
{
		numberOfSlides = $('.two').length;
}
else if($('.three').length>0)
{
		numberOfSlides = $('.three').length;
}
else if($('.six').length>0)
{
		numberOfSlides = $('.six').length;
}

                $(objCont).empty();
                var objCont2 = document.createElement('div');
                $(objCont2).appendTo(objCont);
                $(objCont2).css('padding-right', '60px');
				$(objCont2).css('margin-top', '25px');
				
				var rightEnd = document.createElement('div');
				$(rightEnd).attr('id', 'rightEnd');
				$(rightEnd).css('padding-top', '125px');
                $(rightEnd).css('float', 'right').css('vertical-align', 'bottom');
				
				var rightEndImage = document.createElement('img');
				$(rightEndImage).attr('id', 'rightScroll');
		        $(rightEndImage).css('cursor', 'pointer');
				$(rightEndImage).attr('src', 'sports_images/next_car.png');
				$(rightEndImage).appendTo(rightEnd);
                $(rightEnd).appendTo(objCont2);
				
				if(hide_next_prev == 0)
				{
					$(rightEndImage).css('visibility', 'hidden');
				}
				
                i=0;
                var rightDiv = document.createElement('div');
				$(rightDiv).attr('id', 'rightDiv');
                $(rightDiv).css('float', 'right').css('vertical-align', 'middle');                
                while(i < 2) {
					
                    $(images[i]).css('cursor', 'pointer')
                    $(images[i]).appendTo(rightDiv);
                    $(images[i]).click(showImage);
                    $(images[i]).hover(mouseOver, mouseOut);
					i++;                    
                }
                $(rightDiv).appendTo(objCont2);
                
                var centerDiv = document.createElement('div');
                $(centerDiv).css('float', 'right');
                showDiv = document.createElement('div');
                $(showDiv).attr('id', 'showDiv');
                $(showDiv).appendTo(centerDiv);
                $(centerDiv).appendTo(objCont2);
                
                var activeDiv = document.createElement('div');
                $(activeDiv).attr('id', 'activeDiv');
                $(activeDiv).css('display', 'none');
                $(startImage).appendTo(activeDiv);
                $(activeDiv).appendTo(objCont2);
                
                var leftDiv = document.createElement('div');
				$(leftDiv).attr('id', 'leftDiv');
                $(leftDiv).css('float', 'right').css('vertical-align', 'middle');
             
                while(i<5) {
					$(images[i]).css('cursor', 'pointer');
                    $(images[i]).appendTo(leftDiv);
                    $(images[i]).click(showImage);
                    $(images[i]).hover(mouseOver, mouseOut);                    
                    i++;
                }
				while(i<numberOfSlides) {
                    $(images[i]).appendTo(leftDiv);
					$(images[i]).css('display', 'none');
                    i++;
                }

                $(leftDiv).appendTo(objCont2);
				
				var leftEnd = document.createElement('div');
				$(leftEnd).attr('id', 'leftEnd');
				$(leftEnd).css('padding-top', '125px');
                $(leftEnd).css('float', 'right').css('vertical-align', 'bottom');
				
				var leftEndImage = document.createElement('img');
		            $(leftEndImage).css('cursor', 'pointer');
					$(leftEndImage).attr('id', 'leftScroll');
					$(leftEndImage).attr('src', 'sports_images/prev_car.png');
					$(leftEndImage).appendTo(leftEnd);
                	$(leftEnd).appendTo(objCont2);

				if(hide_next_prev == 0)
				{
					$(leftEndImage).css('visibility', 'hidden');
				}
				
                var s = $('#activeDiv img').attr('alt');

                if (s.indexOf('flv') != -1 || s.indexOf('wmv') != -1) {
					
                    var centerImage = document.createElement('a');
					$(centerImage).addClass("media {width:300, autoplay:true}");
                    $(centerImage).attr('href', s);
					$(centerImage).attr('id', 'media');
					$('#showDiv').css('height', '300px');
					
					$(centerImage).appendTo($('#showDiv'));
					$('#showDiv').css('border', '4px solid #fff');
                    
                } else {
                    var centerImage = document.createElement('img');
                    $(centerImage).attr('src', s);
                    $(centerImage).css('width', '350px').css('height', '250px');
					$(centerImage).appendTo($('#showDiv'));
					$('#showDiv').css('border', '4px solid #fff');
					$('#showDiv').css('width', '350px');
					$('#showDiv').css('height', '250px');

                }
                
                $('a.media').media({autoplay:  true, showControls:false , flashvars: { controlbar: 'over', autostart: 'true', repeat: 'always', displayclick: 'fullscreen', scaling : 'exactfit' }});
				

 
$("#leftScroll").click(
function()
{

	if($('.two').length >0)
	{
	var t1 = $("#left_end").attr('title');
	var alt1 = $("#left_end").attr('alt');
	var src1 = $("#left_end").attr('src');
	
	
	$("#left_end").attr('title', $('#left_first').attr('title'));
	$("#left_end").attr('alt', $('#left_first').attr('alt'));
	$("#left_end").attr('src', 'sports_images/lessmills/left_end/' + $('#left_first').attr('title') + '.png');

	
	$("#left_first").attr('title', $('#right_first').attr('title'));
	$("#left_first").attr('alt', $('#right_first').attr('alt'));
	$("#left_first").attr('src', 'sports_images/lessmills/left_first/' + $('#right_first').attr('title') + '.png');

	
	
	$("#right_first").attr('title', $('#right_end').attr('title'));
	$("#right_first").attr('alt', $('#right_end').attr('alt'));
	$("#right_first").attr('src', 'sports_images/lessmills/right_first/' + $('#right_end').attr('title') + '.png');

	
	$("#right_end").attr('title', $('#add1').attr('title'));
	$("#right_end").attr('alt', $('#add1').attr('alt'));
	$("#right_end").attr('src', 'sports_images/lessmills/right_end/' + $('#add1').attr('title') + '.png');

	 
	 $("#add1").attr('title', $('#add2').attr('title'));
	 $("#add1").attr('alt', $('#add2').attr('alt'));
	 $("#add1").attr('src','sports_images/lessmills/right_end/' + $('#add2').attr('title') + '.png' );
	 
	 $("#add2").attr('title', t1);
	 $("#add2").attr('alt', alt1);
	 $("#add2").attr('src', src1);
	}
	
	else if($('.three').length >0)
	{
	var t1 = $("#left_end").attr('title');
	var alt1 = $("#left_end").attr('alt');
	var src1 = $("#left_end").attr('src');
	
	
	$("#left_end").attr('title', $('#left_first').attr('title'));
	$("#left_end").attr('alt', $('#left_first').attr('alt'));
	$("#left_end").attr('src', 'sports_images/allinsports/left_end/' + $('#left_first').attr('title') + '.png');

	
	$("#left_first").attr('title', $('#right_first').attr('title'));
	$("#left_first").attr('alt', $('#right_first').attr('alt'));
	$("#left_first").attr('src', 'sports_images/allinsports/left_first/' + $('#right_first').attr('title') + '.png');

	
	
	$("#right_first").attr('title', $('#right_end').attr('title'));
	$("#right_first").attr('alt', $('#right_end').attr('alt'));
	$("#right_first").attr('src', 'sports_images/allinsports/right_first/' + $('#right_end').attr('title') + '.png');

	
	$("#right_end").attr('title', $('#add1').attr('title'));
	$("#right_end").attr('alt', $('#add1').attr('alt'));
	$("#right_end").attr('src', 'sports_images/allinsports/right_end/' + $('#add1').attr('title') + '.png');

	 $("#add1").attr('title', $('#add2').attr('title'));
	 $("#add1").attr('alt', $('#add2').attr('alt'));
	 $("#add1").attr('src','sports_images/allinsports/right_end/' + $('#add2').attr('title') + '.png' );
	 
	 $("#add2").attr('title', $('#add3').attr('title'));
	 $("#add2").attr('alt', $('#add3').attr('alt'));
	 $("#add2").attr('src','sports_images/allinsports/right_end/' + $('#add3').attr('title') + '.png' );
	 
	 $("#add3").attr('title', $('#add4').attr('title'));
	 $("#add3").attr('alt', $('#add4').attr('alt'));
	 $("#add3").attr('src','sports_images/allinsports/right_end/' + $('#add4').attr('title') + '.png' );
	 
	 $("#add4").attr('title', $('#add5').attr('title'));
	 $("#add4").attr('alt', $('#add5').attr('alt'));
	 $("#add4").attr('src','sports_images/allinsports/right_end/' + $('#add5').attr('title') + '.png' );
	 
	  
	 $("#add5").attr('title', $('#add6').attr('title'));
	 $("#add5").attr('alt', $('#add6').attr('alt'));
	 $("#add5").attr('src','sports_images/allinsports/right_end/' + $('#add6').attr('title') + '.png' );
	 
	 $("#add6").attr('title', $('#add7').attr('title'));
	 $("#add6").attr('alt', $('#add7').attr('alt'));
	 $("#add6").attr('src','sports_images/allinsports/right_end/' + $('#add7').attr('title') + '.png' );
	 
	 $("#add7").attr('title', $('#add8').attr('title'));
	 $("#add7").attr('alt', $('#add8').attr('alt'));
	 $("#add7").attr('src','sports_images/allinsports/right_end/' + $('#add8').attr('title') + '.png' );
	 
	 $("#add8").attr('title', $('#add9').attr('title'));
	 $("#add8").attr('alt', $('#add9').attr('alt'));
	 $("#add8").attr('src','sports_images/allinsports/right_end/' + $('#add9').attr('title') + '.png' );
	 
	 $("#add9").attr('title', $('#add10').attr('title'));
	 $("#add9").attr('alt', $('#add10').attr('alt'));
	 $("#add9").attr('src','sports_images/allinsports/right_end/' + $('#add10').attr('title') + '.png' );
	 
	 $("#add10").attr('title', $('#add11').attr('title'));
	 $("#add10").attr('alt', $('#add11').attr('alt'));
	 $("#add10").attr('src','sports_images/allinsports/right_end/' + $('#add11').attr('title') + '.png' );
	 
     $("#add11").attr('title', $('#add12').attr('title'));
	 $("#add11").attr('alt', $('#add12').attr('alt'));
	 $("#add11").attr('src','sports_images/allinsports/right_end/' + $('#add12').attr('title') + '.png' );

     $("#add12").attr('title', $('#add13').attr('title'));
     $("#add12").attr('alt', $('#add13').attr('alt'));
	 $("#add12").attr('src','sports_images/allinsports/right_end/' + $('#add13').attr('title') + '.png' );


     $("#add13").attr('title', $('#add14').attr('title'));
     $("#add13").attr('alt', $('#add14').attr('alt'));
	 $("#add13").attr('src','sports_images/allinsports/right_end/' + $('#add14').attr('title') + '.png' );


  $("#add14").attr('title', $('#add15').attr('title'));
 $("#add14").attr('alt', $('#add15').attr('alt'));
	 $("#add14").attr('src','sports_images/allinsports/right_end/' + $('#add15').attr('title') + '.png' );



  $("#add15").attr('title', $('#add16').attr('title'));
 $("#add15").attr('alt', $('#add16').attr('alt'));
	 $("#add15").attr('src','sports_images/allinsports/right_end/' + $('#add16').attr('title') + '.png' );



	 $("#add16").attr('title', t1);
	 $("#add16").attr('alt', alt1);
	 $("#add16").attr('src', src1);
	}
	
	else if($('.six').length >0)
	{
	var t1 = $("#left_end").attr('title');
	var alt1 = $("#left_end").attr('alt');
	var src1 = $("#left_end").attr('src');
	
	
	$("#left_end").attr('title', $('#left_first').attr('title'));
	$("#left_end").attr('alt', $('#left_first').attr('alt'));
	$("#left_end").attr('src', 'sports_images/allincare/left_end/' + $('#left_first').attr('title') + '.png');

	
	$("#left_first").attr('title', $('#right_first').attr('title'));
	$("#left_first").attr('alt', $('#right_first').attr('alt'));
	$("#left_first").attr('src', 'sports_images/allincare/left_first/' + $('#right_first').attr('title') + '.png');

	
	
	$("#right_first").attr('title', $('#right_end').attr('title'));
	$("#right_first").attr('alt', $('#right_end').attr('alt'));
	$("#right_first").attr('src', 'sports_images/allincare/right_first/' + $('#right_end').attr('title') + '.png');

	
	$("#right_end").attr('title', $('#add1').attr('title'));
	$("#right_end").attr('alt', $('#add1').attr('alt'));
	$("#right_end").attr('src', 'sports_images/allincare/right_end/' + $('#add1').attr('title') + '.png');

	 
	 $("#add1").attr('title', $('#add2').attr('title'));
	 $("#add1").attr('alt', $('#add2').attr('alt'));
	 $("#add1").attr('src','sports_images/allincare/right_end/' + $('#add2').attr('title') + '.png' );
	 
	 $("#add2").attr('title', t1);
	 $("#add2").attr('alt', alt1);
	 $("#add2").attr('src', src1);
	}
	
});
 
 

$("#rightScroll").click(
function()
{
	if($('.two').length >0)
	{
	var t1 = $("#right_end").attr('title');
	var alt1 = $("#right_end").attr('alt');
	var src1 = $("#right_end").attr('src');
	
	
	$("#right_end").attr('title', $('#right_first').attr('title'));
	$("#right_end").attr('alt', $('#right_first').attr('alt'));
	$("#right_end").attr('src', 'sports_images/lessmills/right_end/' + $('#right_first').attr('title') + '.png');

	
	$("#right_first").attr('title', $('#left_first').attr('title'));
	$("#right_first").attr('alt', $('#left_first').attr('alt'));
	$("#right_first").attr('src', 'sports_images/lessmills/right_first/' + $('#left_first').attr('title') + '.png');

	
	
	$("#left_first").attr('title', $('#left_end').attr('title'));
	$("#left_first").attr('alt', $('#left_end').attr('alt'));
	$("#left_first").attr('src', 'sports_images/lessmills/left_first/' + $('#left_end').attr('title') + '.png');

	
	$("#left_end").attr('title', $('#add2').attr('title'));
	$("#left_end").attr('alt', $('#add2').attr('alt'));
	$("#left_end").attr('src', 'sports_images/lessmills/left_end/' + $('#add2').attr('title') + '.png');

	 
	 $("#add2").attr('title', $('#add1').attr('title'));
	 $("#add2").attr('alt', $('#add1').attr('alt'));
	 $("#add2").attr('src','sports_images/lessmills/left_end/' + $('#add1').attr('title') + '.png' );
	 
	 $("#add1").attr('title', t1);
	 $("#add1").attr('alt', alt1);
	 $("#add1").attr('src', src1);
	}
	
	else if($('.three').length >0)
	{
	var t1 = $("#right_end").attr('title');
	var alt1 = $("#right_end").attr('alt');
	var src1 = $("#right_end").attr('src');
	
	
	$("#right_end").attr('title', $('#right_first').attr('title'));
	$("#right_end").attr('alt', $('#right_first').attr('alt'));
	$("#right_end").attr('src', 'sports_images/allinsports/right_end/' + $('#right_first').attr('title') + '.png');

	
	$("#right_first").attr('title', $('#left_first').attr('title'));
	$("#right_first").attr('alt', $('#left_first').attr('alt'));
	$("#right_first").attr('src', 'sports_images/allinsports/right_first/' + $('#left_first').attr('title') + '.png');

	
	
	$("#left_first").attr('title', $('#left_end').attr('title'));
	$("#left_first").attr('alt', $('#left_end').attr('alt'));
	$("#left_first").attr('src', 'sports_images/allinsports/left_first/' + $('#left_end').attr('title') + '.png');

	
	$("#left_end").attr('title', $('#add16').attr('title'));
	$("#left_end").attr('alt', $('#add16').attr('alt'));
	$("#left_end").attr('src', 'sports_images/allinsports/left_end/' + $('#add16').attr('title') + '.png');


 $("#add16").attr('title', $('#add15').attr('title'));
	 $("#add16").attr('alt', $('#add15').attr('alt'));
	 $("#add16").attr('src','sports_images/allinsports/left_end/' + $('#add15').attr('title') + '.png' );

 $("#add15").attr('title', $('#add14').attr('title'));
	 $("#add15").attr('alt', $('#add14').attr('alt'));
	 $("#add15").attr('src','sports_images/allinsports/left_end/' + $('#add14').attr('title') + '.png' );

 $("#add14").attr('title', $('#add13').attr('title'));
	 $("#add14").attr('alt', $('#add13').attr('alt'));
	 $("#add14").attr('src','sports_images/allinsports/left_end/' + $('#add13').attr('title') + '.png' );


 $("#add13").attr('title', $('#add12').attr('title'));
	 $("#add13").attr('alt', $('#add12').attr('alt'));
	 $("#add13").attr('src','sports_images/allinsports/left_end/' + $('#add12').attr('title') + '.png' );

	 
	 $("#add12").attr('title', $('#add11').attr('title'));
	 $("#add12").attr('alt', $('#add11').attr('alt'));
	 $("#add12").attr('src','sports_images/allinsports/left_end/' + $('#add11').attr('title') + '.png' );
	 
	 $("#add11").attr('title', $('#add10').attr('title'));
	 $("#add11").attr('alt', $('#add10').attr('alt'));
	 $("#add11").attr('src','sports_images/lessmills/left_end/' + $('#add10').attr('title') + '.png' );
	 
	 $("#add10").attr('title', $('#add9').attr('title'));
	 $("#add10").attr('alt', $('#add9').attr('alt'));
	 $("#add10").attr('src','sports_images/allinsports/left_end/' + $('#add9').attr('title') + '.png' );
	 
	 $("#add9").attr('title', $('#add8').attr('title'));
	 $("#add9").attr('alt', $('#add8').attr('alt'));
	 $("#add9").attr('src','sports_images/allinsports/left_end/' + $('#add8').attr('title') + '.png' );
	 
	 $("#add8").attr('title', $('#add7').attr('title'));
	 $("#add8").attr('alt', $('#add7').attr('alt'));
	 $("#add8").attr('src','sports_images/allinsports/left_end/' + $('#add7').attr('title') + '.png' );
	 
	 $("#add7").attr('title', $('#add6').attr('title'));
	 $("#add7").attr('alt', $('#add6').attr('alt'));
	 $("#add7").attr('src','sports_images/allinsports/left_end/' + $('#add6').attr('title') + '.png' );
	 
	 $("#add6").attr('title', $('#add5').attr('title'));
	 $("#add6").attr('alt', $('#add5').attr('alt'));
	 $("#add6").attr('src','sports_images/allinsports/left_end/' + $('#add5').attr('title') + '.png' );
	 
	 $("#add5").attr('title', $('#add4').attr('title'));
	 $("#add5").attr('alt', $('#add4').attr('alt'));
	 $("#add5").attr('src','sports_images/allinsports/left_end/' + $('#add4').attr('title') + '.png' );
	 
	 $("#add4").attr('title', $('#add3').attr('title'));
	 $("#add4").attr('alt', $('#add3').attr('alt'));
	 $("#add4").attr('src','sports_images/allinsports/left_end/' + $('#add3').attr('title') + '.png' );
	 
	 $("#add3").attr('title', $('#add2').attr('title'));
	 $("#add3").attr('alt', $('#add2').attr('alt'));
	 $("#add3").attr('src','sports_images/allinsports/left_end/' + $('#add2').attr('title') + '.png' );
	 
	 $("#add2").attr('title', $('#add1').attr('title'));
	 $("#add2").attr('alt', $('#add1').attr('alt'));
	 $("#add2").attr('src','sports_images/allinsports/left_end/' + $('#add1').attr('title') + '.png' );
	 
	 $("#add1").attr('title', t1);
	 $("#add1").attr('alt', alt1);
	 $("#add1").attr('src', src1);
	}
	
	else if($('.six').length >0)
	{
	var t1 = $("#right_end").attr('title');
	var alt1 = $("#right_end").attr('alt');
	var src1 = $("#right_end").attr('src');
	
	
	$("#right_end").attr('title', $('#right_first').attr('title'));
	$("#right_end").attr('alt', $('#right_first').attr('alt'));
	$("#right_end").attr('src', 'sports_images/allincare/right_end/' + $('#right_first').attr('title') + '.png');

	
	$("#right_first").attr('title', $('#left_first').attr('title'));
	$("#right_first").attr('alt', $('#left_first').attr('alt'));
	$("#right_first").attr('src', 'sports_images/allincare/right_first/' + $('#left_first').attr('title') + '.png');

	
	
	$("#left_first").attr('title', $('#left_end').attr('title'));
	$("#left_first").attr('alt', $('#left_end').attr('alt'));
	$("#left_first").attr('src', 'sports_images/allincare/left_first/' + $('#left_end').attr('title') + '.png');

	
	$("#left_end").attr('title', $('#add2').attr('title'));
	$("#left_end").attr('alt', $('#add2').attr('alt'));
	$("#left_end").attr('src', 'sports_images/allincare/left_end/' + $('#add2').attr('title') + '.png');

	 
	 $("#add2").attr('title', $('#add1').attr('title'));
	 $("#add2").attr('alt', $('#add1').attr('alt'));
	 $("#add2").attr('src','sports_images/allincare/left_end/' + $('#add1').attr('title') + '.png' );
	 
	 $("#add1").attr('title', t1);
	 $("#add1").attr('alt', alt1);
	 $("#add1").attr('src', src1);
	}
	//alert('leftEndImage');
});


$("#click1").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

 if(url_link == 'home' || url_link == 'Lesrooster')
	{
   window.open('http://www.alphenfit.nl') ;
    }
});

$("#click2").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

  if(url_link == 'home' || url_link == 'Lesrooster')
	{
   window.open('http://www.fokusz.nl') ;
    }
});

$("#click3").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'home' || url_link == 'Lesrooster')
	{
   window.open('http://www.spronginhetdiepe.com') ;
    }
});


 $("#left_first").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'Lesrooster')
	{
   window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;
    }
});

$("#left_end").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'Lesrooster')
	{
   window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;
    }
});

$("#right_end").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'Lesrooster')
	{
   window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;
    }
});

$("#right_first").click(
function()
{
var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'Lesrooster')
	{
   window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;
    }
});


$("#click_area").click(
function()
{
    
	var url_link= $("#activeDiv img").attr('title');

	if(url_link == 'bodypump')
	{
		window.location = 'index.php?option=com_content&view=article&id=56&Itemid=86';
	}
	else if(url_link == 'bodybalance')
	{
		window.location = 'index.php?option=com_content&view=article&id=60&Itemid=90';
	}
	else if(url_link == 'bodystep')
	{
		window.location = 'index.php?option=com_content&view=article&id=58&Itemid=88';
	}
	else if(url_link == 'bodyattack')
	{
		window.location = 'index.php?option=com_content&view=article&id=54&Itemid=84';
	}
	else if(url_link == 'bodycombat')
	{
		window.location = 'index.php?option=com_content&view=article&id=55&Itemid=85';
	}
	else if(url_link == 'bodyjam')
	{
		window.location = 'index.php?option=com_content&view=article&id=59&Itemid=89';
	}
	else if(url_link == 'bodyrpm')
	{
		window.location = 'index.php?option=com_content&view=article&id=57&Itemid=87';
	}
	
	else if(url_link == 'Openingstijden')
	{
		window.location = 'index.php?option=com_content&view=article&id=144&Itemid=191';
      /*  window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;  */

    }
	else if(url_link == 'contact')
	{
		window.location = 'index.php?option=com_contact&view=contact&id=1&Itemid=163';
	}
	else if(url_link == 'Nieuwsbrief')
	{
		window.location = 'index.php?option=com_content&view=article&id=149&Itemid=196';
	}
	else if(url_link == 'Abonnement')
	{
		window.location = 'index.php?option=com_content&view=article&id=149&Itemid=196';
	}
	else if(url_link == 'Lesrooster')
	{
		/* window.location = 'index.php?option=com_content&view=article&id=114&Itemid=162';
       window.open('images/stories/lesrooster%20all-in%20vanaf%20mrt%202010.pdf') ;*/
    }
	else if(url_link == 'home')
	{
		/*window.location = ''; */
	}
	else if(url_link == 'easyrobics')
	{
		window.location = 'index.php?option=com_content&view=article&id=26&Itemid=67';
	}
	else if(url_link == 'massagestoel')
	{
		window.location = 'index.php?option=com_content&view=article&id=62&Itemid=92';
	}
	else if(url_link == 'zonnekanon')
	{
		window.location = 'index.php?option=com_content&view=article&id=134&Itemid=93';
	}
	else if(url_link == 'oxygen')
	{
		window.location = 'index.php?option=com_content&view=article&id=87&Itemid=118';
	}
	else if(url_link == 'medical')
	{
		window.location = 'index.php?option=com_content&view=article&id=64&Itemid=94';
	}
	else if(url_link == 'inbody')
	{
		window.location = 'index.php?option=com_content&view=article&id=88&Itemid=119';
	}
	else if(url_link == 'massagebed')
	{
		window.location = 'index.php?option=com_content&view=article&id=66&Itemid=96';
	}
	else if(url_link == 'nieuws')
	{
		window.location = 'index.php?option=com_content&view=article&id=87&Itemid=118';
	}
	else if(url_link == 'burn')
	{
		window.location = 'index.php?option=com_content&view=article&id=19&Itemid=232';
	}
	else if(url_link == 'ramping')
	{
		window.location = 'index.php?option=com_content&view=article&id=18&Itemid=81';
	}
	else if(url_link == 'crewclass')
	{
		window.location = 'index.php?option=com_content&view=article&id=98&Itemid=129';
	}
	else if(url_link == 'steptone')
	{
		window.location = 'index.php?option=com_content&view=article&id=47&Itemid=76';
	}
	else if(url_link == 'kettlebell')
	{
		window.location = 'index.php?option=com_content&view=article&id=24&Itemid=69';
	}
	else if(url_link == 'easystep')
	{
		window.location = 'index.php?option=com_content&view=article&id=21&Itemid=70';
	}
	else if(url_link == 'funstep')
	{
		window.location = 'index.php?option=com_content&view=article&id=46&Itemid=65&Itemid=71';
	}
	else if(url_link == 'gliding')
	{
		window.location = 'index.php?option=com_content&view=article&id=48&Itemid=77';
	}
	else if(url_link == 'rom')
	{
		window.location = 'index.php?option=com_content&view=article&id=49&Itemid=78';
	}
	else if(url_link == 'xco')
	{
		window.location = 'index.php?option=com_content&view=article&id=50&Itemid=79';
	}
	else if(url_link == 'bosu')
	{
		window.location = 'index.php?option=com_content&view=article&id=51&Itemid=80';
	}
	else if(url_link == 'stepparty')
	{
		window.location = 'index.php?option=com_content&view=article&id=53&Itemid=82';
	}
	else if(url_link == 'kidsdance')
	{
		window.location = 'index.php?option=com_content&view=article&id=126&Itemid=173';
	}
	else if(url_link == 'brasillianburn')
	{
		window.location = 'index.php?option=com_content&view=article&id=122&Itemid=171';
	}
	
	else if(url_link == 'flexibar')
	{
		window.location = 'index.php?option=com_content&view=article&id=78&Itemid=201';
	}
	
	else if(url_link == 'BootCamp')
	{
		window.location = 'index.php?option=com_content&view=article&id=142&Itemid=189';
	}
	
	else if(url_link == 'Kids2')
	{
		window.location = 'index.php?option=com_content&view=article&id=126&Itemid=173';
	}
	
	else if(url_link == 'ukkies')
	{
		window.location = 'index.php?option=com_content&view=article&id=130&Itemid=177';
	}
	
	else if(url_link == 'kleuterpret')
	{
		window.location = 'index.php?option=com_content&view=article&id=131&Itemid=178';
	}

});
 
 
}});



function showImage()
{

        $(this).hide();           
        $("#showDiv").animate({
            'width':'70px',
            'height':'50px',
            'margin-top':'100px' 
			}, 700, 'linear',
        function(){
            $('#showDiv').empty();
        });
                        

        var tsrc = $("#activeDiv img").attr('src');
        var talt = $("#activeDiv img").attr('alt');
		var ttitle = $("#activeDiv img").attr('title');
		var temp_id = $("#activeDiv img").attr('id');
		var tid = "";
		if(temp_id=="center_zero")
		{
			tid = "home";  
		}
		else if(temp_id=="center_one")
		{
				tid = "lessmills";  
		}
		else if(temp_id=="center_two")
		{
				tid = "allinsports";  
		}
		else if(temp_id=="center_three")
		{
				tid = "allinevents";  
		}
		else if(temp_id=="center_four")
		{
				tid = "allaboutus";  
		}
		else if(temp_id=="center_six")
		{
				tid = "allincare";  
		}
		
		var cur_side = $(this).attr('id');

        $("#activeDiv img").attr('src', $(this).attr('src'));
        $("#activeDiv img").attr('alt', $(this).attr('alt'));
		$("#activeDiv img").attr('title', $(this).attr('title'));

        var ceterImageSrc = $(this).attr('alt');

        	$(this).attr('src', "sports_images/" + tid + "/" + cur_side + "/" + ttitle + ".png");
        	$(this).attr('alt', talt);
			$(this).attr('title', ttitle);
	

if (ceterImageSrc.indexOf('flv') != -1 || ceterImageSrc.indexOf('wmv') != -1) {
	
            var centerImage = document.createElement('a');
			$(centerImage).addClass("media {width:300, autoplay:true}");
            $(centerImage).attr('href', ceterImageSrc);
			$(centerImage).attr('id', 'media');
			$('#showDiv').css('height', '300px');

        } else {
            var centerImage = document.createElement('img');
            $(centerImage).attr('src', ceterImageSrc);
			$(centerImage).css('width', '350px').css('height', '250px');
			$('#showDiv').css('border', '4px solid #fff');
					$('#showDiv').css('width', '350px');
					$('#showDiv').css('height', '250px');

        }
      
		
                      
        $("#showDiv").animate({
            /*'width':'400px',
            'height':'200px',*/
			'width':'350px',
            'height':'250px',
            'margin-top':'0px'
			
        }, 700, 'linear',
        function(){
            $(centerImage).appendTo($('#showDiv'));
			if (ceterImageSrc.indexOf('flv') != -1 || ceterImageSrc.indexOf('wmv') != -1) {
				$('#showDiv').css('width', '400px');
					$('#showDiv').css('height', '300px');
			//$('#showDiv').css('height', '300px');
			}
            $('a.media').media({autoplay:  true, showControls:false , flashvars: { controlbar: 'over', autostart: 'true', repeat: 'always', displayclick: 'fullscreen', scaling : 'exactfit' }});
        });
                        
        $(this).show();
                            
    }
    
    function mouseOver(){

		if($(this).attr('id') == "left_first" || $(this).attr('id') == "right_first")
		{
			$(this).css('width', '158px');
			$(this).css('height', '100px');
		}
		else if($(this).attr('id') == "left_end" || $(this).attr('id') == "right_end")
		{
			$(this).css('width', '140px');
			$(this).css('height', '110px');
		}
    }
    
    function mouseOut() {
		if($(this).attr('id') == "left_first" || $(this).attr('id') == "right_first")
		{
			$(this).css('width', '158px');
			$(this).css('height', '85px');
		}
		else if($(this).attr('id') == "left_end" || $(this).attr('id') == "right_end")
		{
			$(this).css('width', '140px');
			$(this).css('height', '100px');
		}
    }
       
})(jQuery);

