var showwindown = true; var templatesrc = "images"; //璁剧疆loading.gif璺緞 function tipsclose() { $("#windownbg").remove(); $("#windown-box").fadeout("slow", function () { $(this).remove(); }); } function tipswindown(title,content,width,height,drag,time,showbg,cssname) { $("#windown-box").remove(); //娓呴櫎鍐呭 var width = width>= 950?this.width=950:this.width=width; var height = height>= 527?this.height=527:this.height=height; if(showwindown == true) { var simplewindown_html = new string; simplewindown_html = "
"; simplewindown_html += "
"; simplewindown_html += "

close
"; simplewindown_html += "
"; simplewindown_html += "
"; $("body").append(simplewindown_html); show = false; } contenttype = content.substring(0,content.indexof(":")); content = content.substring(content.indexof(":")+1,content.length); switch(contenttype) { case "text": $("#windown-content").html(content); break; case "id": $("#windown-content").html($("#"+content+"").html()); break; case "img": $("#windown-content").ajaxstart(function() { $(this).html(""); }); $.ajax({ error:function(){ $("#windown-content").html("

error

"); }, success:function(html){ $("#windown-content").html(""); } }); break; case "url": var content_array=content.split("?"); $("#windown-content").ajaxstart(function(){ $(this).html(""); }); $.ajax({ type:content_array[0], url:content_array[1], data:content_array[2], error:function(){ $("#windown-content").html("

error

"); }, success:function(html){ $("#windown-content").html(html); } }); break; case "iframe": $("#windown-content").ajaxstart(function(){ $(this).html(""); }); $.ajax({ error:function(){ $("#windown-content").html("

error

"); }, success:function(html){ $("#windown-content").html(""); } }); } $("#windown-title h2").html(title); if(showbg == "true") {$("#windownbg").show();}else {$("#windownbg").remove();}; $("#windownbg").animate({opacity:"0.5"},"normal"); $("#windown-box").show(); if( height >= 527 ) { $("#windown-title").css({width:(parseint(width)+22)+"px"}); $("#windown-content").css({width:(parseint(width)+17)+"px",height:height+"px"}); }else { $("#windown-title").css({width:(parseint(width)+10)+"px"}); $("#windown-content").css({width:width+"px",height:height+"px"}); } var cw = document.documentelement.clientwidth,ch = document.documentelement.clientheight,est = document.documentelement.scrolltop; var _version = $.browser.version; if ( _version == 6.0 ) { $("#windown-box").css({left:"50%",top:(parseint((ch)/2)+est)+"px",margintop: -((parseint(height)+53)/2)+"px",marginleft:-((parseint(width)+32)/2)+"px",zindex: "999999"}); }else { $("#windown-box").css({left:"50%",top:"50%",margintop:-((parseint(height)+53)/2)+"px",marginleft:-((parseint(width)+32)/2)+"px",zindex: "999999"}); }; var drag_id = document.getelementbyid("windown-box"),draghead = document.getelementbyid("windown-title"); var movex = 0,movey = 0,movetop,moveleft = 0,moveable = false; if ( _version == 6.0 ) { movetop = est; }else { movetop = 0; } var sw = drag_id.scrollwidth,sh = drag_id.scrollheight; draghead.onmouseover = function(e) { if(drag == "true"){draghead.style.cursor = "move";}else{draghead.style.cursor = "default";} }; draghead.onmousedown = function(e) { if(drag == "true"){moveable = true;}else{moveable = false;} e = window.event?window.event:e; var ol = drag_id.offsetleft, ot = drag_id.offsettop-movetop; movex = e.clientx-ol; movey = e.clienty-ot; document.onmousemove = function(e) { if (moveable) { e = window.event?window.event:e; var x = e.clientx - movex; var y = e.clienty - movey; if ( x > 0 &&( x + sw < cw) && y > 0 && (y + sh < ch) ) { drag_id.style.left = x + "px"; drag_id.style.top = parseint(y+movetop) + "px"; drag_id.style.margin = "auto"; } } } document.onmouseup = function () {moveable = false;}; drag_id.onselectstart = function(e){return false;} } $("#windown-content").attr("class","windown-"+cssname); var closewindown = function() { $("#windownbg").remove(); $("#windown-box").fadeout("slow",function(){$(this).remove();}); } if( time == "" || typeof(time) == "undefined") { $("#windown-close").click(function() { $("#windownbg").remove(); $("#windown-box").fadeout("1000", function () { $(this).remove(); }); }); }else { settimeout(closewindown,time); } }