function BindRequest(n){fixEditor(n)}function InitList(){if($.browser.safari)$("a.title,.tdPict a").on("click touchend",function(){location=this.href});$("#up div[tid]").hover(function(){if(HasPanelShowing())return!1;var n=$(this).offset();$("#icon").css({display:"block",left:n.left+$(this).width()-20,top:n.top+5}).data("tid",$(this).attr("tid"))},function(n){within(this,n)||$("#icon").hide()});$("#up .item a[pict]").poshytip({content:function(){return"<img src='Thumb.ashx?src="+this.getAttribute("pict")+"' />"}});var n=$("#up a[rel^='cb']");n.filter(":not(:has(.imgBlock))").poshytip({content:function(){return"<img src='"+this.href+"' style='max-width:360px;max-height:360px' />"}}).click(function(){$("#poshytip").css("visibility","hidden")});ColorBoxPhoto(n);$(".echart").each(showChart);$(".ui-tabs").tabs({activate:function(n,t){$(".echart",t.newPanel).each(showChart)}}).show();tryFitParent()}function InitEditor(){MakeEditor("textarea.ck","Lesser","210px",!1,!1)}function updateEditor(){var n=$("#fmt_rblMode :radio[value='Custom']").is(":checked");n&&UpdateEditorElement()}function setHtmlArea(){var n=$("#fmt_rblMode :radio[value='Custom']").is(":checked");n?($("#fmt_divHtml").css("display","block"),$("#fmt_popup").width(595),$("#rtd").removeClass("hidden"),$("#fieldTag").addClass("green pointer").on("click",function(){toCopy(this);selectText(this)}).poshytip({content:"点击复制"})):($("#fmt_divHtml").css("display","none"),$("#fmt_popup").width(500),$("#rtd").addClass("hidden"));$("#fmt_ddlLayouts").click(function(){$("#fmt_rblMode_3").click()})}function fmtsChanged(){switch($("#ddlFmts").val()){case"BarCode_1D":$(".forBarcode,#ddlSize").removeClass("hide");break;case"BarCode_2D":$(".forBarcode").addClass("hide");$("#ddlSize").removeClass("hide");break;default:$(".forBarcode,#ddlSize").addClass("hide")}showTag()}function rangeChanged(n){var t=$(n).val();t=="Field"?($("#fmt_ddlVars,#spanQuery").addClass("hide"),$("#fmt_ddlfs,#ddlFmts").removeClass("hide"),fmtsChanged()):t=="Variable"?($("#fmt_ddlVars").removeClass("hide"),$("#fmt_ddlfs,#ddlFmts,#spanQuery").addClass("hide")):($("#spanQuery").removeClass("hide"),$("#fmt_ddlfs,#ddlFmts,#fmt_ddlVars").addClass("hide"));fsChanged()}function fsChanged(){$("#ddlFmts").val("");fmtsChanged()}function showTag(){var t,r=$("#range").val(),i,n;if($("#range").val()=="Field"){i=$("#fmt_ddlfs").val();switch($("#ddlFmts").val()){case"":t="["+i+"]";break;case"BarCode_1D":n=$("#ddlSize").val();n=n=="medium"?"":"|"+n;t="[_{"+$("#ddlBarCodes").val()+n+($("#cbLabel").is(":checked")?"|1":"")+"}"+i+"]";break;case"BarCode_2D":n=$("#ddlSize").val();n=n=="medium"?"":"|"+n;t="[_{QrCode"+n+"}"+i+"]";break;default:t="[_"+i+"]"}}else t=r=="Variable"?$("#fmt_ddlVars").val():$("#fmt_ddlQuerys").val();$("#fieldTag").text(t).fadeOut(100).fadeIn(300)}function setBtnExport(n,t){$("#btnExport").css("display",n?"none":"");$("#btnPrint").css("display",t?"none":"")}function toPrint(n){$("#up").printIt({event:n})}function ProcessForExportAs(n,t){n.find("[title],[fid],[rel],[onclick],[onerror]").removeAttr("title target fid rel onclick onerror");(t=="doc"||t=="xls")&&n.find(".imgBlock").each(function(){var n=$(this).css("background").toLowerCase(),t=n.indexOf("thumb.ashx"),i=n.indexOf(")");t<0||i<0||(n=n.substring(t,i-1),$(this).closest("a").replaceWith("<img src='"+n+"' />"))})}function reloadPage(){__doPostBack("reload","")}$(function(){var n=getTop();n.needRefreshOverview==!0&&(n.needRefreshOverview=null,location.reload(!0));document.onkeydown=function(n){if(n.ctrlKey||$(n.srcElement||n.target).is("input"))return!0;var i=n.keyCode||n.which,t=null;switch(i){case 37:case 33:t=$f("btnPrevious");break;case 39:case 34:t=$f("btnNext");break;case 36:t=$f("btnFirst");break;case 35:t=$f("btnLast")}return t&&!t.disabled?(__doPostBack(t.id,""),!1):!0};$("#icon").click(function(){var n=$(this).data("tid");n&&($("#curTempletId").val(n),__doPostBack("btnChgFormat",n))});InitScroller()})