$(function() {
	
});


window.fbAsyncInit = function() {
	FB.init({
		appId : '217435521677891', // App ID
		channelUrl : '//dramaville.me/channel.html', // Channel File
		status : true, // check login status
		cookie : true, // enable cookies to allow the server to access the session
		xfbml : false  // parse XFBML
	});
	$(document).trigger('fbready');
};



$.debounce = function(fn, timeout, invokeAsap, ctx) {
	if(arguments.length == 3 && typeof invokeAsap != 'boolean') {
		ctx = invokeAsap;
		invokeAsap = false;
	}

	var timer;

	return function() {

		var args = arguments;
		ctx = ctx || this;

		invokeAsap && !timer && fn.apply(ctx, args);

		clearTimeout(timer);

		timer = setTimeout(function() {
			!invokeAsap && fn.apply(ctx, args);
			timer = null;
		}, timeout);

	};
};
