/*
 * SwiftAlert (C) Copyright 2009 MicroSwift.com. All Rights Reserved.
 * Created exclusively for use on Typity.com by Dustin Bolton
 * 
 * EXAMPLES:
 * On trigger, slide down alert at top of page.
 * $('#alert').alert('message');
 */
 
 (function($) {
	$.fn.alert = function(alertmsg){
		this.html(alertmsg);
		var $alert = $('#'+this.attr('id'));
			if($alert.length) {
				var alerttimer = window.setTimeout(function () {
					//$alert.trigger('click'); Moved animation stuff into here for timeout so popups wouldnt go away on timeout due to clicking out
					window.clearTimeout(alerttimer);
					$alert.animate({height: '0'}, 200);
				}, 3000);
				
				$alert.animate({height: $alert.css('line-height') || '50px'}, 200).click(function () {
					window.clearTimeout(alerttimer);
					$alert.animate({height: '0'}, 200);
				});
			}
	}
})(jQuery);