"use strict";function targetBlank(a){window.open(a,"_blank","menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes")}function FakeValidator(b,a){a.IsValid=true}function getObj(a){if(document.getElementById){this.obj=document.getElementById(a);this.style=document.getElementById(a).style;this.parent=document.getElementById(a).parentNode}else if(document.all){this.obj=document.all[a];this.style=document.all[a].style;this.parent=document.all[a].parentElement}else if(document.layers){this.obj=document.layers[a];this.style=document.layers[a].style;this.parent=document.layers[a].parentNode}}function CallPrint(c){var b,a;b=document.getElementById(c);a=window.open("","","letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0");a.document.write(b.innerHTML);a.document.close();a.focus();a.print();a.close()}function CallStyledPrint(e){var b,a,d,c;b=document.getElementById(e);a=window.open("","","letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0");d='<!DOCTYPE html><html><head><link href="/App_Themes/account/print.css" type="text/css" rel="stylesheet" /></head><body>';c="</body></html>";a.document.write(d+b.innerHTML+c);a.document.close();a.focus();a.print();a.close()}function checkInt(b){var a=parseInt(b,10);return!isNaN(a)?a:0}function checkFloat(b){var a=parseFloat(b);return!isNaN(a)?a:0}function commaFormatted(b){var g,c,f,d,e,a,h;g=",";b=parseFloat(b).toFixed(2).toString();c=b.split(".",2);f=c[1];d=parseInt(c[0],10);if(isNaN(d))return"";e="";if(d<0)e="-";d=Math.abs(d);a=new String(d);c=[];while(a.length>3){h=a.substr(a.length-3);c.unshift(h);a=a.substr(0,a.length-3)}a.length>0&&c.unshift(a);a=c.join(g);if(f.length<1)b=a;else b=a+"."+f;b=e+b;return b}function getElementsByClassName(g){var c,b,f,e,a,d;c=[];b=document.getElementsByTagName("*");f=b.length;e=new RegExp("(^|\\\\s)"+g+"(\\\\s|$)");for(a=0,d=0;a<f;a++)if(e.test(b[a].className)){c[d]=b[a];d++}return c}function CountChars(e,b,d,a){var c=document.getElementById(e).value;document.getElementById(b).innerHTML=a-c.length;if(a-c.length<a-(a-a*.2))document.getElementById(b).className="redmond bold";else document.getElementById(b).className=d}function CalculateCustomTotal(b){var a=b.parent();$(".txtCustTotal",a).val((checkFloat($(".txtCustQuant",a).val())*checkFloat($(".txtCustRate",a).val())).toFixed(2))}function RandomString(f){var b,e,a,d,c;b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";e=10;a="";for(d=0;d<e;d++){c=Math.floor(Math.random()*b.length);a+=b.substring(c,c+1)}document.getElementById(f).value=a}jQuery.fn.toggleText=function(a,b){return this.each(function(){$(this).text($(this).text()===a?b:a)})};function SimpleShowDialog(){$("#modaldialog").css("left","-130%").show()}function SimpleShowWindow(){$("#modalwindow").css("left","-130%").show()}function ShowDialog(e){var d,a,c,b;d=e.nextAll(".dialogcontent:first");a=d.children();a.appendTo("#modaldialogcontent");c=$(window).width();$(".okay",a).each(function(){b=this.onclick;$(this).removeAttr("onclick").unbind("click").click(function(){$("#modaldialog").animate({left:Math.round(-3.6*c)+"px"},"slow",function(){d.append(a);if($.isFunction(b)){$(".okay",a).each(function(){this.onclick=b});b()}$(this).hide()})})});$(".cancel",a).unbind("click").click(function(){$("#modaldialog").animate({left:Math.round(-3.6*c)+"px"},"slow",function(){$.isFunction(b)&&$(".okay",a).each(function(){this.onclick=b});d.append(a);$(this).hide();return false});return false});$("#modaldialog").css("left",c+"px").show().animate({left:Math.round(-1.3*c)+"px"},"slow")}function resetRadControls(){var a,b;if(typeof $telerik!=="undefined")if($telerik.radControls&&Telerik.Web.UI.RadEditor)for(a=0;a<$telerik.radControls.length;a++){b=$telerik.radControls[a];Telerik.Web.UI.RadEditor.isInstanceOfType(b)&&b.onParentNodeChanged()}}function ShowWindow(f,e){var d,a,c,b;e!==null&&$(".size").removeClass("small").removeClass("medium").removeClass("large").addClass(e);d=f;a=d.children();a.appendTo("#modalwindowcontent");resetRadControls();c=$(window).width();$(".okay",a).each(function(){b=this.onclick;$(this).removeAttr("onclick").unbind("click").click(function(){$("#modalwindow").animate({left:Math.round(-3.6*c)+"px"},"slow",function(){d.append(a);if($.isFunction(b)){$(".okay",a).each(function(){this.onclick=b});b()}$(this).hide()})})});$(".cancel","#modalwindow").unbind("click").click(function(){$("#modalwindow").animate({left:Math.round(-3.6*c)+"px"},"slow",function(){$.isFunction(b)&&$(".okay",a).each(function(){this.onclick=b});d.append(a);$(this).hide();return false});return false});$("#modalwindow").css("left",c+"px").show().animate({left:Math.round(-1.3*c)+"px"},"slow")}function HideDialog(){$("#modaldialog").hide()}function HideWindow(){$("#modalwindow").hide()}jQuery(function(){jQuery.waterMark={defaults:{waterClass:"watermarked",valueAttribute:"title"}};function a(a){return a.data("settings")}function b(){var b=$(this);b.val()===b.attr(a(b).valueAttribute)&&b.val("")}function c(){var b=$(this);if(b.hasClass(a(b).waterClass)){b.val("");b.removeClass(a(b).waterClass)}}function d(){var b=$(this);if(!b.val().length){b.addClass(a(b).waterClass);b.val(b.attr(a(b).valueAttribute))}}jQuery.fn.extend({waterMark:function(a){a=jQuery.extend({},jQuery.waterMark.defaults,a);return this.each(function(d,c){jQuery.data(c,"settings",a);$(c.form).submit(jQuery.proxy(b,c));c=jQuery(c);if(c.val().length&&c.val()!==c.attr(a.valueAttribute))c.removeClass(a.waterClass);else{c.val(c.attr(a.valueAttribute));c.addClass(a.waterClass)}}).focus(c).blur(d)}})});$(document).ready(function(){$("span.slider").live("click",function(){var b,c,a;b=$(this).parents("form:eq(0),body").find(".slider");c=b.index(this);if(c>-1&&c+1<b.length){a=b.eq(c+1);a.find(".x").length===0&&$("<span />").addClass("x").click(function(){a.slideToggle("fast")}).appendTo(a);a.slideToggle("fast")}});$("select.jcurrency").live("change",function(){var a=$(this).val();$("span.jcurrency").html(a);$("th.jcurrency > a").each(function(){$(this).html($(this).html().substring(0,$(this).html().lastIndexOf(","))+", "+a)})})});function SetCurrLabels(){var a,b,c;a=$(".dllCurrency").val();b=$(".CurrencyAmountFoot").html();b=b.slice(-b.length,b.length-a.length);$(".CurrencyRate").html("Rate, "+a);$(".CurrencyAmountHead").html("Amount, "+a);$(".btnCurr").show();if($(".TotalCurr").html()!==null){c=$(".TotalCurr").html().slice(-$(".TotalCurr").html().length,$(".TotalCurr").html().length-a.length);$(".TotalCurr").html(c+" "+a)}$(".CurrencyAmountFoot").each(function(){if(this.innerHTML!=="&nbsp;"&&this.innerHTML.length>0)this.innerHTML=b+" "+a})}function ValidateRecipients(b,a){if($("td > input:checked").length<1){a.IsValid=false;return}a.IsValid=true}function clearInputs(){$("input:text").val("");$("textarea").val("");$("input:checked").removeAttr("checked");$("select").each(function(){this.selectedIndex=0})}function countAutoItems(){var a=$(".AutoItemGrid");$("input:text",a).each(function(){$(this).val($(this).val().replace(/^[ 0]+/,""));$(this).val().length===0&&$(this).val("0")});$("tbody:first",a).each(function(){var b,c,d;b=checkInt($(".txtTotalWords",a).val());c=checkFloat($(".txtRateUnmatched",a).val());$(".txtUnmatched",a).val(b-checkInt($(".txt100",a).val())-checkInt($(".txt95",a).val())-checkInt($(".txt85",a).val()));$(".txtTotalUnmatched",a).val((checkInt($(".txtUnmatched",a).val())*c).toFixed(2));$(".txtTotal100",a).val((checkInt($(".txt100",a).val())*checkFloat($(".txtRate100",a).val())).toFixed(2));$(".txtTotal95",a).val((checkInt($(".txt95",a).val())*checkFloat($(".txtRate95",a).val())).toFixed(2));$(".txtTotal85",a).val((checkInt($(".txt85",a).val())*checkFloat($(".txtRate85",a).val())).toFixed(2));d=checkFloat($(".txtTotalUnmatched",a).val())+checkFloat($(".txtTotal100",a).val())+checkFloat($(".txtTotal95",a).val())+checkFloat($(".txtTotal85",a).val());$(".lblTotalAmount",a).html(d.toFixed(2))})}function SetWordCountRates(){var a,b;a=$(".AutoItemGrid");b=$(".lblMultipliers").html().split(",");$("tbody:first",a).each(function(){var c=checkFloat($(".txtRateUnmatched",a).val());$(".txtRate100",a).val((c*b[0]).toFixed(4));$(".txtRate95",a).val((c*b[1]).toFixed(4));$(".txtRate85",a).val((c*b[2]).toFixed(4))});countAutoItems()}function ConvertCurrency(c){var b,a;b=c.parents(".RadGrid_Radiator:first");a=0;$("tbody:last",b).each(function(){$(".rgRow",this).each(function(){a=parseFloat($(".lblSourceCost",this).html().replace(/,/g,""))*parseFloat($(".txtRate",this).val());$(".lblTargetCost",this).html(commaFormatted(a))});$(".rgAltRow",this).each(function(){a=parseFloat($(".lblSourceCost",this).html().replace(/,/g,""))*parseFloat($(".txtRate",this).val());$(".lblTargetCost",this).html(commaFormatted(a))})});a=0;$(".lblTargetCost",b).each(function(){a+=parseFloat(this.innerHTML.replace(/,/g,""))});$(".lblGrandTargetTotal",b).html(commaFormatted(a))}function SetCellVisibility(b){var a=b.siblings(".PriceListEditTable");switch(b.val()){case"1":$(".tcD",a).show();$(".tcA",a).hide();$(".tcB",a).hide();$(".tcC",a).hide();break;case"2":$(".tcD",a).show();$(".tcA",a).show();$(".tcB",a).hide();$(".tcC",a).hide();break;case"3":$(".tcD",a).show();$(".tcA",a).show();$(".tcB",a).show();$(".tcC",a).hide();break;case"4":$(".tcD",a).show();$(".tcA",a).show();$(".tcB",a).show();$(".tcC",a).show()}}Function.prototype.limitExecByInterval=function(d){var c,b,a,e=this;return function(){a=arguments;if(!c){e.apply(this,a);c=true;var f=this;window.setTimeout(function(){c=false;if(b){a.callee.apply(f,a);b=false}},d)}else b=true}};function mm(c,a,b){$('<div class="topMsg" />').addClass(b).append($("<strong />").html(c+" ")).append($("<span />").html(a)).css("opacity","0.9").prependTo("#msgArea").unbind("click").click(function(){$(this).queue("fx",[]).animate({opacity:0,top:"-60px"},500,function(){$(this).remove()})}).animate({opacity:.9},5e3,function(){$(this).click()})}var flag=0;function RadCalendarPopUpFix(i,g){var a,e,c,f,h,d,b;if(flag===0){flag=1;g.set_cancel(true);a=i;e=a.get_textBox();c=null;if(a.get_popupContainer())c=a.get_popupContainer();else c=a.get_timePopupContainer();f=a.getElementDimensions(e);h=a.getElementDimensions(c);d=$(e).offset();b=d.left;if(b+h.width>$(window).width())b=b+$(e).width()-$(c).width();if(g.get_popupControl().DivElement)a.showTimePopup(b,d.top+f.height);else a.showPopup(b,d.top+f.height)}else flag=0}