// JQUERY MAGIC FOR WWW.MBA-CHANNEL.COM

// FANCYBOX (Events, Galleries)
// GALLERY
$(document).ready(function() {
	$("a.group").fancybox({
		'titlePosition'	: 'over',
		'onComplete'	: function() {
			$("#fancybox-wrap").hover(function() {
				$("#fancybox-title").show();
			}, function() {
				$("#fancybox-title").hide();
			});
		}
	});
});

// VIDEOS
$(document).ready(function() {
$("a.video").click(function() {
	$.fancybox({
		'padding'		: 0,
		'autoScale'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: this.title,
		'width'			: 680,
		'height'		: 495,
		'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'type'			: 'swf',
		'swf'			: {
		'wmode'		: 'transparent',
		'allowfullscreen'	: 'true'
		}
	});
	return false;
});
});

// SLIDER
$(function() {
    // Experts Slider
    $('#theSlider').cycle({
		fx: 'scrollRight',
		timeout: 5000,
		speed: 800,
		easeOut: 'easeOutQuad',
		delay: 1000,
		pause: 1
	});
	
	// Quicklinks
	$('#quicklinks').cycle({ 
		fx: 'scrollDown', 
		speed: 500, 
		timeout: 5000,
		easeOut: 'easeOutQuad',
		pause: 1
	});
});


// "ADDTHIS" BUTTON (articlefunctions)
var addthis_config = {
          services_compact: 'email, delicious, facebook, twitter, misterwong, more',
          services_exclude: 'print'
}

// HISTORY BACK
function goback (sonsturl) {
	if (history.length > 0) {
		history.back ();
		} else {
		window.location.href(sonsturl);
	}
}