/*
	Name:ShowTip 提示框
	Author: 陈科
	Copyright (c) 2009 Http://www.qyooo.com
	Version: 3.2.0 (2009-11-10)
	Requires: jQuery 1.3.2+
	Licence: Do not change the copyright
*/
(function($){$.fn.ShowTip=function(Title,Texts,DivW,DivH,cover,Time,Url,Sub,IsTip,IsDrag){var Tid=[Title||"",Texts||"",DivW||0,DivH||0,cover||0,Time||0,Url||0,Sub||0,IsTip||0,IsDrag||0];if(Tid[2]==0){alert("您要设置的 提示框宽度 初始化错误\r\n请检查标签宽度设置是否正确!");return}var CountTime;var TipDiv=["#ShowTipDevelop","#ShowTipTitle",".ShowTipContent","#ShowTipBG",".CloseShowTip",".ShowTimes",".ShowTipSub",".ShowFooter"];var TipMsg= ["确认","关闭","服务器繁忙，请稍后再试！","秒自动关闭！","秒将自动跳转！"];var contentType;var MinImg="/App_Themes/Default/images/blank.gif";if($(TipDiv[0]).get(0)==null){if(Tid[3]!=0){var TipDivHTXT='style="height:'+Tid[3]+'px;"'}else{var TipDivHTXT='style="height:auto;"'}$("body").append('<div id="ShowTipBG" style="height:'+$(document).height()+'px;opacity: 0.2;"></div><div id="ShowTipDevelop" style="width:'+Tid[2]+'px;"><div id="ShowTipBorder"><div id="ShowTipTitle"><span class="Title"></span><img src="'+MinImg+'" class="CloseShowTip" /></div><div class="ShowTipContent"  '+TipDivHTXT+'></div><div class="ShowFooter"><a href="javascript:void(0)" class="ShowTipSub"><span>'+TipMsg[0]+'</span></a> <a href="javascript:void(0)" class="CloseShowTip"><span>'+TipMsg[1]+"</span></a></div></div></div>");if($.browser.msie){$("#ShowTipBG").css({filter:"alpha(opacity=20)"});if($.browser.version=="6.0"){$("#ShowTipDevelop").css({background:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='"+$("#ShowTipDevelop").css("background-image").substr(5).substring(0,$("#ShowTipDevelop").css("background-image").substr(5).indexOf('"'))+"',sizingMethod=scale);"})}}$(TipDiv[0]).css({top:parseInt(document.documentElement.scrollTop+document.body.scrollTop+(document.documentElement.clientHeight-$(TipDiv[0]).height())/2)+"px",left:(document.documentElement.clientWidth-$(TipDiv[0]).width())/2+"px"});if(Tid[9]==1){$.fn.easydragWidth={widthx:$(TipDiv[0]).width()};$(TipDiv[0]).easydrag();$(TipDiv[0]).setHandler(TipDiv[1])}}else{clearTimeout($.fn.ShowTip.CountTime);if(Tid[8]==0){$(TipDiv[0]).hide()}$(TipDiv[0]).css({width:Tid[2]+"px"});if(Tid[3]!=0){$(TipDiv[2]).css({height:Tid[3]+"px"})}else{$(TipDiv[2]).css({height:"auto"})}}if(Tid[7]==1){$(TipDiv[7]).hide()}else{$(TipDiv[7]).show()}contentType=Tid[1].substring(0,Tid[1].indexOf(":"));if(contentType!=""||contentType!=null){Tid[1]=Tid[1].substring(Tid[1].indexOf(":")+1,Tid[1].length)}$(TipDiv[0]+" "+TipDiv[4]).click(function(){clearTimeout($.fn.ShowTip.CountTime);switch(contentType){case"iframe":$("#ShowTipIframe").remove();break}$(TipDiv[0]).hide();$(TipDiv[3]).hide();if($(TipDiv[5]).get(0)!=null){$(TipDiv[5]).hide()}});$(TipDiv[6]).click(function(){clearTimeout($.fn.ShowTip.CountTime);$(TipDiv[5]+","+TipDiv[0]).hide();eval(Tid[7])});switch(contentType){case"url":var content_array=Tid[1].split("?");$(TipDiv[2]).ajaxStart(function(){$(this).html("Loading...")});$.ajax({type:content_array[0],url:content_array[1],data:content_array[2],error:function(){$(TipDiv[2]).html(TipMsg[2])},success:function(html){$(TipDiv[2]).html(html)}});break;case"text":$(TipDiv[2]).html(Tid[1]);break;case"id":$(TipDiv[2]).html($("#"+Tid[1]+"").html());break;case"iframe":$(TipDiv[2]).html('<iframe id="ShowTipIframe" src="'+Tid[1]+'" width="100%" height="'+(parseInt(Tid[3]))+'px" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>');break;default:$(TipDiv[2]).html(Tid[1]);break}$(TipDiv[1]+" .Title").html(Tid[0]);$(TipDiv[6]).hide();if(Tid[7]!=0&Tid[7]!=null){$(TipDiv[6]).show()}if(Tid[8]==0){$(TipDiv[0]).css({top:parseInt(document.documentElement.scrollTop+document.body.scrollTop+(document.documentElement.clientHeight-$(TipDiv[0]).height())/2)+"px",left:(document.documentElement.clientWidth-$(TipDiv[0]).width())/2+"px"})}if(cover==0){$(TipDiv[0]).show()}else{$(TipDiv[0]).show();$(TipDiv[3]).show()}if(Tid[5]!=0){if(Url!=0){$.fn.ShowTip.CountDown(TipDiv[2],""+Url+"",""+Tid[5]+"",1,""+Tid[4]+"",TipDiv,TipMsg)}else{$.fn.ShowTip.CountDown(TipDiv[2],TipDiv[0],""+Tid[5]+"",0,""+Tid[4]+"",TipDiv,TipMsg)}}else{if(Url!=0){window.location.href=Url}}};$.fn.ShowTip.CountTime={};$.fn.ShowTip.CountDown=function(TimeArea,ActionArea,times,StateA,cover,TipDiv,TipMsg){if($(TipDiv[5]).get(0)==null){if(StateA==0){$(TimeArea).append('<div class="ShowTimesArea"><span class="ShowTimes"></span>'+TipMsg[3]+"</div>")}else{if(StateA==1){$(TimeArea).append('<div class="ShowTimesArea"><span class="ShowTimes"></span>'+TipMsg[4]+"</div>")}}}$(TipDiv[5]).html(times);clearTimeout($.fn.ShowTip.CountTime);$(TipDiv[5]).show();if(times==0){if(cover==0){$(TipDiv[5]).hide();if(StateA==0){$(ActionArea).hide();$(TipDiv[3]).hide();return false}else{clearTimeout($.fn.ShowTip.CountTime);window.location.href=ActionArea}return false}else{if(StateA==0){$(TipDiv[3]+","+TipDiv[5]).hide();$(ActionArea).hide();$(TipDiv[3]).hide();return false}else{clearTimeout($.fn.ShowTip.CountTime);$(TipDiv[5]).hide();window.location.href=ActionArea}}}overtimes=parseInt(times)-1;$.fn.ShowTip.CountTime=setTimeout(function(){$.fn.ShowTip.CountDown(TimeArea,ActionArea,overtimes,StateA,cover,TipDiv,TipMsg)},1000)}})(jQuery);(function(u){var w=false;var s=null;var q={};var n={};var o={};var m;var p;var r;var x;var t={};var v=false;u.getMousePosition=function(c){var a=0;var b=0;if(!c){var c=window.event}if(c.pageX||c.pageY){a=c.pageX;b=c.pageY}else{if(c.clientX||c.clientY){a=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;b=c.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:a,y:b}};u.fn.easydragWidth={widthx:300};u.updatePosition=function(d){var b=u.getMousePosition(d);var c=(x+(b.x-m));var e=(r+(b.y-p));var f=u.extend({widthx:"#UserId"},u.fn.easydragWidth);var a=parseInt(f.widthx+8);u(s).css("top",(e));if(document.documentElement.clientWidth<document.documentElement.scrollWidth){if(c>=parseInt(document.documentElement.scrollWidth-a)){c=parseInt(document.documentElement.scrollWidth-a)}}else{if(c>=parseInt(document.documentElement.clientWidth-a)){c=parseInt(document.documentElement.clientWidth-a)}}u(s).css("left",(c))};u(document).mousemove(function(a){if(w&&t[s.id]!="false"){u.updatePosition(a);if(n[s.id]!=undefined){n[s.id](a,s)}return false}});u(document).mouseup(function(a){if(w&&t[s.id]!="false"){w=false;if(q[s.id]!=undefined){q[s.id](a,s)}return false}});u.fn.ondrag=function(a){return this.each(function(){n[this.id]=a})};u.fn.ondrop=function(a){return this.each(function(){q[this.id]=a})};u.fn.dragOff=function(){return this.each(function(){t[this.id]="off"})};u.fn.dragOn=function(){return this.each(function(){t[this.id]="on"})};u.fn.setHandler=function(a){return this.each(function(){var b=this;o[this.id]=true;u(b).css("cursor","");t[b.id]="handler";u(a).css("cursor","move");u(a).mousedown(function(c){v=true;u(b).trigger("mousedown",c)});u(a).mouseup(function(c){v=false})})};u.fn.easydrag=function(a){return this.each(function(){if(undefined==this.id||!this.id.length){this.id="easydrag"+(new Date().getTime())}o[this.id]=a?true:false;t[this.id]="on";u(this).css("cursor","move");u(this).mousedown(function(c){if((t[this.id]=="off")||(t[this.id]=="handler"&&!v)){return o[this.id]}u(this).css("position","absolute");u(this).css("z-index",parseInt(new Date().getTime()/1000));w=true;s=this;var b=u.getMousePosition(c);m=b.x;p=b.y;r=this.offsetTop;x=this.offsetLeft;u.updatePosition(c);return o[this.id]})})}})(jQuery);
/* 旧版兼容 */
function ShowTip(Title,Texts,DivW,DivH,cover,Time,Url,Sub,IsTip,IsDrag){
    $(this).ShowTip(Title,Texts,DivW,DivH,cover,Time,Url,Sub,IsTip,IsDrag);
}