﻿
var dialogFirst=true;function dialog(E,G,B,D,F){if(dialogFirst==true){var A=new String;A="<div id=\"floatBoxBg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;\"></div>";A+="<div id=\"floatBox\" class=\"floatBox\">";A+="<div class=\"divtitle\"><h4></h4><span>\u5173\u95ed</span></div>";A+="<div class=\"divcontent\"></div>";A+="</div>";$("body").append(A);dialogFirst=false}$("#floatBox .divtitle span").click(function(){$("#floatBoxBg").hide();$("#floatBox .divcontent").html("");$("#floatBox").hide()});$("#floatBox .divtitle h4").html(E);contentType=G.substring(0,G.indexOf(":"));G=G.substring(G.indexOf(":")+1,G.length);switch(contentType){case"url":var C=G.split("?");$("#floatBox .divcontent").ajaxStart(function(){$(this).html("loading...")});$.ajax({type:C[0],url:C[1],data:C[2],error:function(){$("#floatBox .divcontent").html("error...")},success:function(A){$("#floatBox .divcontent").html(A)}});break;case"text":$("#floatBox .divcontent").html(G);break;case"id":$("#floatBox .divcontent").html($("#"+G+"").html());break;case"iframe":$("#floatBox .divcontent").html("<iframe src=\""+G+"\" width=\"100%\" height=\""+(parseInt(D)-30)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>")}$("#floatBoxBg").show();$("#floatBoxBg").animate({opacity:"0.5"},"normal");$("#floatBox").attr("class","floatBox "+F);$("#floatBox").css({display:"block",left:(($(document).width())/2-(parseInt(B)/2))+"px",top:($(document).scrollTop()-(D=="auto"?300:parseInt(D)))+"px",width:B,height:D});$("#floatBox").animate({top:($(document).scrollTop()+100)+"px"},"normal")}