//Call function when the dom is ready
$.basehref = '/design/channel/sbs6/';

$(function() {

//global scripts & behaviors
	$.include($.basehref+'js/menu-behaviors.js');
	$.include($.basehref+'js/g-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.media.js'),
			$.include($.basehref+'js/jquery.metadata.js'),
			$.include($.basehref+'js/jquery.thickbox.js')
		] 
	);

//epg scripts & behaviors	
	if ( $('body.epg').length > 0 )
	$.include($.basehref+'js/epg-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.scrollTo.js')
		] 
	);

//gallery scripts & behaviors	
	if ( $('.photo-gallery').length > 0 )
	$.include($.basehref+'js/gallery-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.sl-adplayer.js'),
			$.include($.basehref+'js/jquery.gallery.js')
		] 
	);

//video & twitter scripts & behaviors	
	if ( $('.mo-b.video').length > 0 || $('.rss-a.twitter').length > 0 )
	$.include($.basehref+'js/cycle-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.cycle.js')
		] 
	);

//block-large .poll scripts & behaviors	
	if ( $('.block-large .poll').length > 0 || $('.block-large .mo-c.double .wrapper .item').length > 0 )
	$.include($.basehref+'js/equalheights-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.equalheights.js')
		] 
	);

//countdown scripts & behaviors	
	if ( $('.elcol-countdown').length > 0 )
	$.include($.basehref+'js/countdown-behaviors.js', 
		[ 
			$.include($.basehref+'js/jquery.countdown.min.js')
		] 
	);

//smack the body back in shape (IE 6 rendering bug)
	if ( $.browser.msie && ($.browser.version < 7.0 ) )
	$("body").addClass("smack");


});

