
/*
- This plugin takes three parameter :
1 - the message you want to show.
2 - the time before the message is slide up .If the time is zero or not set the message will stay slide down.
3 - the icon image you want to be appear and it takes one of three values : error | note | success.
*/

temp='';
    $.fn.siMsg = function(options) {
			var defaults = {
   				 Msg: '' ,
				 timeout: 0 ,
				 icon:''
				 };
						
var options = $.extend(defaults, options);
var obj = $(this);

			obj.css("position","fixed");
			obj.css( 'top','0');
			obj.css('right','0');
			obj.css('display','none');
			var divMsg = $('.message', obj);
			divMsg.html('');
			if ( options ) { 
        	$.extend( defaults, options );
			}
			divMsg.append(defaults.Msg);
			 iconpic=$('.icon',obj);
			 if(temp!='')
			 iconpic.removeClass("icons "+temp);
			if(defaults.icon=='error'){
				iconpic.addClass("icons error");
				}
			else if(defaults.icon=='note'){
				iconpic.addClass("icons note");
			}
			else if(defaults.icon=='success'){
				iconpic.addClass("icons success");
			}
			 temp = defaults.icon;
			obj.slideDown("slow");
			if(defaults.timeout>0)
            {
			   time= setTimeout(function(){obj.slideUp("slow");},defaults.timeout);
			}
			else
			obj.slideDown("slow");
			var alink = $('.closeM',obj);
			alink.click(function(){
				obj.slideUp("slow")
				clearTimeout(time);
				});
        }
   


