(function(){  

	var ua=navigator.userAgent.toLowerCase();  

	var is=(ua.match(/\b(chrome|opera|safari|msie|firefox)\b/) || ['','mozilla'])[1];  

	var r='(?:'+is+'|version)[\\/: ]([\\d.]+)';  

	var v=(ua.match(new RegExp(r)) ||[])[1];  

	jQuery.browser.is=is;  

	jQuery.browser.ver=v;  

	jQuery.browser[is]=true;  

})(); 

(function (jQuery){

/*

 * jQuery Plugin - Messager

 * Author: corrie	Mail: corrie@sina.com	Homepage: www.corrie.net.cn

 * Copyright (c) 2008 corrie.net.cn

 * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License]

 *

 * $Date: 2008-12-26 

 * $Vesion: 1.4

 @ how to use and example: Please Open demo.html

 */

	this.version = '@1.3';

	this.layer = {'width' : 300, 'height': 185};

	this.title = '信息提示';

	this.time = 4000;

	this.anims = {'type' : 'slide', 'speed' : 600};
	this.timer1 = null;

	

	this.inits = function(title, text){
		if($("#message").is("div")){ return; }
		if(status==1){
		$(document.body).prepend('<div id="message" style="position: absolute; z-index: 100; display:none; border-width: 0px; width: '+this.layer.width+'px;height: '+this.layer.height+'px; right:0px; bottom:0px;"><div class="winpopfoot" style="position:absolute;z-index:2;left:0;" id="pop_div"><div class="winpopfoot_box"><div class="winpopfoot_t"><span class="sp3" title="最小化" onclick="_mini();" id="message_close"></span><em id="div_1" class="on"><div ><div id="link_1" onclick=findOnlineUser(1)><strong class="str1">互动消息</strong><strong class="str2">互动消息</strong></div></div></em><em id="div_2" class="over"><div ><div id="link_3" onclick=findNewNoice(1)><strong class="str1">网站公告</strong><strong class="str2">网站公告</strong></div></div></em><em id="div_3" class="over"><div ><div id="link_3" onclick=findNewPrize(1)><strong class="str1">抽奖预告</strong><strong class="str2">抽奖预告</strong></div></div></em><em id="div_4" class="over"><div ><div id="link_4" onclick=showMemberLV()><strong class="str1">帐号信息</strong><strong class="str2">等级信息</strong></div></div></em></div><div class="winpopfoot_c"><dl><dd style="" id="con_1" class="martop15">'+text+'</dd></dl></div></div></div></div>');
		}else if(status==2){
			$(document.body).prepend('<div id="message" style="position: absolute; z-index: 100; display:none; border-width: 0px; width: '+this.layer.width+'px;height: '+this.layer.height+'px; right:0px; bottom:0px;"><div class="winpopfoot" style="position:absolute;z-index:2;left:0;" id="pop_div"><div class="winpopfoot_box"><div class="winpopfoot_t"><span class="sp3" title="最小化" onclick="_mini();" id="message_close"></span><em id="div_1" class="over"><div ><div id="link_1" onclick=findOnlineUser(1)><strong class="str1">互动消息</strong><strong class="str2">互动消息</strong></div></div></em><em id="div_2" class="on"><div ><div id="link_3" onclick=findNewNoice(1)><strong class="str1">网站公告</strong><strong class="str2">网站公告</strong></div></div></em><em id="div_3" class="over"><div ><div id="link_3" onclick=findNewPrize(1)><strong class="str1">抽奖预告</strong><strong class="str2">抽奖预告</strong></div></div></em><em id="div_4" class="over"><div ><div id="link_4" onclick=showMemberLV()><strong class="str1">帐号信息</strong><strong class="str2">等级信息</strong></div></div></em></div><div class="winpopfoot_c"><dl><dd style="" id="con_1" class="martop15">'+text+'</dd></dl></div></div></div></div>');
		}else if(status==3){
			$(document.body).prepend('<div id="message" style="position: absolute; z-index: 100; display:none; border-width: 0px; width: '+this.layer.width+'px;height: '+this.layer.height+'px; right:0px; bottom:0px;"><div class="winpopfoot" style="position:absolute;z-index:2;left:0;" id="pop_div"><div class="winpopfoot_box"><div class="winpopfoot_t"><span class="sp3" title="最小化" onclick="_mini();" id="message_close"></span><em id="div_1" class="over"><div ><div id="link_1" onclick=findOnlineUser(1)><strong class="str1">互动消息</strong><strong class="str2">互动消息</strong></div></div></em><em id="div_2" class="over"><div ><div id="link_3" onclick=findNewNoice(1)><strong class="str1">网站公告</strong><strong class="str2">网站公告</strong></div></div></em><em id="div_3" class="on"><div ><div id="link_3" onclick=findNewPrize(1)><strong class="str1">抽奖预告</strong><strong class="str2">抽奖预告</strong></div></div></em><em id="div_4" class="over"><div ><div id="link_4" onclick=showMemberLV()><strong class="str1">帐号信息</strong><strong class="str2">等级信息</strong></div></div></em></div><div class="winpopfoot_c"><dl><dd style="" id="con_1" class="martop15">'+text+'</dd></dl></div></div></div></div>');
		}
		$("#message_close").click(function(){		
			setTimeout('this.close()', 1);
			clearNewMessageRemind();
			/*$.ajax({
		        type:"post",
		        url:"/json/onLineUpdateMember.hzcgbb",
		        cache:false,
		        dataType:"json",
		        data:"userId="+userId+"&status="+onLineStatus,
		        success:function(msg){
					window.setTimeout(findOnlineUser,2000);
		        }
		    });*/
		});
		/*$("#message").hover(function(){
			clearTimeout(timer1);
			timer1 = null;
		},function(){
			timer1 = setTimeout('this.close()', time);
			//alert(timer1);
		});*/

	};

	this.show = function(title, text, time){
		if($("#message").is("div")){ return; }

		if(title==0 || !title)title = this.title;

		this.inits(title, text);

		if(time>=0)this.time = time;
		switch(this.anims.type){

			case 'slide':$("#message").slideDown(this.anims.speed);break;

			case 'fade':$("#message").fadeIn(this.anims.speed);break;

			case 'show':$("#message").show(this.anims.speed);break;

			default:$("#message").slideDown(this.anims.speed);break;

		}
		

		if($.browser.is=='chrome'){
			setTimeout(function(){

				$("#message").remove();

				this.inits(title, text);

				$("#message").css("display","block");

			},this.anims.speed-(this.anims.speed/5));

		}

		//$("#message").slideDown('slow');

		this.rmmessage(this.time);

	};

	this.lays = function(width, height){

		if($("#message").is("div")){ return; }

		if(width!=0 && width)this.layer.width = width;

		if(height!=0 && height)this.layer.height = height;
		

	}

	this.anim = function(type,speed){

		if($("#message").is("div")){ return; }

		if(type!=0 && type)this.anims.type = type;

		if(speed!=0 && speed){

			switch(speed){

				case 'slow' : ;break;

				case 'fast' : this.anims.speed = 200; break;

				case 'normal' : this.anims.speed = 400; break;

				default:					

					this.anims.speed = speed;

			}			

		}
	}

	this.rmmessage = function(time){

		if(time>0){
			timer1 = setTimeout('this.close()', time);

			//setTimeout('$("#message").remove()', time+1000);

		}

	};
	this.close = function(){
		switch(this.anims.type){
			case 'slide':$("#message").slideUp(this.anims.speed);break;
			case 'fade':$("#message").fadeOut(this.anims.speed);break;
			case 'show':$("#message").hide(this.anims.speed);break;
			default:$("#message").slideUp(this.anims.speed);break;
		};
		setTimeout('$("#message").remove();', this.anims.speed);
		this.original();	
	}

	this.original = function(){	

		this.layer = {'width' : 300, 'height': 185};

		this.title = '信息提示';

		this.time = 4000;

		this.anims = {'type' : 'slide', 'speed' : 600};

	};

    jQuery.messager = this;

    return jQuery;

})(jQuery);
