/*
HUMANIZED MESSAGES 1.0
idea-http://www.humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages
home-http://humanmsg.googlecode.com*/
var humanMsg = {
setup: function(appendTo, logName, msgOpacity) {
humanMsg.msgID = 'humanMsg';
humanMsg.logID = 'humanMsgLog';
if (appendTo == undefined)
appendTo = 'body';
if (logName == undefined)
logName = 'Message Log';
humanMsg.msgOpacity = .9;
if (msgOpacity != undefined)
humanMsg.msgOpacity = parseFloat(msgOpacity);
jQuery(appendTo).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div>')
jQuery('#'+humanMsg.logID+' p').click(
function() { jQuery(this).siblings('ul').slideToggle() })},
displayMsg: function(msg) {
if (msg == '')
return;
clearTimeout(humanMsg.t2);
jQuery('#'+humanMsg.msgID+' p').html(msg)
jQuery('#'+humanMsg.msgID+'').show().animate({ opacity: humanMsg.msgOpacity}, 500, function() {
jQuery('#'+humanMsg.logID).show().children('ul').prepend('<li>'+msg+'</li>')	// Prepend message to log.children('li:first').slideDown(200)				// Slide it down
if ( jQuery('#'+humanMsg.logID+' ul').css('display') == 'none') {
jQuery('#'+humanMsg.logID+' p').animate({ bottom: 40 }, 200, 'linear', function() {
jQuery(this).animate({ bottom: 0 }, 300, 'easeOutBounce', function() { jQuery(this).css({ bottom: 0 }) })})}})
humanMsg.t1 = setTimeout("humanMsg.bindEvents()", 500)
humanMsg.t2 = setTimeout("humanMsg.removeMsg()", 10000)},
bindEvents: function() {
jQuery(document).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},
removeMsg: function() {
jQuery(window).unbind('click', humanMsg.removeMsg).unbind('keypress', humanMsg.removeMsg)
if (jQuery('#'+humanMsg.msgID).css('opacity') == humanMsg.msgOpacity)
jQuery('#'+humanMsg.msgID).animate({ opacity: 0 }, 500, function() { jQuery(this).hide() })}};
jQuery(document).ready(function() {
humanMsg.setup();})
