
function mycarousel_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};



jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
	
    jQuery('#post-carousel').jcarousel({
        auto: 5,
		scroll: 1,
        wrap: 'last',
		animation: 'slow',
        initCallback: mycarousel_initCallback
    });
});



function mainmenu(){
$(" .menu-header ul.menu ul ").css({display: "none"}); // Opera Fix
$(" .menu-header ul.menu li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}



 $(document).ready(function(){
	mainmenu();
});
 
 
 
 /* Start youtube */
 
$(function() {
	$("ul.jcarousel-skin-video").ytplaylist({addThumbs:true, autoPlay: false /*,  holderId: 'ytvideo2'*/});
});

/* end youtube */


/* Start carousel */
jQuery(document).ready(function() {
	// Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	jQuery('.first-and-second-carousel').jcarousel();
	
	// If you want to use a caoursel with different configuration options,
	// you have to initialise it seperately.
	// We do it by an id selector here.
	jQuery('#third-carousel').jcarousel({
		vertical: false
	});
});

function openYoutubePlayer(linkObj) 
{
	href = $(linkObj).attr('href');
	hrefParts = href.split("watch?v=");
	
	videoPlayerUrl = hrefParts.join("v/");

	var newHtml = "<object width='480' height='385' class='youtubePlayer'>" +
		  		"<param name='movie' value='"+videoPlayerUrl+"?fs=1&amp;hl=en_GB'></param>"+
		  		"<param name='allowFullScreen' value='true'></param>"+
		  		"<param name='allowscriptaccess' value='always'></param>"+
		  		"<embed src='"+videoPlayerUrl+"?fs=1&amp;hl=en_GB' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='385'></embed></object>";


	Shadowbox.open({
        content:    '<div id="welcome-msg">' + newHtml + '</div>',
        player:     "html",
        width:      500,
        height:     405
    });


}
