jQuery(document).ready(function($) {
	$('a[rel*=lightbox]').facebox();
	getMessengerNotes();
});

function messenger(url){
	var w = $('html').width();
	var levo = (w / 2) - 115;
	MSN = window.open(url,'name', 'height=500, width=255, left=' + levo + ', top=250, toolbar=no, menubar=no, directories=no, location=no, scrollbars=yes, status=no, resizable=no, fullscreen=no');
	if (window.focus) { MSN.focus(); }
};

function getMessengerNotes(){
	$.ajax({
		url: "/ajaxcore/ajax_messenger_info.php",
		global: false,
		type: "POST",
		dataType: "html",
		success: function(msg){
			if(msg){
				$('#footer').append('<div id="boubble">' + msg + '</div>');
				$('#boubble').css('display', 'block');
			}
		}
	});
};

function cancelChatInvite(){
	$.ajax({
		url: "/ajaxcore/ajax_messenger_action.php",
		global: false,
		type: "POST",
		dataType: "html",
		success: function(msg){
			$('#boubble').css('display', 'none');
		}
	});
};

function delayFadeOut(tag, token){
	$('#'+token).remove;
	if( $('#'+tag).html().length < 15 ){
		$('#O'+tag).fadeOut("slow");
	}
};