﻿$(document).ready(function(){
	$.messager.show(0,'<div style="line-height:24px">尊敬的客户：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果您对我们的投票产品有其它功能或页面设计需求，请与我们联系，我们将为您提供定制服务。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮箱：lijinliang_110@163.com <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q  Q ：30909034&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机：158 5863 8773</div>');
	$("#showMessager300x200").click(function(){
		$.messager.lays(300, 200);
		$.messager.show(0, '300x200的消息');
	});
	
});


(function (jQuery){

	this.version = '@1.1';
	this.layer = {'width' : 300, 'height': 200};
	this.title = '<font color=red>仙人掌网络 温馨提示信息</font>';
	this.time = 3600000;
	this.anims = {'type' : 'slide', 'speed' : 600};
	
	this.inits = function(title, text){
		if($("#Comtz_message").is("div")){ return; }
		$(document.body).prepend('<div id="Comtz_message" style="border:#b9c9ef 1px solid;z-index:100;width:'+this.layer.width+'px;height:'+this.layer.height+'px;position:absolute; display:none;background:#cfdef4; bottom:0; right:0; overflow:hidden;"><div style="border:1px solid #fff;border-bottom:none;width:100%;height:25px;font-size:12px;overflow:hidden;color:#1f336b;"><span id="Comtz_message_close" style="float:right;padding:5px 0 5px 0;width:16px;line-height:auto;color:red;font-size:12px;font-weight:bold;text-align:center;cursor:pointer;overflow:hidden;">×</span><div style="padding:5px 0 5px 5px;width:200px;line-height:18px;text-align:left;overflow:hidden;">'+title+'</div><div style="clear:both;"></div></div> <div style="padding-bottom:5px;border:1px solid #fff;border-top:none;width:100%;height:auto;font-size:12px;"><div id="Comtz_message_content" style="margin:0 5px 0 5px;border:#b9c9ef 1px solid;padding:10px 0 10px 5px;font-size:12px;width:'+(this.layer.width-17)+'px;height:'+(this.layer.height-50)+'px;color:#1f336b;text-align:left;overflow:hidden;">'+text+'</div></div></div>');
	};
	this.show = function(title, text, time){
		if($("#Comtz_message").is("div")){ return; }
		if(title==0 || !title)title = this.title;
		this.inits(title, text);
		if(time)this.time = time;
		switch(this.anims.type){
			case 'slide':$("#Comtz_message").slideDown(this.anims.speed);break;
			case 'fade':$("#Comtz_message").fadeIn(this.anims.speed);break;
			case 'show':$("#Comtz_message").show(this.anims.speed);break;
			default:$("#Comtz_message").slideDown(this.anims.speed);break;
		}
		$("#Comtz_message_close").click(function(){		
			setTimeout('this.close()', 1);
		});
		//$("#Comtz_message").slideDown('slow');
		this.rmComtz_message(this.time);
	};
	this.lays = function(width, height){
		if($("#Comtz_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($("#Comtz_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.rmComtz_message = function(time){
		setTimeout('this.close()', time);
		//setTimeout('$("#Comtz_message").remove()', time+1000);
	};
	this.close = function(){
		switch(this.anims.type){
			case 'slide':$("#Comtz_message").slideUp(this.anims.speed);break;
			case 'fade':$("#Comtz_message").fadeOut(this.anims.speed);break;
			case 'show':$("#Comtz_message").hide(this.anims.speed);break;
			default:$("#Comtz_message").slideUp(this.anims.speed);break;
		};
		setTimeout('$("#Comtz_message").remove();', this.anims.speed);
		this.original();
	};
	this.original = function(){	
		this.layer = {'width' : 300, 'height': 200};
		this.title = '信息提示';
		this.time = 4000;
		this.anims = {'type' : 'slide', 'speed' : 600};
	};
    jQuery.messager = this;
    return jQuery;
})(jQuery);

<!--MSN即时交谈代码开始 -->
	function SendMSNComtz_message(name)
	{
	 //Send a Comtz_message through MSN , only for IE
	 //and you must have installed MSN or Window Comtz_message
	 MsgrObj.InstantComtz_message(name); 
	}
	function AddMSNContact(name)
	{
 	//Add a people to MSN , only for IE
 	//and you must have installed MSN or Window Comtz_message
 	MsgrObj.AddContact(0, name);
	}
	<!--MSN即时交谈代码结束 -->
	function setTips(){
		$.messager.lays(300, 200);
		$.messager.anim('fade', 2000);
		
		setTopLocation();
		
	}
	function setTopLocation(){
		//$("#Comtz_message").floatdiv();
		 
		document.getElementById("Comtz_message").style.top=document.body.scrollTop+document.body.clientHeight-200;    
		document.getElementById("Comtz_message").style.left=document.body.scrollLeft+document.body.clientWidth-300;    
		setTimeout("setTopLocation();",10)    

	}
