function initializePlugins(){$.datepicker&&$.datetimebox&&($.datepicker.setDefaults($.datepicker.regional[NextWay.Localization.twoLetterISOLanguageName]),$.datetimebox.setDefaults($.datetimebox.regional[NextWay.Localization.twoLetterISOLanguageName]),$.datepicker.setDefaults({showOn:"both",buttonImageOnly:!0,buttonImage:NextWay.Images.buttonImage,buttonText:NextWay.Localization.buttonText,dateFormat:NextWay.Localization.dateFormat,changeYear:!0,changeMonth:!0,closeText:NextWay.Localization.closeText,
closeImage:NextWay.Images.closeImage,prevText:NextWay.Localization.prevText,nextText:NextWay.Localization.nextText,currentText:NextWay.Localization.currentText,monthNames:NextWay.Localization.monthNames,monthNamesShort:NextWay.Localization.monthNamesShort,dayNames:NextWay.Localization.dayNames,dayNamesShort:NextWay.Localization.dayNamesShort,dayNamesMin:NextWay.Localization.dayNamesMin,weekHeader:NextWay.Localization.weekHeader,firstDay:NextWay.Localization.firstDay,isRTL:!1,showMonthAfterYear:!1,
yearSuffix:"",constrainInput:!0,onSelect:function(a){document.all?$(this).get(0).fireEvent("onchange"):$(this).change()}}),$.datetimebox.setDefaults({showOn:"both",buttonImageOnly:!0,buttonImage:NextWay.Images.buttonImage,buttonText:NextWay.Localization.buttonText,dateFormat:NextWay.Localization.dateTimeFormat,changeYear:!0,changeMonth:!0,closeText:NextWay.Localization.closeText,closeImage:NextWay.Images.closeImage,prevText:NextWay.Localization.prevText,nextText:NextWay.Localization.nextText,monthNames:NextWay.Localization.monthNames,
monthNamesShort:NextWay.Localization.monthNamesShort,dayNames:NextWay.Localization.dayNames,dayNamesShort:NextWay.Localization.dayNamesShort,dayNamesMin:NextWay.Localization.dayNamesMin,weekHeader:NextWay.Localization.weekHeader,firstDay:NextWay.Localization.firstDay,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",constrainInput:!0,onSelect:function(a){document.all?$(this).get(0).fireEvent("onchange"):$(this).change()}}));$(function(){$.fn.filestyle&&$("input.VortalUpload").filestyle({image:NextWay.Images.fileStyleImage,
imageheight:16,imagewidth:20})})}function clearCacheOnLogout(){window.crypto&&"function"===typeof window.crypto.logout&&window.crypto.logout();return!0}function parseBoolean(a){switch(a.toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}}function parseDate(a){return null!=a&&""!=a?Date.parseExact(a,NextWay.Localization.viewModelDateFormat):a}
function parseDateTime(a){return null!=a&&""!=a?Date.parseExact(a,NextWay.Localization.viewModelDateTimeFormat):a}function parseRadioValue(a){if(null!=a&&""!=a){if("on"==a)return!0;if("off"==a)return!1}return a}function checkEmailAddress(a,b,c){a=document.getElementById(a);""!=a.value?/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(a.value)?a.className=b:a.className=c:a.className=b}
function submitFormBySelection(a,b){b=b+(-1<b.indexOf("?")?"&":"?")+"args="+$(a).val();null!=a.form?(a.form.action=b,a.form.method="POST",a.form.enctype="multipart/form-data",a.form.submit()):document.location.href=b}function submitFormByRadio(a,b){b=b+(-1<b.indexOf("?")?"&":"?")+"args="+$(a).val();null!=a.form?(a.form.action=b,a.form.method="POST",a.form.enctype="multipart/form-data",a.form.submit()):document.location.href=b}
function submitFormByTextBox(a,b){b=b+(-1<b.indexOf("?")?"&":"?")+"args="+$(a).val();null!=a.form?(a.form.action=b,a.form.method="POST",a.form.enctype="multipart/form-data",a.form.submit()):document.location.href=b}function submitFormByButton(a,b,c){document.forms[0].action=a;document.forms[0].enctype="multipart/form-data";document.forms[0].method="POST";document.forms[0].submit()}
function setFormByButton(a,b,c){null!=b.form?(b.form.action=a,b.form.method="POST"):(document.forms[0].action=a,document.forms[0].enctype="multipart/form-data",document.forms[0].method="POST",document.forms[0].submit())}function selectLookupItem(a,b,c,d){var e=document.getElementById(a);e.value=c;document.getElementById(a+"_hidden").value=b;$("#"+a+"_div").dialog("close");""!=d&&null!=e.form&&(e.form.action=d,e.form.method="POST",e.form.submit())}
function redirectFormByButton(a,b){var c="";try{c=document.getElementById(b).value}catch(d){}c=a+(""==b?"":(-1<a.indexOf("?")?"&":"?")+"args="+c);document.location.href=c}function openMultiLanguageEditor(a,b,c,d,e){c=document.getElementById(d);"true"==c.value.toLowerCase()?e&&(c.value="false"):e&&(c.value="true");e=c.value;b=document.getElementById(b);"false"==e?(b.style.visibility="hidden",b.style.display="none"):positionDivBellowObj(a,b,20,-5)}
function positionDivBellowObj(a,b,c,d){b.style.visibility="visible";b.style.display="block";for(var e=a.offsetLeft,f=a.offsetTop+a.offsetHeight;a.offsetParent;)a=a.offsetParent,e+=a.offsetLeft,f+=a.offsetTop;b.style.left=e+c+"px";b.style.top=f+d+"px"}
function setObjectTranslations(a,b,c,d,e,f,g){e=document.getElementById(e);c=c.split(";");e.value="false";e="";for(var h=0;h<c.length;h++){var k=document.getElementById(f+b+"_"+c[h]);null!=k&&(e+=(0<h?"@@":"")+c[h]+"||"+escape(k.value))}a.form.action=d+(-1<d.indexOf("?")?"&":"?")+"args="+e+"&property="+g;a.form.method="POST"}jQuery.fn.outerHTML=function(a){return a?this.before(a).remove():jQuery("<p>").append(this.eq(0).clone()).html()};
jQuery.extend({random:function(a){return Math.floor(a*(Math.random()%1))},randomBetween:function(a,b){return a+jQuery.random(b-a+1)}});function replaceAll(a,b,c){for(;-1!=a.indexOf(b);)a=a.replace(b,c);return a}function matrixLineRollover(a,b){for(var c=$("#"+a),d=$("#"+b).find("tbody"),e=0;e<d.length;e++)"VortalMatrixGridItemRollover"==d[e].className&&(d[e].className="VortalMatrixGridItem");"VortalMatrixGridItem"==c[0].className&&(c[0].className="VortalMatrixGridItemRollover")}
function matrixLineClicked(a,b,c,d){var e=!1;b=$("#"+b)[0];a=$("#"+a)[0];"VortalMatrixGridItemClicked"!=a.className&&(e=!0);if(e||d){e=$(b).find("tbody");for(d=0;d<e.length;d++)"VortalMatrixGridItemClicked"==e[d].className&&(e[d].className="VortalMatrixGridItem");a.className="VortalMatrixGridItemClicked";e=$(a).find("input");a=$(a).find("select");var f=$(b).find("input");b=$(b).find("select");var g=[];for(d=0;d<f.length;d++){found=!1;for(var h=0;h<e.length;h++)e[h]==f[d]&&(found=!0);found||(g[g.length]=
f[d])}f=g;for(d=0;d<f.length;d++)f[d].setAttribute("disabled","disabled");for(d=0;d<b.length;d++)b[d].setAttribute("disabled","disabled");b=null;for(d=0;d<e.length;d++)!0==$(e[d]).attr("disabled")&&($(e[d]).removeAttr("disabled"),null==b?b=e[d]:e[d].tabIndex<b.tabIndex&&(b=e[d]));for(d=0;d<a.length;d++)!0==$(a[d]).attr("disabled")&&($(a[d]).removeAttr("disabled"),null==b?b=a[d]:a[d].tabIndex<b.tabIndex&&(b=a[d]));c&&null!=b&&b.focus()}}
function enabledNextRow(a,b,c,d,e){a=a||event;var f=a.which||a.keyCode,g=b.split("_")[0]+"_"+b.split("_")[1]+"_",h=Number(b.split("_")[2]);e=g+(h+1).toString();g+=(h-1).toString();if(9==f)if(matrixGridFieldSyncLabel(d),b=$("#"+b)[0],b=$(b).find("input"),1==a.shiftKey){if(d.attributes.id.value==b[0].attributes.id.value&&(e=$("#"+g)[0],null!=e))for(d=d.tabIndex,matrixLineClicked(g,c,!1,!1),b=$(e).find("input"),c=0;c<b.length;c++)b[c].tabIndex==d-1&&b[c].focus()}else if(d.attributes.id.value==b[b.length-
1].attributes.id.value&&(a=$("#"+e)[0],null!=a))for(d=d.tabIndex,matrixLineClicked(e,c,!1,!1),b=$(a).find("input"),c=0;c<b.length;c++)b[c].tabIndex==d+1&&b[c].focus()}
function matrixGridAddRow(a,b){var c=$("#"+b)[0],d=b.split("_")[2],e=b.split("_")[0]+"_"+b.split("_")[1]+"_",c=$(c).outerHTML(),f=Number(d)+1;Math.random().toString().replace(".","");f=e+f;if(null==$("#"+f)[0]){for(var c=replaceAll(c,b,f),g=c.match(RegExp("_grid_"+a+"_col_-[0-9]+_field_","g")),e=0;e<g.length;e++)var h=$.randomBetween(e,99999999999),c=c.replace(g[e],"_grid_"+a+"_col_-"+h+"_field_"),k=g[e].replace("_field_","_content_"),c=c.replace(k,"_grid_"+a+"_col_-"+h+"_content_");e=Number(d)+1;
c=c.replace(RegExp("<autonumber>"+e+"</autonumber>","i"),"<autonumber>"+(e+1)+"</autonumber>");c=-1<c.indexOf("MatrixGridRowOdd")?replaceAll(c,"MatrixGridRowOdd","MatrixGridRowEven"):replaceAll(c,"MatrixGridRowEven","MatrixGridRowOdd");-1<c.indexOf("VortalMatrixGridItemClicked")&&(c=replaceAll(c,"VortalMatrixGridItemClicked","VortalMatrixGridItem"));$("#"+a);$("#"+a+" > tbody:last").after(c);d=$("#"+f);c=d.find("input");f=d.find("select");for(e=0;e<c.length;e++)$(c[e]).val(""),matrixGridFieldSyncLabel(c[e]);
for(e=0;e<f.length;e++)$(f[e]).val(""),matrixGridFieldSyncLabel(f[e]);d=d.find("span[class|=Content Disabled]");for(e=0;e<d.length;e++)$(d[e]).html("&nbsp");matrixLineClicked(b,a,!1,!0)}}function matrixGridRemoveRow(a,b){var c=$("#"+b)[0],d=$("#"+a)[0];$(c).before().remove();$(d).find("tbody")}function matrixGridRowUp(a,b){}function matrixGridRowDown(a,b){}
function matrixGridFieldSyncLabel(a){$(a);var b=$(a).val(),c=$("#"+$(a).attr("id")+" option:selected").text();null!=b&&""!=b&&null!=c&&""!=c&&(b=c);$("#"+$(a).attr("id").replace("_field_","_content_")).html(b)}function getXmlDocFromString(a){xmlDoc=null;window.DOMParser?(parser=new DOMParser,xmlDoc=parser.parseFromString(a,"text/xml")):(xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),xmlDoc.async="false",xmlDoc.loadXML(a));return xmlDoc}
function serializeXml(a){return(new XMLSerializer).serializeToString(a)}function getXmlContent(a){return null!=a.xml?a.xml:serializeXml(a)}function setXmlNodeValue(a,b){null!=a&&(null!=a.text?a.text=b:a.textContent=b)}function getXmlNodeValue(a){return null!=a.text?a.text:getNodeText(a)}function getNodeText(a){for(var b="",c=0;c<a.childNodes.length;c++)b=0<a.childNodes[c].childNodes.length?b+getNodeText(a.childNodes[c]):b+a.childNodes[c].textContent;return b}
function updateGridHiddenFieldValue(a,b,c,d,e){e=$("#"+e);var f=getXmlDocFromString(unescape(e.val()));if(null!=f&&null!=getXmlContent(f)){for(var g=f.getElementsByTagName("SerializableKeyValuePairOfStringString"),h=!1,k=0;k<g.length;k++){var l=g[k].getElementsByTagName("Key"),m=g[k].getElementsByTagName("Value");if(getXmlNodeValue(l[0]).split("@")[0]==d){g=getXmlDocFromString(getXmlNodeValue(m[0]));1<g.childNodes.length?setXmlNodeValue(g.childNodes[1],a):setXmlNodeValue(g.childNodes[0],a);setXmlNodeValue(m[0],
getXmlContent(g));h=!0;break}}h||(m=f.createElement("SerializableKeyValuePairOfStringString"),g=f.getElementsByTagName("ArrayOfSerializableKeyValuePairOfStringString")[0],h=f.createElement("Key"),setXmlNodeValue(h,d+"@"+b+","+c),m.appendChild(h),c=f.createElement("Value"),b=b.split(".")[b.split(".").length-1],setXmlNodeValue(c,'<?xml version="1.0" encoding="utf-16"?><'+b.toLowerCase()+">"+a+"</"+b.toLowerCase()+">"),m.appendChild(c),g.appendChild(m));e.val(escape(getXmlContent(f)))}}
function parseAjaxElementReturn(a){var b=$("#AjaxScriptContainer");b.empty();null!=a&&""!=a&&$(a).each(function(){var a=$(this);parseElement(a,b)})}function parseAjaxElementReturnAutoRefresh(a){var b=$("#AjaxScriptContainer");b.empty();var c=$($(a)[0]);c.attr("id");if(c.is("AutoRefresh"))return c.attr("result");$(a).each(function(){var a=$(this);parseElement(a,b)})}
function parseElement(a,b){var c=a.attr("id");if(null!=c&&""!=c)a.is("elementinstructions")?(c=$("#"+c),"true"==a.attr("isvisible")?c.fadeIn():c.fadeOut()):a.is("switchelement")?$("#"+c).replaceWith(a.children().first()):a.is("addelement")?$("#"+c).append(a.children().first()):a.is("removeelement")?$("#"+c).remove():a.is("script")?$("head").append(a):(c=$("#"+c),0<c.length?c.replaceWith(a):b.append(a));else if(a.is("CallFunction"))CallFunctionResponse(a);else if(a.is("ValidateCertificateResponse"))ValidateCertificateResponse(a.attr("result"),
a.attr("otherMessage"),parseBoolean(a.attr("isPDFSignature")),a.attr("startRange"),a.attr("endRange"));else if(a.is("ValidateCertificateResponse2"))ValidateCertificateResponse2(a.attr("result"),a.attr("otherMessage"),parseBoolean(a.attr("isPDFSignature")),a.attr("startRange"),a.attr("endRange"));else if(a.is("ValidateCertificateResponse3"))ValidateCertificateResponse3(a.attr("result"),a.attr("otherMessage"),parseBoolean(a.attr("isPDFSignature")),a.attr("startRange"),a.attr("endRange"));else if(a.is("ValidateCertificateResponse4"))ValidateCertificateResponse4(a.attr("result"),
a.attr("message"),a.attr("uploadWaitTime"),a.attr("otherMessage"),parseBoolean(a.attr("isPDFSignature")),a.attr("startRange"),a.attr("endRange"));else if(a.is("ValidateCertificateResponse5"))ValidateCertificateResponse5(a.attr("otherMessage"),parseBoolean(a.attr("isPDFSignature")),a.attr("startRange"),a.attr("endRange"));else if(a.is("SendSignatureInfoResponse"))SendSignatureInfoResponse(a.attr("result"));else if(a.is("PrepareTransferResponse"))PrepareTransferResponse(a.attr("result"));else if(a.is("SendChunkResponse"))SendChunkResponse(a.attr("result"),
a.attr("duration"));else if(a.is("ConfirmFileResponse"))SendConfirmationResponse(a.attr("result"));else if(a.is("SendDocumentResponse"))SendDocumentResponse(a.attr("result"));else if(a.is("setvalid"))$("#"+a.attr("elemId")).removeClass("Invalid");else if(a.is("setinvalid"))$("#"+a.attr("elemId")).addClass("Invalid");else if(a.is("RedirectToAction"))redirectToAction(a.attr("value"));else if(a.is("div")){if(c=a.attr("addelementsafter"),null!=c&&""!=c){var d=a.children();$(c).after(d)}}else if(a.is("table")){var c=
a.attr("addrowsafter"),d=a.attr("addrowsbefore"),e=a.attr("switchrows");if(null!=c&&""!=c){var f=null,f=a.find("tbody"),f=0<f.length?f.first().children():a.find("table").first().children();$(c).after(f)}else null!=d&&""!=d?(f=a.find("tbody"),f=0<f.length?f.first().children():a.find("table").first().children(),$(d).before(f)):null!=e&&""!=e?(f=a.find("tbody"),f=0<f.length?f.first().children():a.find("table").first().children(),$("#"+e).replaceWith(f)):(f=a.find("tbody"),0<f.length?parseElement(f.first().children("tr"),
b):parseElement(a.children(),b))}else if(a.is("tr"))if(c=a.children(),void 0!=c&&0<c.length)for(d=0;d<c.length;d++)parseElement($(c[d]),b);else parseElement(a.children(),b);else if(a.is("noscript")){var c=a.attr("removeelement"),d=a.attr("uncheck"),e=a.attr("check"),f=a.attr("settext"),g=a.attr("setatt"),h=a.attr("setclass"),k=a.attr("eval");null!=c&&""!=c?$("#"+c).remove():null!=d&&""!=d?$("#"+d).attr("checked",!1):null!=e&&""!=e?$("#"+e).attr("checked",!0):null!=f&&""!=f?$("#"+a.attr("elemid")).text(f):
null!=g&&""!=g?$("#"+a.attr("elemid")).attr(g,a.attr("val")):null!=h&&""!=h?$("#"+a.attr("elemid")).attr("class",h):null!=k&&""!=k&&eval(k)}else a.is("ClearViewModels")?clearViewModels():a.is("clearViewModelsByName")?(c=a.attr("viewModelName"),d=a.attr("key"),clearViewModelsByName(c,d)):b.append(a)}
function CallFunctionResponse(a){var b=a.attr("name");if(void 0!=b){var c=[];$.browser.msie&&9>parseInt($.browser.version,10)?a.filter("Arg").each(function(){var a=$(this).attr("value");if(null!=a&&""!=a){var b=$(this).attr("isLiteral");c.push(null!=b&&"false"==b?'"'+a+'"':a)}}):a.find("Arg").each(function(){var a=$(this).attr("value");if(null!=a&&""!=a){var b=$(this).attr("isLiteral");c.push(null!=b&&"false"==b?'"'+a+'"':a)}});eval(b+"("+c.join(",")+")")}}
function openTimeoutBlockUI(){window.parent.$.blockUI({message:'<div><div style="border-bottom:2px solid #CCCCCC">'+NextWay.Localization.SessionTimeoutTextFirstPart+'</div><br/><div><div style="float:left;height:200px;"><img src="'+NextWay.Images.SessionTimeoutSmartyImage+'"/></div><div style="margin-left: 160px;">'+NextWay.Localization.SessionTimeoutTextSecondPart+"<br/><b>"+NextWay.Localization.SessionTimeoutTextThirdPart+"</b><br/><br/>"+NextWay.Localization.SessionTimeoutTextFourthPart+"<br/>"+
NextWay.Localization.SessionTimeoutTextFifthPart+"<br/><br/>"+NextWay.Localization.SessionTimeoutTextSixthPart+' <a id="link" href="#" onclick="location.reload()">'+NextWay.Localization.SessionTimeoutTextSeventhPart+"</a> "+NextWay.Localization.SessionTimeoutTextEighthPart+"</div></div></div>",baseZ:10011,css:{padding:"20px 14px",margin:0,width:"41%",height:"232px",top:"300px",left:"370px",border:"1px solid #CCCCCC",backgroundColor:"#F2F2F2","-webkit-border-radius":"4px","-moz-border-radius":"4px",
"-o-border-radius":"4px","background-Repeat":"repeat-x",textAlign:"left",cursor:"wait"}})}function callWaitActionsBefore(a){for(var b=0;b<a.length;b++)a[b].before()}function callWaitActionsAfter(a){for(var b=0;b<a.length;b++)a[b].after()}
function getContent(a,b,c){if($.browser.msie&&window.XDomainRequest&&0!=a.toLowerCase().indexOf(currentDomain.toLowerCase())){var d=new XDomainRequest;d.open("get",a);d.onload=function(){setContentOrReplaceContent(d.responseText,b,c)};d.onprogress=function(){};d.send()}else $.ajax({url:a,type:"GET",cache:!1,success:function(a){setContentOrReplaceContent(a,b,c)},dataType:"html"})}function setContentOrReplaceContent(a,b,c){c?$("#"+b).replaceWith(a):$("#"+b).html(a)}
function getAllCheckBoxes(a,b,c){var d=[];$("#"+a+" :hidden[name="+b+"]").each(function(){d.push(c+"="+$(this).val())});return d.join("&")}function getAllTableSelectionValues(a,b){var c=[],d=$("#"+a+"> tbody > tr").find("td.TableSelectionCell");void 0!==d&&0<d.length&&d.each(function(){var a=$(this),b=a.find(".TableSelectionValue"),a=a.find(".TableSelectionRowValue");0<b.length&&0<a.length&&c.push(a.val()+"|"+b.val())});return JSON.stringify(c)}
function getSelection(a,b,c){var d=[],e=$("#"+a+"> table > tbody > tr").find("td.GridSelectionCell"),f=[],g=[];$.each(e,function(a,b){f.push(e[a].childNodes.item(1))});if(c)$.each(e,function(a,b){4==e[a].childNodes.length?g.push(e[a].childNodes.item(3)):g.push(e[a].childNodes.item(2))}),$.each(g,function(a,b){void 0!=g[a]&&d.push(g[a].value+"|"+f[a].value)});else{var h=$("#"+a+"> table > tbody > tr > td.GridSelectionCell").find(":input:radio");$.each(f,function(a,b){void 0!=h[a]&&d.push(f[a].value+
"|"+h[a].checked)})}return d}function jsonSelectionValues(a,b,c){return JSON.stringify(getSelection(a,b,c))}function redirectToAction(a){redirectUrl=a}function historyGoBack(){history.back(1)}function setVisibility(a,b){"true"===b.toLowerCase()?$("#"+a).show(0):$("#"+a).hide(0)}function changeCssClass(a,b,c){null!=b&&""!=b&&$("#"+a).removeClass(b);null!=c&&""!=c&&$("#"+a).addClass(c)}
function menuBarHomeItemHover(a){var b=a?"MenuItem HoverLeftEdge":"MenuItem LeftEdge ";a=a?$("[class='MenuItem LeftEdge ']"):$("[class='MenuItem HoverLeftEdge']");var c=$("#notificationWidget");null!=c&&(c.parent().hasClass("Selected")||c.parent().toggleClass("NotificationAreaContainerHover"));a.attr("class",b)}
function menuBarHomeItemHoverAlt(a){var b=a?"MenuItemAlt HoverLeftEdge":"MenuItemAlt LeftEdgeAlt ";a=a?$("[class='MenuItemAlt LeftEdgeAlt ']"):$("[class='MenuItemAlt HoverLeftEdge']");var c=$("#notificationWidget");null!=c&&(c=c.parent(),c.hasClass("SelectedAlt")||c.toggleClass("NotificationAreaContainerHover"));a.attr("class",b)}
function showWidgetNumbers(){addBlurPanel();$("[widgetnumber]").each(function(){var a=$(this),b=a.clone(),c='<div id="showWidget_'+a.attr("id")+'" style="z-index: 2500; border: solid; pading: 5px; position: relative" class="WidgetMarker" />',d='<div style="z-index: 2; position: relative" class="Number">WIDGET NR: <font>'+a.attr("widgetnumber")+"</font></div>",e='<div id="blockPanel_'+a.attr("id")+'" onclick="closeWidgetNumbers()" style="z-index: 1; opacity: 0.8; filter:alpha(opacity=80); position: absolute" class="blockUI" />',
f='<div id="elementPanel_'+a.attr("id")+'" style="z-index:0" class="none" />',c=$(c).append(d).append(e).append(b);b.wrap(f);a.replaceWith(c)})}function addBlurPanel(){$('<div onclick="closeWidgetNumbers()" id="divShowWidgetNumbers" style="z-index: 2000; opacity: 0.8; filter:alpha(opacity=80); position:fixed" class="blockUI"></div>').appendTo(jQuery("body"))}
function closeWidgetNumbers(){$("[id*='showWidget_']").children("[class='Number']").remove();$("[id*='showWidget_']").children("[class='blockUI']").remove();$("[widgetnumber]").unwrap();$("[widgetnumber]").unwrap();$("[id='divShowWidgetNumbers']").remove()}
function onAddSelectChange(a,b,c,d,e,f){0<$("#"+a+" option:selected").length&&($("#"+e).attr("disabled",!1),$("#"+f).attr("disabled",!0),$("#"+b+" option:selected").attr("selected",!1));updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}function onRemoveSelectChange(a,b,c,d,e,f){0<$("#"+b+" option:selected").length&&($("#"+f).attr("disabled",!1),$("#"+e).attr("disabled",!0),$("#"+a+" option:selected").attr("selected",!1));updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}
function onAddBtnClick(a,b,c,d,e,f){var g=$("#"+a+" option:selected");0<g.length&&g.each(function(){$("#"+b).addOption(this.value,this.text);$("#"+a).removeOption(this.value)});updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}function onAddAllBtnClick(a,b,c,d,e,f){var g=$("#"+a+" option");0<g.length&&g.each(function(){$("#"+b).addOption(this.value,this.text);$("#"+a).removeOption(this.value)});updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}
function onRemoveBtnClick(a,b,c,d,e,f){var g=$("#"+b+" option:selected");0<g.length&&g.each(function(){$("#"+a).addOption(this.value,this.text);$("#"+b).removeOption(this.value)});updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}function onRemoveAllBtnClick(a,b,c,d,e,f){var g=$("#"+b+" option");0<g.length&&g.each(function(){$("#"+a).addOption(this.value,this.text);$("#"+b).removeOption(this.value)});updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f)}
function updateAddRemoveListActionButtonDisabledStates(a,b,c,d,e,f){0==$("#"+a+" option").length?$("#"+c).attr("disabled",!0):$("#"+c).attr("disabled",!1);0==$("#"+b+" option").length?$("#"+d).attr("disabled",!0):$("#"+d).attr("disabled",!1);0==$("#"+a+" option:selected").length?$("#"+e).attr("disabled",!0):$("#"+e).attr("disabled",!1);0==$("#"+b+" option:selected").length?$("#"+f).attr("disabled",!0):$("#"+f).attr("disabled",!1)}
function enableHoverMenu(a){$("#"+a+" li").each(function(){var a=this.id;$("#"+a+"_div").hover(function(){$("#"+a+"_hovermenu").addClass("hovermenu-visible");$("#"+a+"_hovermenu").removeClass("hovermenu-hidden")},function(){$("#"+a+"_hovermenu").removeClass("hovermenu-visible");$("#"+a+"_hovermenu").addClass("hovermenu-hidden")})})}
function WaitForApplets(a,b){$.blockUI({message:a,centerY:0,centerX:0,css:{top:"8px",left:"200px",width:"auto"},overlayCSS:{opacity:0.3}});setTimeout("WaitForAppletsPooler(document."+b+")",50)}function WaitForAppletsImage(a,b){BlockMessageWithImage(a,!0);setTimeout("WaitForAppletsPooler(document."+b+")",50)}
function BlockMessageWithImage(a,b){var c=20,d=60;null!=a&&0<a.length&&(d+=28,4<a.length&&(c=12*a.length));var e=100;b&&(e=Math.max(0,($(window).height()-d)/2+$(window).scrollTop()));var f=Math.max(0,($(window).width()-c)/2+$(window).scrollLeft());$.blockUI({message:'<table class="BlockMessage"><tr><td class="BlockMessageImage loadingCursorImg">&nbsp;</td></tr><tr><td>'+a+"</td></tr></table>",centerY:0,centerX:0,css:{top:e+"px",left:f+"px",width:c+"px",height:d+"px",border:"0px"},overlayCSS:{opacity:0.3}})}
function WaitForCertificateApplet(){try{ResetDocuments(),void 0!=HasDocuments&&SetDocuments($("#"+parentElement+"hdnFileList").val())}catch(a){}$.unblockUI()}function WaitForAppletsPooler(a){if(void 0==a)setTimeout("WaitForAppletsPooler(document."+appletId+")",50);else{if(-1!=a.name.indexOf("certificateApplet"))try{ResetDocuments(),void 0!=HasDocuments&&SetDocuments($("#"+parentElement+"hdnFileList").val())}catch(b){}$.unblockUI()}}
(function(a){a.fn.inputMask=function(b){var c=a.extend(a.fn.inputMask.defaults,b);this.each(function(){a(this).keyup(function(b){b=b.charCode||b.keyCode||0;var e=a(this).val();c.allowControlKeys&&a.inArray(b,[8,9,46,37,38,39,40]);""!=e?""==c.mask||e.match(c.mask)?""!=c.mask&&e.match(c.mask)&&a(this).removeClass("Invalid"):a(this).addClass("Invalid"):a(this).removeClass("Invalid")})})};a.fn.inputMask.defaults={allowControlKeys:!0,mask:""}})(jQuery);
(function(a){a.fn.inputRestrict=function(b){var c=a.extend(a.fn.inputRestrict.defaults,b);this.each(function(){return a(this).keydown(function(b){b=b.charCode||b.keyCode||0;var e=String.fromCharCode(b),f;if(f=c.allowControlKeys)f=-1<a.inArray(b,[8,9,46,37,38,39,40]);return f?!0:null!=e&&0>a.inArray(e,c.restrictedChars)?!1:!0})})};a.fn.inputRestrict.defaults={allowControlKeys:!0,restrictedChars:[]}})(jQuery);
function lookupSelectItem(a,b,c){2==a.length&&(c=$("#"+c),b=$("#"+b),c&&(c.val(a[0][1]),c.change()),b&&(b.val(a[1][1]),b.focus()))}var isDomReady=!1,shouldCloseWindow=!1,redirectUrl=null;$(document).ajaxStart(function(){$("#hdnIsOnRequest").val("true")});$(document).ajaxStop(function(){shouldCloseWindow&&($("#hdnIsOnRequest").val("false"),window.close());null!=redirectUrl&&""!=redirectUrl?window.location.href=redirectUrl:$("#hdnIsOnRequest").val("false")});
$(document).ready(function(){isDomReady=!0});function OpenPopupWindow(a,b,c,d,e,f){$.popupWindow({windowURL:a,windowName:void 0!=f?f:"swip",centerScreen:1,height:b,width:c,scrollbars:d,resizable:e})}function OpenFullScreenPopupWindow(a,b,c,d){$.popupWindow({windowURL:a,windowName:void 0!=d?d:"swip",fullscreen:1,scrollbars:b,resizable:c})}function setCheckBoxHiddenValue(a,b,c){b=$("#"+b);a.checked?(b.val(c),b.removeAttr("disabled")):(b.attr("disabled","disabled"),b.val(""))}
function selectAllCheckBoxs(a,b){var c=$(b).closest("table").attr("id");a.checked?$("#"+c+" :checkbox").each(function(){$(this).prop("checked",!0);$("#"+this.id+"_hdn").val(this.checked)}):$("#"+c+" :checkbox").each(function(){$(this).prop("checked",!1);$("#"+this.id+"_hdn").val(this.checked)})}
function setCheckedAndCheckSelectAll(a,b){var c=$(b).closest("div").attr("id");$("#"+c+" :checkbox:first").prop("checked",!1);a.checked?$("#"+a.id).prop("checked",!1):$("#"+a.id).prop("checked",!0);$("#"+a.id).val(a.checked)}$.fn.getVal=function(){alert("getVal is Depricated. Use val() instead.");return $(this).val()};
function cleanUnsafeContent(a){null!=$("#"+a)&&null!=$("#"+a).val()&&$("#"+a).val($("#"+a).val().replace(/&/gi,"&amp;").replace(/"/gi,"&quot;").replace(/</gi,"&lt;").replace(/>/gi,"&gt;"))}function dirtyUnsafeContent(a){null!=$("#"+a)&&null!=$("#"+a).val()&&$("#"+a).val($("#"+a).val().replace(/&gt;/gi,">").replace(/&lt;/gi,"<").replace(/&quot;/gi,'"').replace(/&amp;/gi,"&"))}
function restorePlaceHoldersValue(a){alert("restorePlaceHoldersValue should not be used.");a.find("input, textarea").each(function(){var a=$(this),c=a.attr("placeholder");if(void 0!=c&&""!=c){var d=a.val();void 0!=d&&""!=d||a.val(c)}})}function clearPlaceholdersValue(a){alert("clearPlaceholdersValue should not be used.");a.find("input, textarea").each(function(){var a=$(this),c=a.attr("placeholder");if(void 0!=c&&""!=c){var d=a.val();void 0!=d&&d==c&&a.val("")}})}
function toggleCollapsiblePanel(a){$(a).hasClass("WidgetHeaderLabel")?($(a).next("div").slideToggle(),$(a).prev("span").hasClass("WidgetCollapse")?$(a).prev("span").removeClass("WidgetCollapse").addClass("WidgetExpand"):$(a).prev("span").hasClass("WidgetExpand")&&$(a).prev("span").removeClass("WidgetExpand").addClass("WidgetCollapse")):($(a).hasClass("WidgetCollapse")||$(a).hasClass("WidgetExpand"))&&toggleCollapsiblePanel($(a).next("span"))}
function toggleObjectLinksList(a){$(a).toggleClass("ObjectLinksListElementLabelAlt");$(a).parent().next("div").slideToggle()}function cleanAllUnsafeContent(){$("input[type=text]").each(function(){null!=$(this)&&null!=$(this).val()&&$(this).val($(this).val().replace(/</gi,"&lt;").replace(/>/gi,"&gt;"))})}
function toggleSummaryWidget(a){$(a).hasClass("MVCViewSummaryWidgetCollapse")?$(a).removeClass("MVCViewSummaryWidgetCollapse").addClass("MVCViewSummaryWidgetExpand"):$(a).hasClass("MVCViewSummaryWidgetExpand")&&$(a).removeClass("MVCViewSummaryWidgetExpand").addClass("MVCViewSummaryWidgetCollapse");$(a).parent().parent().parent().parent().parent().children(".MVCViewSummaryWidgetContent").slideToggle()}
function toggleTimeline(a){a=$("#"+a);$(a).hasClass("TimeLineCollapseButton")?($(a).removeClass("TimeLineCollapseButton").addClass("TimeLineExpandButton"),a=$(a).parent().parent().parent().parent().parent().children(".MVCViewSummaryWidgetContent"),a.removeClass("MVCViewSummaryWidgetContent").addClass("MVCViewSummaryWidgetContentHidden")):$(a).hasClass("TimeLineExpandButton")&&($(a).removeClass("TimeLineExpandButton").addClass("TimeLineCollapseButton"),a=$(a).parent().parent().parent().parent().parent().children(".MVCViewSummaryWidgetContentHidden"),
a.removeClass("MVCViewSummaryWidgetContentHidden").addClass("MVCViewSummaryWidgetContent"))}
function toggleRemoveWallTopicWindow(a,b){var c=$("#"+a);$(c).hasClass("RemoveTopicWindowHidden")?($(c).removeClass("RemoveTopicWindowHidden").addClass("RemoveTopicWindowDisplay"),$(b).removeClass("WallRemoveTopicLink").addClass("WallRemoveTopicLinkFixed")):$(c).hasClass("RemoveTopicWindowDisplay")&&($(c).removeClass("RemoveTopicWindowDisplay").addClass("RemoveTopicWindowHidden"),$(b).removeClass("WallRemoveTopicLinkFixed").addClass("WallRemoveTopicLink"))}
jQuery.fn.swapWith=function(a){return this.each(function(){var b=$(a).clone(!0),c=$(this).clone(!0);$(a).replaceWith(c);$(this).replaceWith(b)})};function menuItemUp(a){a=$("#"+a.id).parent("td").parent("tr");if(0<a.length){var b=a.prev("tr");if(0<b.children("td").length){var c=a.attr("class");a.removeClass(c);var d=b.attr("class");b.removeClass(d);a.addClass(d);b.addClass(c);$("#"+a.attr("id")).swapWith("#"+b.attr("id"))}}}
function menuItemDown(a){a=$("#"+a.id).parent("td").parent("tr");if(0<a.length){var b=a.next("tr");if(0<b.children("td").length){var c=a.attr("class");a.removeClass(c);var d=b.attr("class");b.removeClass(d);a.addClass(d);b.addClass(c);$("#"+a.attr("id")).swapWith("#"+b.attr("id"))}}}
function useDefault(a){$(a).focus(function(a){$(this).val()==$(this)[0].alt&&($(this).removeClass("default"),$(this).val(""))});$(a).blur(function(){""==$(this).val()&&($(this).addClass("default"),$(this).val($(this)[0].alt))});$(a).blur()}function StopEventPropagation(a){agent=jQuery.browser;agent.msie?a.cancelBubble=!0:a.stopPropagation()}
function ToggleContextMenu(a,b,c){StopEventPropagation(a);b=$("#"+b);void 0!=b&&(window.clearTimeout(b.data("HideContextMenuTO")),b.hasClass("hiddenCtxMenu")?(HideOtherContextMenus(a),$(".MainMenuContextMenuContainer").css("display","none"),$(".MenuItemSelected").removeClass("MenuItemSelected"),$(".ItemMainMenuDiv").css("display","none"),$("#quickPreview").css("display","none"),$("#quickPreview").removeClass("QuickPreviewPointer"),-1!=navigator.userAgent.indexOf("Firefox")?ShowContextMenu(a.target,
b,c):(ShowContextMenu(a.srcElement,b,c),ShowContextMenu(a.srcElement,b,c)),$("body").bind("click",HideOtherContextMenus),$("body").bind("mousedown",HideOtherContextMenus)):HideContextMenu(b))}
function ToggleContextMainMenu(a,b,c){$(".ItemMainMenuDiv").css("display","none");$(".MenuItemSelected").removeClass("MenuItemSelected");StopEventPropagation(a);b=$("#"+b);b.hasClass("expCtxMenu")||$(".expCtxMenu").addClass("hiddenCtxMenu").css("display","none").removeClass("expCtxMenu");b.hasClass("expCtxMenu")&&b.hasClass("hiddenCtxMenu")&&b.removeClass("hiddenCtxMenu");var d=a||window.event,e=d.target||d.srcElement,e=$.browser.mozilla?d.target||d.srcElement:"undefined"===a.target?a.target:window.event.srcElement;
void 0!=b&&(window.clearTimeout(b.data("HideContextMenuTO")),b.hasClass("hiddenCtxMenu")?(HideOtherContextMenus(a),$(e).closest(".MenuItem").addClass("MenuItemSelected"),$("body").bind("click",HideOtherContextMenus),-1!=navigator.userAgent.indexOf("Firefox")?ShowMainMenuContextMenu(a.target,b,c):ShowMainMenuContextMenu(a.srcElement,b,c),$("body").bind("mousedown",HideOtherContextMenus)):HideMainMenuContextMenu(b))}
function HideMainMenuContextMenu(a){a.hide();a.addClass("hiddenCtxMenu");a.removeClass("expCtxMenu");$.browser.msie&&$(a).restoreZIndex()}function ShowMainMenuContextMenu(a,b,c){b.show();b.removeClass("hiddenCtxMenu");b.addClass("expCtxMenu");$(b).width();$(b).height()}function HideContextMenuById(a){a=$("#"+a);void 0!=a&&HideContextMenu(a)}
function HideContextMenu(a){var b=window.setTimeout(function(){a.hide();a.addClass("hiddenCtxMenu");a.removeClass("expCtxMenu");$.browser.msie&&$(a).restoreZIndex()},100);a.data("HideContextMenuTO",b)}
function ShowContextMenu(a,b,c){b.show();b.removeClass("hiddenCtxMenu");b.addClass("expCtxMenu");var d=$(b).width(),e=$(b).height();"Top"==c?$(b).position({my:"left top",at:"left top",of:$(a),offset:"0 -"+($(a).height()+e-10)}):$(b).position({my:"left top",at:"left bottom",of:$(a),offset:"0 2"});$(b).width(parseInt(d));$(b).height(parseInt(e))}
(function(a){a.fn.fixZIndex=function(b){b=b||{};if(b.msieOnly&&!a.browser.msie)return this;for(var c=this.length;c--;)for(var d=this[c],e=b.recursive||!0,f=b.exclude||null;d!=document.body&&(a(d).hasClass(f)||"relative"!=a(d).css("position")&&"absolute"!=a(d).css("position")||(void 0==a.data(d,"zIndex")&&a.data(d,"zIndex",d.style.zIndex||"-1"),d.style.zIndex=b.zIndex||"9999"),d=d.parentNode,e););return this};a.fn.restoreZIndex=function(b){b=b||{};if(b.msieOnly&&!a.browser.msie)return this;for(var c=
this.length;c--;)for(var d=this[c],e=b.exclude||null;d&&d!=document.body;){var f=a.data(d,"zIndex");-1<f&&!a(d).hasClass(e)?(d.style.zIndex=f,a.removeData(d,"zIndex")):-1==f&&(d.style.zIndex="");d=d.parentNode}return this}})(jQuery);
function HideOtherContextMenus(a){var b=$(".ItemMainMenuDiv"),c=$(".MainMenuContextMenuContainer");null==a||b.is(a.target)||0!==b.has(a.target).length||c.is(a.target)||0!==c.has(a.target).length||$(a.target).closest(".MainMenuBarContainer").hasClass("MainMenuBarContainer")||$(a.target).hasClass("MenuItemCell")||$(a.target).hasClass("MenuItem")||($(".companiesSelector").parent().find("ul").css("display","none"),$(".MainMenuContextMenuContainer").css("display","none"),$(".MainMenuContextMenuContainer").addClass("hiddenCtxMenu"),
$(".ItemMainMenuDiv").css("display","none"),$(".MenuItemSelected").removeClass("MenuItemSelected"));$(".round_sb").parent().find("ul").css("display","none");b=null;null!=a&&(b=$(a.target));null==b||b.hasClass("DivMainMenuBackground")||b.hasClass("MainMenuContextMenuButton")||(c=b.parents(".expCtxMenu"),void 0!=c&&0!=c.length||b.hasClass("expCtxMenu")||($("body").unbind(a,HideOtherContextMenus),a=$(".expCtxMenu"),void 0==a||a.hasClass("MainMenuContextMenuContainer")||HideContextMenu(a)))}
function AHWidgetOnClick(a,b){var c=$("#"+a);$("#"+b).hide();c.show()}function AHTextBoxOnClick(a,b){var c=$("#"+a),d=$("#"+b);c.hide();d.show();d.focus();d.blur({DivBoxId:a},AHTextBoxOnBlur)}function AHTextBoxOnBlur(a){var b=$(a.target);a=$("#"+a.data.DivBoxId);b.hide();a.show()}function TextBoxBlurCommentWidget(a,b){var c=$("#"+a),d=$("#"+b);c.children('[id$="Content"]').html(replacecarriagereturn(d.val(),"<br />"))}function replacecarriagereturn(a,b){return a.replace(/\n|\r|\n\r/g,b)}
function TextBoxBlurChapterWidget(a,b){var c=$("#"+a),d=$("#"+b);c.children('[id$="Content"]').html(d.val())}function TextBoxBlur(a){TextBoxBlur(a,"")}function TextBoxBlur(a,b){var c=$("#"+a),d=c.val();if(void 0==d||""==d)void 0!=b&&""!=b&&c.addClass(b),c.val(c.attr("placeholder"))}function TextBoxFocus(a){TextBoxFocus(a,"")}function TextBoxFocus(a,b){var c=$("#"+a);c.val()==c.attr("placeholder")&&(c.val(""),void 0!=b&&""!=b&&c.removeClass(b))}
function CertificateValidation(){$("#"+parentElement+"divCertificateValidationLabel").toggle(!0);$("#"+parentElement+"divCertificateValidationResult").toggle(!0)}function Initializevalidation(){$("#"+parentElement+"btnInitValidation").click()}function ShowMain(a){$("#"+parentElement+"tblMain").toggle(!0);a?$("#"+parentElement+"trValStep3").css("visibility","visible"):$("#"+parentElement+"trValStep3").css("visibility","hidden")}
function HideValidationSummary(){$("#"+parentElement+"tblRVST").css("visibility","hidden");$("#"+parentElement+"trValStep3").css("visibility","hidden")}function ShowValidation(){$("#"+parentElement+"tblRVST").css("visibility","visible")}
function ShowValidationSummary(a){$("#"+parentElement+"trValStep1").css("visibility","hidden");$("#"+parentElement+"trValStep2").css("visibility","hidden");$("#"+parentElement+"trValStep3").css("visibility","hidden");$("#"+parentElement+"tblMain").toggle(!0);$("#"+parentElement+"tblRVST").css("visibility","visible");setTimeout("ShowStep1("+a+")",1E3)}function ShowStep1(a){$("#"+parentElement+"trValStep1").css("visibility","visible");setTimeout("ShowStep2("+a+")",1E3)}
function ShowStep2(a){$("#"+parentElement+"trValStep2").css("visibility","visible");a&&setTimeout("ShowStep3()",1E3)}function ShowStep3(){$("#"+parentElement+"trValStep3").css("visibility","visible")}
function ToggleUserBusinessCard(a){$("#"+parentElement+"divUserBusinessCard").toggle();var b=window.event;void 0==b&&(b=a);$("#"+parentElement+"divUserBusinessCard").css("position","absolute");$("#"+parentElement+"divUserBusinessCard").css("top",b.pageY+15+"px");$("#"+parentElement+"divUserBusinessCard").css("left",b.pageX+"px")}
function ToggleBlackList(a){$("#"+parentElement+"divBlacklist").toggle();var b=window.event;void 0==b&&(b=a);$("#"+parentElement+"divBlacklist").css("position","absolute");$("#"+parentElement+"divBlacklist").css("top",b.pageY+15+"px");$("#"+parentElement+"divBlacklist").css("left",b.pageX+"px")}function QuestionnaireTextBoxBlur(a){$(a.target).removeClass("QuestionnaireTextBoxFocus")}function QuestionnaireTextBoxFocus(a){$(a.target).addClass("QuestionnaireTextBoxFocus")}
String.prototype.startsWith=function(a){return this.match("^"+a)==a};String.prototype.endsWith=function(a){return this.match(a+"$")==a};
function checkUncheckAllInComparativeMap(a,b){a.checked?$('tr[contextid^="'+b+'"]').each(function(a){$(this).parent().parent().parent().hasClass("SelectedRow")||($(this).parent().parent().parent().parent().hasClass("HighlightedRowNotAwarded")&&$(this).parent().parent().parent().parent().removeClass("HighlightedRowNotAwarded"),$(this).parent().parent().parent().addClass("SelectedRow"),$(this).parent().parent().parent().find("td:first").find(":hidden").val(!0),"0"!=$(this).parent().parent().parent().find("td:first").find("input:checkbox").length&&
$(this).parent().parent().parent().find("td:first").find("input:checkbox").attr("checked","true"),UpdateAwardPriceColumn($(this).parent().parent().parent(),!0))}):$('tr[contextid^="'+b+'"]').each(function(a){$(this).parent().parent().parent().hasClass("SelectedRow")&&($(this).parent().parent().parent().removeClass("SelectedRow"),$(this).parent().parent().parent().find("td:first").find(":hidden").val(!1),"0"!=$(this).parent().parent().parent().find("td:first").find("input:checkbox").length&&$(this).parent().parent().parent().find("td:first").find("input:checkbox").removeAttr("checked"),
UpdateAwardPriceColumn($(this).parent().parent().parent(),!1))})}
function checkUncheckAllInAwardBillOfQuantities(a,b){a.checked?$('tr[contextid^="'+b+'"]').each(function(a){$(this).parent().parent().parent().hasClass("SelectedRow")||(a=$(this).parent().parent().parent().find("td:first").find("input:checkbox"),0<a.size()&&a.get(0).click())}):$('tr[contextid^="'+b+'"]').each(function(a){$(this).parent().parent().parent().hasClass("SelectedRow")&&(a=$(this).parent().parent().parent().find("td:first").find("input:checkbox"),0<a.size()&&a.get(0).click())})}
function ensureAwardBillOfQuantitiesIdSelected(a,b,c){$("#"+a).find("input:checkbox[id^='"+b+"']").each(function(a){$(this).is(":checked")&&(a=$(this).attr("id").replace(b,""),$('tr[contextid^="'+a+'"]').each(function(a){$(this).parent().parent().parent().hasClass("SelectedRow")||(a=$(this).parent().parent().parent().find("td:first").find("input:checkbox[id^='"+c+"']"),0<a.size()&&a.get(0).click())}))})}
function disableComparativeMapInputsByFlatTreeID(a){$("#"+a).find(":input:not([type='button'])").prop("disabled",!0)}function ensureDisableAwardBillOfQuantities(a,b){$("#"+a).find("input:checkbox[id^='"+b+"']").each(function(b){!0==$(this).attr("disabled")&&disableComparativeMapInputsByFlatTreeID(a)})}
function checkUncheckInComparativeMap(a,b,c){a=$(a).parent().parent().parent().parent().parent();var d=DefaultValues_GeneralPriceListItemProperties();b=CreateSandBox(b,d);d=!1;"true"==c&&(d=!0);a.hasClass("SelectedRow")?(a.removeClass("SelectedRow"),void 0!=b.parentSandBox&&d&&UpdateAwardPriceSupplierColumn(a,!1,b.restrictedContextId,b.parentSandBox.contextId)):(a.parent().hasClass("HighlightedRowNotAwarded")&&a.parent().removeClass("HighlightedRowNotAwarded"),c=a.parent().attr("parentid"),c=a.parent().parent().find('tr[id="'+
c+'"]'),c.hasClass("HighlightedRowNotAwarded")&&c.removeClass("HighlightedRowNotAwarded"),a.addClass("SelectedRow"),"False"==$('tr[contextid="'+b.contextId+'"]').attr("countsToTotal")&&$('tr[contextid="'+b.contextId+'"]').attr("countsToTotal","True"),void 0!=b.parentSandBox&&d&&UpdateAwardPriceSupplierColumn(a,!0,b.restrictedContextId,b.parentSandBox.contextId))}
function UpdateAwardPriceSupplierColumn(a,b,c,d){c=$('tr[contextid="'+c+'"]');var e=$('tr[contextid="'+d+'"]');d=getElementValue(c,"ReplyPriceSelectedTotal");e=getElementValue(e,"ReplyPriceTotal");a=a.parent().find('input[contextvarid="ReplyPriceTotal"]');isNaN(e)||isNaN(d)||(d=b?d+$.parseFloat($(a).val()):d-$.parseFloat($(a).val()),setElementValue(c,"ReplyPriceSelectedTotal",$.format(d,"n2")))}
function getSupplierItemsSelection(a,b){var c=[];$("#"+a).find("input:checked").each(function(){var a=$(this).parent().parent().attr("contextId");c.push($(this).siblings('input:hidden[name="hdn_'+a+'"]').val())});$("#"+b).val(c.join("&selection="))}function collapseRemovedLinesComparativeMap(){$("table").find("tr.RowDisabled").hide()}function expandRemovedLinesComparativeMap(){$("table").find("tr.RowDisabled").show()}
function collapseExtraLinesComparativeMap(){$("table").find("tr.RowNew").hide()}function expandExtraLinesComparativeMap(){$("table").find("tr.RowNew").show()}function collapseAlternativeLinesComparativeMap(){$("table").find("tr.RowAlternative").hide();$("table").find("tr.RowAlternativeNew").hide()}function expandAlternativeLinesComparativeMap(){$("table").find("tr.RowAlternative").show();$("table").find("tr.RowAlternativeNew").show()}
function hideSelectColumnsComparativeMap(){$("table").find("th.LeftSeparator").find("td").find("input:checkbox").filter(":checked").parent().each(function(a){a=$(this).attr("column");$("table").find('th.LeftSeparator[column="'+a+'"]').hide();$("table").find('td.FltContextTd[column="'+a+'"]').hide()})}
function hidePreviouslyHiddenColumnsComparativeMap(){$("table").find("th.LeftSeparator").find(":hidden").each(function(a){a=$(this).attr("column");$("table").find('th.LeftSeparator[column="'+a+'"]').hide();$("table").find('td.FltContextTd[column="'+a+'"]').hide()})}function showSelectColumnsComparativeMap(){$("table").find("th[column]").filter(":hidden").show();$("table").find("td[column]").filter(":hidden").show()}
function collapseGraphs(a){$(a).is(":checked")?$("body").find("div.GraphContainer").show("slow"):$("body").find("div.GraphContainer").hide("slow")}function transformIntoTinyMCEReadOnly(a){tinyMCE.execCommand("mceRemoveControl",!0,a);tinyMCE.init({mode:"exact",theme:"advanced",encoding:"xml",elements:a,readonly:!0,invalid_elements:"script[src|type]",extended_valid_elements:"iframe[src|width|height|name|align]"})}
function transformIntoTinyMCE(a,b,c){var d="",e="",f="",g="";"Minimal"==b?(d="v_advlink, v_vars",e="bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink,|,varsmenubutton"):(d="style,table,advhr,insertdatetime,preview,searchreplace,print,paste,directionality,fullscreen,visualchars,v_vars,v_advimage,v_advlink,fullpage","Complete"==b?(e="bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,|,varsmenubutton",
f="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",g="tablecontrols,|,hr,removeformat,|,sub,sup,|,charmap,iespell,advhr,|,print,|,ltr,rtl,|,fullscreen"):e=c);b=document.getElementById(a).value;tinyMCE.execCommand("mceRemoveControl",!0,a);document.getElementById(a).value=b;setTimeout(function(){tinyMCE.init({mode:"exact",theme:"advanced",elements:a,
plugins:d,extended_valid_elements:"iframe[src|width|height|name|align]",invalid_elements:"script[src|type]",theme_advanced_buttons1:e,theme_advanced_buttons2:f,theme_advanced_buttons3:g,theme_advanced_resizing:!0,theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left"})},100)}
(function(a){a.fn.hoverIntent=function(b,c){var d={sensitivity:7,interval:100,timeout:0},d=a.extend(d,c?{over:b,out:c}:b),e,f,g,h,k=function(a){e=a.pageX;f=a.pageY},l=function(b,c){c.hoverIntent_t=clearTimeout(c.hoverIntent_t);if(Math.abs(g-e)+Math.abs(h-f)<d.sensitivity)return a(c).unbind("mousemove",k),c.hoverIntent_s=1,d.over.apply(c,[b]);g=e;h=f;c.hoverIntent_t=setTimeout(function(){l(b,c)},d.interval)},m=function(b){var c=jQuery.extend({},b),e=this;e.hoverIntent_t&&(e.hoverIntent_t=clearTimeout(e.hoverIntent_t));
"mouseenter"==b.type?(g=c.pageX,h=c.pageY,a(e).bind("mousemove",k),1!=e.hoverIntent_s&&(e.hoverIntent_t=setTimeout(function(){l(c,e)},d.interval))):(a(e).unbind("mousemove",k),1==e.hoverIntent_s&&(e.hoverIntent_t=setTimeout(function(){e.hoverIntent_t=clearTimeout(e.hoverIntent_t);e.hoverIntent_s=0;d.out.apply(e,[c])},d.timeout)))};return this.bind("mouseenter",m).bind("mouseleave",m)}})(jQuery);
var quickPreviewTimer=null,quickPreviewSelected=null,quickPreviewInProgress=null,quickPreviewIgnored=null,iframeId="quickPreview",quickPreviewType=null;function quickPreviewEventDetectLinks(a,b,c,d,e){"A"===(a.target?a.target:a.srcElement?a.srcElement:e[0].firstChild).nodeName?window.location.href=a.target.href:c?quickPreviewPointerEvent(a,b,d,e):quickPreviewEvent(a,b,d,e)}
function quickPreviewEvent(a,b,c,d){if(null!=(a.target?a.target:a.srcElement?a.srcElement:d[0].firstChild)){if(null==quickPreviewInProgress||quickPreviewInProgress!=d.id)return quickPreviewInProgress=d.id,$.browser.msie&&9>parseFloat($.browser.version)?quickPreview(b,c,d,a.clientX,a.clientY):quickPreview(b,c,d,a.pageX,a.pageY),!1}else quickPreviewIgnored=b,closeQuickPreview();return!0}var openedQuickPreviewElemId;
function quickPreviewPointerEvent(a,b,c,d){quickPreviewType="quickPreviewPointer";quickPreviewEvent(a,b,c,d)}
function quickPreview(a,b,c,d,e){jQuery(document).ready(function(){function d(a){e();var c=$("#"+iframeId);null!=c&&c.remove();$("body").append("<iframe class='QuickPreview' frameborder='0' scrolling='no' id='"+iframeId+"' src='"+b+"' name='RedirectOnDifferentURL'></iframe>");c=$("#"+iframeId);c.css("top",a.pageY+20+"px").css("left",a.pageX+20+"px");fitQuickPreview();c.hover(function(a){e()},function(a){e()});c.fadeIn("slow");$(c).on("load",function(){redirectQuickPreview()})}function e(){null!=quickPreviewTimer&&
(window.clearTimeout(quickPreviewTimer),quickPreviewTimer=null)}if(openedQuickPreviewElemId==a)openedQuickPreviewElemId=void 0;else if(null==c)quickPreviewInProgress=a,$("#"+a).hoverIntent({sensitivity:5,interval:500,timeout:0,over:function(b){quickPreviewIgnored!=a?(d(b),null!=quickPreviewSelected&&quickPreviewSelected.removeClass("QuickPreviewHover"),quickPreviewSelected=$("#"+a).closest("tr.QuickPreviewHoverable"),null!=quickPreviewSelected&&quickPreviewSelected.addClass("QuickPreviewHover")):
quickPreviewIgnored=null}});else{e();var h=$("#"+iframeId),k=$(c);null!=h&&h.remove();null!=quickPreviewSelected&&quickPreviewSelected.removeClass("QuickPreviewHover");null!=quickPreviewType&&"quickPreviewPointer"==quickPreviewType?$("body").append("<iframe class='QuickPreviewPointer' frameborder='0' allowTransparency='true' scrolling='no' id='"+iframeId+"' src='"+b+"'></iframe>"):$("body").append("<iframe class='QuickPreview' frameborder='0' allowTransparency='true' scrolling='no' id='"+iframeId+
"' src='"+b+"'></iframe>");h=$("#"+iframeId);quickPreviewSelected=$("#"+a).closest("tr.QuickPreviewHoverable");null!=quickPreviewSelected&&quickPreviewSelected.addClass("QuickPreviewHover");var l=k.offset().left+25+k[0].offsetWidth/2;null!=quickPreviewType&&"quickPreviewPointer"==quickPreviewType?(null!=$(".PageContainer")&&null!=$(".PageContainer")[0]&&$(".PageContainer")[0].offsetWidth<l+21&&(l-=20),270>l&&(l=270)):43>l&&(l=43);var m=k[0].offsetLeft+25+k[0].offsetWidth/2;null!=quickPreviewType&&
"quickPreviewPointer"==quickPreviewType?(null!=$(".PageContainer")&&null!=$(".PageContainer")[0]&&$(".PageContainer")[0].offsetWidth<l+21&&(l-=20),270>m&&(m=270)):43>m&&(m=43);$.browser.msie&&7===parseInt($.browser.version,10)?null!=k[0].attributes.useteaser&&"true"==k[0].attributes.useteaser.value?h.css("top",k.offset().top+21+k[0].offsetHeight/2+"px").css("left",l+"px").css("zIndex",10010).show():h.css("top",k[0].offsetTop+21+k[0].offsetHeight/2+"px").css("left",m+"px").css("zIndex",10010).show():
null!=k[0].attributes.useteaser&&"true"==k[0].attributes.useteaser.value?h.css("top",k.offset().top+21+k[0].offsetHeight/2+"px").css("left",l+"px").show():h.css("top",k[0].offsetTop+21+k[0].offsetHeight/2+"px").css("left",m+"px").show();fitQuickPreview();h.hover(function(a){e()},function(a){e()});quickPreviewSelected&&quickPreviewSelected.hover(function(a){e()},function(a){e()});openedQuickPreviewElemId=a}})}
function redirectQuickPreview(){try{var a=$("iframe.QuickPreview").contents().get(0).location.href.toLowerCase(),b=$("iframe.QuickPreview").attr("src").toLowerCase();-1!=a.split("?")[0].indexOf("/login.aspx")&&-1==b.split("?")[0].indexOf("/login.aspx")&&window.location.reload()}catch(c){console.log("Error on redirectQuickPreview: "+c)}}
function quickPreviewReplyEnvelopes(a,b){jQuery(document).ready(function(){var c=$("#"+a);c.position();var d=$("#quickPreviewReply"),e=$("#quickPreviewReplyCreated");null!=d&&0==e.length&&(c.append("<iframe class='QuickPreview'  frameborder='0' scrolling='no' id='quickPreviewReply' src='"+b+"'></iframe>"),c.append("<div id='quickPreviewRightTrianguleShadow' class='QuickPreviewRightTrianguleShadow'/>"),c.append("<div id='quickPreviewRightTriangule' class='QuickPreviewRightTriangule'/>"),c.append("<div id='quickPreviewTopCover' class='QuickPreviewTopCover'/>"),
d=$("#quickPreviewReply"),d.contents().find("html").css("background-color","#EDEDED"),d.css("margin-top","-30px").css("margin-left","-293px").show(),d.css("display","inline"),d.css("width","180px").css("height","110px"),c=$("#quickPreviewRightTrianguleShadow"),c.css("margin-top","3px").css("margin-left","-113px").show(),c.css("display","inline"),c=$("#quickPreviewRightTriangule"),c.css("margin-top","3px").css("margin-left","-113px").show(),c.css("display","inline"),c=$("#quickPreviewTopCover"),c.css("margin-top",
"-30px").css("margin-left","-293px").show(),c.css("display","inline"),c.css("width","180px").css("height","7px"))})}
function closeQuickPreviewReplyEnvelopes(){var a=$("#quickPreviewReply");null!=a&&a.remove();$("body").append("<span id='quickPreviewReplyCreated' style='display:none;'></span>");a=$("#quickPreviewRightTrianguleShadow");null!=a&&a.remove();a.css("display","none");a=$("#quickPreviewRightTriangule");null!=a&&a.remove();a.css("display","none");a=$("#quickPreviewTopCover");null!=a&&a.remove();a.css("display","none")}
function resizeQuickPreview(a,b){var c=$("#quickPreview");c.css("width",a);c.css("height",b);fitQuickPreview()}function setQuickPreviewPointerPosition(){var a=$("#quickPreview");0==a[0].offsetLeft&&(a=a.contents().find(".NotificationQuickPreviewBody"),null!=a&&(a[0].className="NotificationQuickPreviewBodyLeft"))}
function closeQuickPreview(){null!=quickPreviewSelected&&(quickPreviewSelected.removeClass("QuickPreviewHover"),quickPreviewSelected=null);null!=quickPreviewTimer&&(window.clearTimeout(quickPreviewTimer),quickPreviewTimer=null);var a=$("#"+iframeId);null!=a&&a.remove()}
function fitQuickPreview(){var a=$("#quickPreview");if(null!=a&&void 0!=a){var b=null!=a.offset()?a.offset().left:0,c=null!=a.offset()?a.offset().top:0,d=a.outerWidth(!0),e=a.outerHeight(!0),f=$(window).width(),g=$(window).height(),h=$(window).scrollLeft(),k=$(window).scrollTop();b-h+d>f&&a.css("left",h+f-d);c-k+e>g&&a.css("top",k+g-e)}}
function ShowSinglePhase(a){var b=$("body");b.find("div.SinglePhaseView").each(function(){$(this).css("display","block")});b.find("div.ReceivedOffersView").each(function(){$(this).css("display","block")});b.find("div.PhasesIndexView").each(function(){$(this).css("display","none")});b.find("div.ProcedureSummaryDataView").each(function(){$(this).css("display","block")});filterElements(a,"ALL");filterElements("FilterByPhase",a);filterElements("FilterByPhaseReceivedOffers",a);filterElements("FilterByPhaseProcedureSummaryData",
a);$('input[name="View"]').val(a)}function HideAllLots(a,b){for(var c=$('[id^="div'+a+'_"]'),d=0;d<c.size();d++){var e="#"+c[d].id;$(e).is(":visible")&&$(e).toggle()}c=$('[id^="img'+b+'_"]');for(d=0;d<c.size();d++){var e="#"+c[d].id,f=c[d].src;0<=f.indexOf("collapse")&&(f=f.replace("collapse","expand"),$(e).attr("src",f))}}
function HideShowLots(a,b,c,d){b-=1;c-=1;a="#div"+a+"_"+b+"_"+c;d="#img"+d+"_"+b+"_"+c;$(a).toggle();b=$(d).attr("src");$(a).is(":visible")?(a=b.replace("expand","collapse"),$(d).attr("src",a)):$(a).is(":visible")||(a=b.replace("collapse","expand"),$(d).attr("src",a))}var _allElementFilters={},_filterRecycleBin;
function addElementToFilter(a,b,c){var d=null,e=null;null==_allElementFilters[a]?(d={},_allElementFilters[a]=d):d=_allElementFilters[a];null==d[b]?(e=[],e.Key=b,d[b]=e):e=d[b];-1==$.inArray(c,e)&&e.push(c)}
function filterElements(a,b){null==_filterRecycleBin&&($("body").append('<div style="display:none" id="filterRecycleBin"></div>'),_filterRecycleBin=$("#filterRecycleBin"));var c=_allElementFilters[a];if(null!=c){var d=$("#"+a);_filterRecycleBin.append(d.html());d.empty();c=c[b];null!=c&&$(c).each(function(){var a=$("#"+this.toString());d.append(a)})}}
function selectChilds(a){for(var b=$(a).parent().find("input"),c=0;c<b.length;c++)"hidden"==b[c].attributes.type.value?b[c].value=$(a).val():"true"==$(a).val()?b[c].checked=!0:b[c].checked=!1}function ToggleProposalDetail(a){a=$('//table[ProposalReference="'+a+'"]');void 0!=a&&a.toggle()}function ToggleEvaluationConfigItem(a){a=$('//tr[EvaluationConfigItemReference="'+a+'"]');void 0!=a&&a.toggle()}function hideViewModeDefaultText(a){a=$("#"+a+"_DefaultText_Cell");void 0!=a&&a.hide()}
function showViewModeDefaultText(a){a=$("#"+a+"_DefaultText_Cell");void 0!=a&&a.show()}function addViewModeElement(a){var b=$("#"+a+"_View"),c=b.attr("viewelems");0==c&&hideViewModeDefaultText(a);c++;b.attr("viewelems",c)}function removeViewModeElement(a){var b=$("#"+a+"_View"),c=b.attr("viewelems");1==c&&showViewModeDefaultText(a);c--;b.attr("viewelems",c)}
function updateViewValue(a,b){var c=$("#"+a),d=$("#"+a+"_View"),c=c.val();d.html(c);void 0==c||""==c?(d.parent().hide(),removeViewModeElement(b)):(d.parent().show(),addViewModeElement(b))}function ToogleWidget(a,b){StopEventPropagation(a);var c=$("#"+b);void 0!=c&&(c.hasClass("AutoHideWidgetView")?(HideEditViewWidgets(a),ShowEditViewWidget(c,b),$("body").bind("click",HideEditViewWidgets)):HideEditViewWidget(c,b))}function HideEditViewWidget2(a){var b=$("#"+a);HideEditViewWidget(b,a)}
function HideEditViewWidget(a,b){var c=$("#"+b+"_Edit"),d=$("#"+b+"_View");a.removeClass("AutoHideWidgetEdit");a.addClass("AutoHideWidgetView");d.show();c.hide()}function ShowEditViewWidget(a,b){var c=$("#"+b+"_Edit"),d=$("#"+b+"_View");a.removeClass("AutoHideWidgetView");a.addClass("AutoHideWidgetEdit");d.hide();c.show()}
function HideEditViewWidgets(a){var b=$(a.target).parents(".AutoHideWidgetEdit");if(void 0==b||0==b.length)$("body").unbind(a,HideEditViewWidgets),a=$(".AutoHideWidgetEdit"),void 0!=a&&HideEditViewWidget(a,a.attr("id"))}function AddQualificationItemComment(a,b,c){a=$("#"+a);b=$("#"+b);c=$("#"+c);a.hide();b.show();c.show()}function ClearQualificationItemComment(a,b,c,d){a=$("#"+a);b=$("#"+b);c=$("#"+c);var e=$("#"+d);d=$("#"+d+"_View");a.show();b.hide();c.hide();e.val("");d.text("")}
var MessageType={Success:1,Info:2,Warning:3,Error:4};
function addMessage(a,b){var c="",d="";a==MessageType.Success?(d="Success",c="Success:"):a==MessageType.Info?(d="Success",c="Info:"):a==MessageType.Warning?(d="Warning",c="Warning:"):a==MessageType.Error&&(d="Error",c="Error:");c='<table cellpadding="0" cellspacing="0" class="AlertMessagesContainer" id="msgMessagesPanel">    <tbody>        <tr class="'+d+'MessagesContainer">            <td class="AlertImage" onclick="javascript:$(this).parent().parent().parent().hide();">&nbsp;</td>            <td class="'+d+
'Message">                <table class="'+d+'Message">                    <tbody>                        <tr>                            <td>                                '+c+b+"                            </td>                        </tr>                    </tbody>                </table>            </td>        </tr>    </tbody></table>";$("#msgMessagesPanel").append(c);$("#msgMessagesPanel").show()}
function CallNumberedPaginatorGridGoToPageOnClick(a,b,c,d,e){$(a).show();$(a).unbind("click");$(a).click(function(){var a=$("#"+b),a=$(a).parent().parent().parent(),g=$(a).children("tr");null==$(g).html()&&(g=$(a).children().find("tr"));a=$(g).last().find(".VortalNumberedPaginator").find("td");null==$(a).html()&&(a=$(".VortalNumberedPaginator").find("td"));a=parseInt($(a).find(".VortalPaginatorSelectedPageSpan").html())-1;NumberedPaginatorGridGoToPage(b,a+c,d,e)})}
function NumberedPaginatorGridGoToPage(a,b,c,d){var e=$("#"+a);null==$(e).html()&&(a=a.replace("_Paginator","_paginator"),e=$("#"+a));var f=$(e).parent().parent().parent(),g=$(f).children("tr");null==$(g).html()&&(g=$(f).children().find("tr"));var h=$(g).last().find(".VortalNumberedPaginator").find("td");null==$(h).html()&&(h=$(".VortalNumberedPaginator").find("td"));if(null==$(e).html()||null==$(f).html()||null==$(g).html()||null==$(h).html())alert("FATAL ERROR WHILE RENDERING GRID!!");else{$(g).hide();
$(g).first().show();for(var k=e=b*c+1;k<e+c;++k)$(g).eq(k).show();if(3>=$(h).size())$(h).hide();else{$(g).last().show();""==$(g).last().attr("id")&&($(f).find(".VortalNumberedPaginator").show(),$(f).find(".VortalGridPaginatorContainer").show());$(h).removeClass("VortalPaginatorSelectedPage");$(h).addClass("VortalPaginatorPage");$(h).children(".VortalPaginatorSelectedPageSpan").remove();$(h).children("input").show();g=b+1;$(h).eq(g).addClass("VortalPaginatorSelectedPage");$(h).eq(g).removeClass("VortalPaginatorPage");
$(h).eq(g).children("input").hide();$(h).eq(g).append('<span class="VortalPaginatorSelectedPageSpan">'+g+"</span>");f=d+1;if(100<f){e=f-g;50<=e&&(e=49);g+=e;e=g-100+1;for(index=1;index<e;++index)$(h).eq(index).hide();for(index=e;index<=g;++index)$(h).eq(index).show();for(index=g+1;index<=f;++index)$(h).eq(index).hide()}f=$(h).first();0>=b?$(f).hide():($(f).show(),CallNumberedPaginatorGridGoToPageOnClick(f,a,-1,c,d));h=$(h).last();b>=d?$(h).hide():($(h).show(),CallNumberedPaginatorGridGoToPageOnClick(h,
a,1,c,d))}}}function toggleVisibility(a){$(a).toggle()}function getNextSiblingByNodeName(a,b){var c=null;b=b.toUpperCase();$(a).nextAll().each(function(){if($(this)[0].nodeName.toUpperCase()==b)return c=$(this),!1});return c}function applySelectSharedDataSource(a,b){$("."+a).live("focus",function(){applySelectSharedDataSourceToObj($(this),b);void 0!=window.event&&(window.event.preventDefault?window.event.preventDefault():(window.event.returnValue=!1,window.event.cancelBubble=!0))})}
function applySelectSharedDataSourceToObj(a,b){var c=a.children();if(2>=c.size()){var d=c.eq(0),c=c.eq(1);a.html(b);void 0!=d.attr("selected")&&!0==d.attr("selected")?a.val(d.attr("value")):void 0!=c.attr("selected")&&!0==c.attr("selected")&&a.val(c.attr("value"))}}
function validateWorkingHours(a,b,c,d,e){var f=a.val();if(null!=f&&""!=f&&(f=$.datetimebox.parseDate($.datetimebox._defaults.dateFormat,f),""==c||f.isWeekday()||(alert(c),a.val("")),""!=b)){c=new Date(f);var g=new Date(f);""!=d&&(c.setHours(d.split(":")[0]),c.setMinutes(d.split(":")[1]));""!=e&&(g.setHours(e.split(":")[0]),g.setMinutes(e.split(":")[1]));f.between(c,g)||(alert(b),a.val(""))}}
function onKeyPressed(a,b){if(13==a.keyCode)return $("#"+b).click(),a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),!1}function detectIE(){var a=window.navigator.userAgent,b=a.indexOf("MSIE "),c=a.indexOf("Trident/");return 0<b?parseInt(a.substring(b+5,a.indexOf(".",b)),10):0<c?(b=a.indexOf("rv:"),parseInt(a.substring(b+3,a.indexOf(".",b)),10)):!1}
function showSearchResults(a,b){0!=$("li > a.jstree-search").length?(document.getElementById("div"+a+"Info").innerHTML="<b>"+$("li > a.jstree-search").length+"</b> "+b,0!=$("li > a.jstree-search").position().top-100&&(document.getElementById("div"+a+"Div").scrollTop=1,document.getElementById("div"+a+"Div").scrollTop=$("li > a.jstree-search").position().top-100)):document.getElementById("div"+a+"Info").innerHTML="<b>0</b> "+b}
function toggleElementVisibility(a){var b=$("#"+a);b.hasClass("Hidden")?(b.removeClass("Hidden"),b.addClass("Visible"),document.getElementById(a).style.visibility="visible",document.getElementById(a).style.display="block"):b.hasClass("Visible")&&(b.removeClass("Visible"),b.addClass("Hidden"),document.getElementById(a).style.visibility="hidden",document.getElementById(a).style.display="none")}
function hideUserGroupDetailButton(a,b){""==$("#"+a).siblings("[type=hidden]").val()&&$("#"+b).css("visibility","hidden")}function WaitForFileInArchive(a,b){void 0!=b&&0<b&&BlockMessageWithImage("Importing...",!0);$("#"+a).click()}function WaitForFileInArchiveWithParams(a,b){void 0!=b&&0<b&&BlockMessageWithImage("Importing...",!0);getAction(a)}function UseArchiveFile(a){$.unblockUI();$("#"+a).click()}function UseArchiveFileWithParam(a){$.unblockUI();getAction(a)}
function WaitForActionToComplete(a){getAction(a)}function ProcessActionAfterComplete(a){$.unblockUI();getAction(a)}
function DisplayAlert(a,b,c,d,e,f,g,h){"undefined"===typeof h&&(h="Warning");c?null!=d?$.blockUI({message:'<table class="ErrorPageBoxTable" style="text-align: left; width: 500px;" cellspacing="0"><tr><td colspan="2"><table class="ErrorPageTitleTable" cellspacing="0"><tr><td><span class="ErrorPageMainTitle">'+a+'</span><input type="button" class="CloseButton" onclick="javascript:$.unblockUI();'+d+';return false;"/></td></tr></table></td></tr><tr><td class="'+h+'PageImageCell">&nbsp;</td><td><table class="ErrorPageMessageTable" cellspacing="0"><tr><td class="ErroPageMessage"><span class="VortalSpan ScrollingSpan">'+
b+'</span></td></tr><tr><td class="AlignRight"><input type="button" class="MessageButton" onclick="javascript:$.unblockUI();'+d+';return false;" value="Ok"/></td></tr></table></td></tr></table>',centerY:0,centerX:0,css:{cursor:"default",background:"transparent",textalign:"left",width:"25%",height:"20%",border:"0px"},overlayCSS:{opacity:0.3}}):$.blockUI({message:'<table class="ErrorPageBoxTable" style="text-align: left; width: 500px;" cellspacing="0"><tr><td colspan="2"><table class="ErrorPageTitleTable" cellspacing="0"><tr><td><span class="ErrorPageMainTitle">'+
a+'</span><input type="button" class="CloseButton" onclick="javascript:$.unblockUI();return false;"/></td></tr></table></td></tr><tr><td class="'+h+'PageImageCell">&nbsp;</td><td><table class="ErrorPageMessageTable" cellspacing="0"><tr><td class="ErroPageMessage"><span class="VortalSpan ScrollingSpan">'+b+'</span></td></tr><tr><td class="AlignRight"><input type="button" class="MessageButton" onclick="javascript:$.unblockUI();return false;" value="Ok"/></td></tr></table></td></tr></table>',centerY:0,
centerX:0,css:{cursor:"default",background:"transparent",textalign:"left",height:"20%",border:"0px"},overlayCSS:{opacity:0.3}}):$.blockUI({message:'<table class="ErrorPageBoxTable" style="text-align: left; width: 500px;" cellspacing="0"><tr><td colspan="2"><table class="ErrorPageTitleTable" cellspacing="0"><tr><td><span class="ErrorPageMainTitle">'+a+'</span></td></tr></table></td></tr><tr><td class="'+h+'PageImageCell">&nbsp;</td><td><table class="ErrorPageMessageTable" cellspacing="0"><tr><td class="ErroPageMessage"><span class="VortalSpan ScrollingSpan">'+
b+'</span></td></tr><tr><td class="AlignRight"><input type="button" class="MessageButton" onclick="javascript:$.unblockUI();'+d+';return false;" value="'+e+'"/>&nbsp;<input type="button" class="MessageButton" onclick="javascript:$.unblockUI();'+f+';return false;" value="'+g+'"/></td></tr></table></td></tr></table>',centerY:0,centerX:0,css:{cursor:"default",background:"transparent",textalign:"left",height:"20%",border:"0px"},overlayCSS:{opacity:0.3}})}
function GoBackorClose(){1<window.history.length?window.history.back():window.close()}function MessageRedirect(a){window.location.replace(a)}function RedirectToUrl(a,b){b?window.location.replace(a):window.location.href=a}function POTWarningPageBlock(a){$.vortalBlockUI.unblockUI();$.blockUI({message:$("#"+a),centerY:0,centerX:0,css:{cursor:"default",background:"transparent",textalign:"left",width:"40%",height:"20%",border:"0px"},overlayCSS:{opacity:0.3}})}
function POTWarningPageUnblock(){$.unblockUI()}function setHidden(){$("#hdnMasterFileNameHidden").attr("value",$("#flMasterFile").attr("value"));$("#hdnCheckFileExists").attr("value",$("#flMasterFile").attr("value"))}function SubmitMyForm(){$("#btnUpload").click()}function ClickEvent(){$("#btnUpload").click()}
function SetVisibility(){"false"==$("#chkHasSignature_hdn").val().toLowerCase()?$("#trSignatureEmbebbedRow").hide(0):$("#trSignatureEmbebbedRow").show(0);"true"==$("#chkSignatureEmbebbed_hdn").val().toLowerCase()&&$("#chkSignatureEmbebbed").is(":visible")?$("#trSignatureFileRow").show(0):$("#trSignatureFileRow").hide(0)}
$(function(){$("#chkSignatureEmbebbed").is("*")&&$(".#chkHasSignature").is("*")&&$(".#flMasterFile").is("*")&&$(".#frmMainForm").is("*")&&($("#chkSignatureEmbebbed").click(SetVisibility),$("#chkHasSignature").click(SetVisibility),$("#flMasterFile").change(setHidden),$("#frmMainForm").iframePostForm({post:MyPostFunction,complete:MyCompletedFunction,iframeID:"iframeId"}))});function MyPostFunction(){}function MyCompletedFunction(a){}
function changeSpan2Input(a,b,c,d){void 0!=window.event&&(window.event.cancelBubble=!0);var e=$("#"+a);null==e[0].getAttribute("type")&&(d=$('<input type="text" contextvarid="'+d+'"/>'),d.attr("id",e[0].getAttribute("id")),d.attr("class",e[0].getAttribute("class")),d.val(e.html()),d.change(function(){updateViewModel("BusinessItemLineValues",b,"DictionaryBusinessItemLineValues",c,$.getVal(a))}),d.blur(function(){changeInput2Span(a)}),e.replaceWith(d),d.focus())}
function changeInput2Span(a){a=$("#"+a);var b=$("<span/>");b.html(a.val());b.attr("id",a[0].getAttribute("id"));b.attr("class",a[0].getAttribute("class"));a.replaceWith(b)}function makeInputEnabled(a,b,c){var d=$("#"+a+"_holder");if("none"==d.css("display")){var e=$("#"+a),f=$("#"+a+"_text");f.css("display","none");d.css("display","block");e.blur(function(){makeInputDisabled(a,b,c)});e.val(f.html());e.focus();setSelectionRange(e[0],0,0)}}
function setSelectionRange(a,b,c){a.setSelectionRange?(a.focus(),a.setSelectionRange(b,b)):a.createTextRange&&(a=a.createTextRange(),a.collapse(!0),a.moveEnd("character",c),a.moveStart("character",b),a.select())}function makeInputDisabled(a,b,c){var d=$("#"+a+"_holder"),e=$("#"+a+"_text");a=$("#"+a);e.html(applyMask(a.val(),b,c));d.css("display","none");e.css("display","block")}
function applyMask(a,b,c){c=Number(c);if(-1<a.indexOf(b)){var d=a.split(b);d[1].length>c&&(a=d[0]+b+d[1].substring(0,c))}return a}
function changesSpan2Drop(a,b,c,d,e){void 0!=window.event&&(window.event.cancelBubble=!0);e=$("#"+a);if(null==e[0].getAttribute("contextvarid")){d=$('<select contextvarid="'+d+'"/>');d.attr("id",e[0].getAttribute("id"));d.attr("class",e[0].getAttribute("class"));var f=e.html();d.change(function(){updateViewModel("BusinessItemLineValues",b,"DictionaryBusinessItemLineValues",c,$.getVal(a))});d.blur(function(){changeDrop2Span(a)});e.replaceWith(d);applySelectSharedDataSourceToObj(d,option);$(option).each(function(){$(this).text()==
f&&(f=$(this).val())});d.val(f);d.focus()}}function changeDrop2Span(a){var b=$("#"+a);a=jQuery("#"+a+" option:selected").text();var c=$("<span/>");b.val()!=a&&c.html(a);c.attr("id",b[0].getAttribute("id"));c.attr("class",b[0].getAttribute("class"));b.replaceWith(c)}
function verticalScroll(a){$(".opportunitiesWidgetTable").last().addClass("last");$("#"+a.id).each(function(){var b=0;$(this).find(".opportunitiesWidgetTable").each(function(){var c=$(this);b=0==b?$(a).height():b+c.height();c.css("top",b)})});for(var b=$("#"+a.id+" .opportunitiesWidgetTable").length,c=1;c<=b;c++)doScroll($("#"+a.id+" .opportunitiesWidgetTable:nth-child("+c+")"),a),stopScroll($("#"+a.id+" .opportunitiesWidgetTable:nth-child("+c+")"),a)}
function doScroll(a,b){var c=parseInt(a.css("top"));c<-$("#"+b.id).height()&&(c=a.closest("#"+b.id).find(".last"),c.removeClass("last"),a.addClass("last"),c.css("top")==a.css("top")?c=$("#"+b.id).height():(c=parseInt(c.css("top"))+c.height(),c<$("#"+b.id).height()&&(c=$("#"+b.id).height())),a.css("top",c));a.animate({top:parseInt(c)-a.height()},3E3,"linear",function(){doScroll($(this),b)})}
function stopScroll(a,b){a.hover(function(){$(".opportunitiesWidgetTable").stop()},function(){for(var a=$("#"+b.id+" .opportunitiesWidgetTable").length,d=1;d<=a;d++)doScroll($("#"+b.id+" .opportunitiesWidgetTable:nth-child("+d+")"),b)})}
function openMainMenuOption(a,b){$.browser.msie&&parseInt($.browser.version,10);if("block"!=$("#ItemMainMenuDiv"+b).css("display")){$(".MainMenuContextMenuContainer").css("display","none");$(".ItemMainMenuDiv").css("display","none");$(".MenuItemSelected").removeClass("MenuItemSelected");$("#ItemMainMenuDiv"+b).css("display","block");$("#quickPreview").css("display","none");$("#quickPreview").removeClass("QuickPreviewPointer");$("#IWantToContainer").find(".ContextMenuItemsContainer").removeClass("expCtxMenu").addClass("hiddenCtxMenu").css("display",
"none");$(".round_sb").parent().find("ul").css("display","none");var c=a||window.event,d=c.target||c.srcElement,d=$.browser.mozilla?c.target||c.srcElement:"undefined"===event.target?event.target:window.event.srcElement;$(d).closest(".MenuItem").addClass("MenuItemSelected");c=$("#ItemMainMenuDiv"+b).find(".MoreOptionsTable").find("#selectorAreaDiv");null!=c&&(c.css("height","100%"),c.find(".MoreOptionsSelectorItem").removeClass("MainMenuSelected").css("color","White"),$("#ItemMainMenuDiv"+b).find(".MoreOptionsTable").find("#contentAreaDiv").find(".MoreOptionsContentItem").css("display",
"none"),c.find("div:first").addClass("MainMenuSelected").css("color","#1A1A1A"),$("#ItemMainMenuDiv"+b).find(".MoreOptionsTable").find("#contentAreaDiv").find("div:first").css("display","block"),equalHeights(c,$("#ItemMainMenuDiv"+b).find(".MoreOptionsTable").find("#contentAreaDiv").find("div:first")))}else $(".ItemMainMenuDiv").css("display","none"),$(".MenuItemSelected").removeClass("MenuItemSelected")}
function equalHeights(a,b){var c;null!=a&&null!=b&&"string"==typeof a.css("height")&&"string"==typeof b.css("height")&&(parseInt(a.css("height").substring(0,a.css("height").indexOf("px")))>parseInt(b.css("height").substring(0,b.css("height").indexOf("px")))?a.css("height"):(c=b.css("height"),a.css("height",c)))}
function OpenSubMenu(a,b){$("#"+a).find("#selectorAreaDiv").css("height","100%");$("#"+a).find(".MoreOptionsContentItem").css("display","none");$("#"+a).find("#content"+b).css("display","block");$("#"+a).find(".MoreOptionsSelectorItem").removeClass("MainMenuSelected").css("color","White");$("#"+a).find("#selector"+b).addClass("MainMenuSelected").css("color","#1A1A1A");equalHeights($("#"+a).find("#selectorAreaDiv"),$("#"+a).find("#content"+b))}
$(".PageContainer").ready(function(){$(function(){if($.browser.msie&&7===parseInt($.browser.version,10)){var a=1E4;$("div").each(function(){$(this).css("zIndex",a);a-=1});$("#CaptionHelpImage").css("zIndex",9999);$(".MainMenuContextMenuContainer").css("zIndex",10002);$(".ContextMenuRightAligned").css("zIndex",10001);$("#divScrollbarOpportunityDossierListFT").css("z-index",10003);$("#divScrollbarBuyerDossierListFT").css("z-index",10003);$("#FolderScrollbarDiv").css("z-index",10003);$("#SecondScrollbarDiv").css("z-index",
10003)}});$(".MenuItemCell").each(function(){var a=$(this).width()+6,b=$(this).height(),c;140<a?(a=140,c=$(this).width()-20):c=$(this).width()-16;$(this).find(".MainMenuDivContainer").attr("style","width: "+a+"px; height: "+b+"px;");$(this).find(".MainMenuItemSpan").attr("style","width: "+c+"px;");$(this).find(".ContextMenu").attr("style","width: "+c+"px;")});$(".MenuItem").click(function(a){var b=a||window.event,c=b.target||b.srcElement,c=$.browser.mozilla?b.target||b.srcElement:"undefined"===a.target?
a.target:window.event.srcElement;if($(c).hasClass("MenuItem")||$(c).hasClass("MenuItemCell"))a.stopPropagation(),eval($(c).find(".MainMenuDivContainer").attr("onclick"))});equalHeights($("#optMoreOptionsId").find("#selectorAreaDiv"),$("#optMoreOptionsId").find("#contentAreaDiv").find("div:first"))});
$(document).mouseup(function(a){var b=$(".ItemMainMenuDiv"),c=$(".MainMenuContextMenuContainer");b.is(a.target)||0!==b.has(a.target).length||c.is(a.target)||0!==c.has(a.target).length||$(a.target).closest(".MainMenuBarContainer").hasClass("MainMenuBarContainer")||($(".MainMenuContextMenuContainer").css("display","none"),$(".MainMenuContextMenuContainer").addClass("hiddenCtxMenu"),$(".ItemMainMenuDiv").css("display","none"),$(".MenuItemSelected").removeClass("MenuItemSelected"));$.browser.msie?null!=
a.target.parentElement&&0>=a.target.parentElement.className.indexOf("companiesSelector")?$(".companiesSelector").parent().find("ul").css("display","none"):($("#quickPreview").css("display","none"),$("#quickPreview").removeClass("QuickPreviewPointer"),null!=a.target.parentElement&&0>=a.target.parentElement.className.indexOf("open")&&$(".companiesSelector").parent().find("ul").css("display","block"),b=$(".expCtxMenu"),void 0==b||b.hasClass("MainMenuContextMenuContainer")||HideContextMenu(b),$("#IWantToContainer").find(".ContextMenuItemsContainer").removeClass("expCtxMenu").addClass("hiddenCtxMenu").css("display",
"none")):null!=a.target.parentElement&&(a.target.parentElement.classList.contains("companiesSelector")?($("#quickPreview").css("display","none"),$("#quickPreview").removeClass("QuickPreviewPointer"),a.target.parentElement.classList.contains("open")||$(".companiesSelector").parent().find("ul").css("display","block"),b=$(".expCtxMenu"),void 0==b||b.hasClass("MainMenuContextMenuContainer")||HideContextMenu(b),$("#IWantToContainer").find(".ContextMenuItemsContainer").removeClass("expCtxMenu").addClass("hiddenCtxMenu").css("display",
"none")):$(".companiesSelector").parent().find("ul").css("display","none"));null!=a.target.parentElement&&a.target.parentElement.id!=openedQuickPreviewElemId&&(openedQuickPreviewElemId=void 0);$("#quickPreview").css("display","none");$("#quickPreview").removeClass("QuickPreviewPointer")});
function WallChangeTab(a){a=a||window.event;a=a.target||a.srcElement;$(a).parent().find(".VortalGradualPaginatorButtonSelected").addClass("VortalGradualPaginatorButtonUnselected");$(a).parent().find(".VortalGradualPaginatorButtonSelected").removeClass("VortalGradualPaginatorButtonSelected");$(a).removeClass("VortalGradualPaginatorButtonUnselected");$(a).addClass("VortalGradualPaginatorButtonSelected")}
function toggleElementSelection(a){a=$("#"+a);a.is(":checked")?a.removeAttr("checked"):a.attr("checked",!0)}function hideElementsStartingWith(a){$("fieldset[id^="+a+"] ").each(function(){var a=$(this);a.removeClass("Visible");a.addClass("Hidden");a.css("visibility","hidden");a.css("display","none")})}function showElementsStartingWith(a){$("fieldset[id^="+a+"] ").each(function(){var a=$(this);a.removeClass("Hidden");a.addClass("Visible");a.css("visibility","visible");a.css("display","block")})}
function checkElementsStartingWith(a){$("input:checkbox[id^="+a+"] ").each(function(){$(this).attr("checked","true")})}function uncheckElementsStartingWith(a){$("input:checkbox[id^="+a+"] ").each(function(){$(this).removeAttr("checked")})}
function calculateFileId(a,b){function c(a){a=new Uint8Array(a);for(var b=a.length,c="",d=0;d<b;d+=65535){var e=65535;d+65535>b&&(e=b-d);c+=String.fromCharCode.apply(null,a.subarray(d,d+e))}return c}function d(){g=p*m;h=g+m>=a.size?a.size:g+m;f.readAsArrayBuffer(k.call(a,g,h))}var e=CryptoJS.MD5(a.name),f=new FileReader,g,h,k=File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice,l=CryptoJS.algo.MD5.create(),m=512E3,n=Math.ceil(a.size/m),p=0;console.info(n);f.onload=function(a){a=
c(a.target.result);l.update(CryptoJS.enc.Latin1.parse(a));if(void 0==b){var f=void 0,g=void 0;void 0!=$("#fileId"+e)&&(g=$("#fileId"+e).parent().parent(),f=g.find(".readyProgress")[0].children[0])}++p<n?(void 0==b&&($(".start").each(function(){$(this).attr("disabled","disabled")}),void 0!=f&&(f.style.width=parseInt(p/n*100,10)+"%",g.find(".readyProgress")[0].style.display="block",g=g.find(".ready")[0],g.style.display="block",g.innerHTML=locale.fileupload.processing)),d()):(a=l.finalize()+e,$("#fileId"+
e).val(a.toUpperCase()),void 0==b?(void 0!=f&&(f.style.width="100%"),void 0!=f&&(g.find(".readyProgress")[0].style.display="none",g=g.find(".ready")[0],g.style.display="block",g.innerHTML=locale.fileupload.ready,$(".start").each(function(){$(this).removeAttr("disabled")}),f.style.width="0%")):b())};$(".start").each(function(){$(this).attr("disabled","disabled")});d()}function calculateHash(a){return CryptoJS.MD5(a.name)}
function resizeFlatTreeContainerForOverflow(a){a=$($("#"+a).find("div.FlatTree")[0]);if(null!=a&&0<a.length){a.addClass("DataSheetContentVisible");var b=parseFloat($(".NavigationBarColumn").css("width")),c=parseFloat($(".MainContentContainer .Separator").css("width"));a.css("width",parseFloat($(".HeaderContainer").css("width"))-b-c-100)}}
function resizeGridContainerForOverflow(a){a=$($("#"+a).find("div.GridContainer")[0]);if(null!=a&&0<a.length){a.addClass("DataSheetContentVisible");var b=parseFloat($(".NavigationBarColumn").css("width")),c=parseFloat($(".MainContentContainer .Separator").css("width"));a.css("width",parseFloat($(".HeaderContainer").css("width"))-b-c-60)}}function ChangeAdvancedSearchVisibility(a,b,c){b=$("#"+a).find("#"+b);$(b[0]).toggle();a=$("#"+a).find("#"+c);$(a[0]).toggle()}
function UpdateHiddenFieldValue(a,b,c){if(null==c)$("#"+a).val(""),$("#"+b).children().find("input[type=text]").each(function(b,c){""==$("#"+a).val()?$("#"+a).val($(c).val()):""!=$(c).val()&&0>$("#"+a).val().toLowerCase().indexOf($(c).val().toLowerCase())&&$("#"+a).val($("#"+a).val()+"|"+$(c).val())});else for(c=parseInt(c),i=0;i<c;i++)$("#"+a+"_"+i).val(""),$("#"+b+"_"+i).children().find("input[type=text]").each(function(b,c){""==$("#"+a+"_"+i).val()?$("#"+a+"_"+i).val($(c).val()):""!=$(c).val()&&
0>$("#"+a+"_"+i).val().toLowerCase().indexOf($(c).val().toLowerCase())&&$("#"+a+"_"+i).val($("#"+a+"_"+i).val()+"|"+$(c).val())})}
function AddElement(a,b,c,d,e,f){var g=parseInt(a),h="",k=0;null!=f&&(k=parseInt(f),h="_"+(k-1));a=$("#"+c+h+"_"+(g-1));var l=a.clone();$("input",l).attr("value","");l.attr("id",a.attr("id").split("_")[0]+h+"_"+g);f=$("input",l).attr("id");$("input",l).attr("name");$("input",l).attr("id",f.split("_")[0]+h+"_"+g);var m="";$(l).find("img").each(function(a,f){m=$(f).attr("id");$(f).attr("id",m.split("_")[0]+h+"_"+g);m.split("_")[0].toLowerCase()==d.toLowerCase()&&(""==h?$(f).attr("onclick","AddElement('"+
(g+1)+"', '"+b+"','"+c+"','"+d+"','"+e+"')"):$(f).attr("onclick","AddElement('"+(g+1)+"', '"+b+"','"+c+"','"+d+"','"+e+"','"+k+"')"));m.split("_")[0].toLowerCase()==e.toLowerCase()&&(""==h?$(f).attr("onclick","DeleteElement('"+(g+1)+"', '"+b+"','"+c+"','"+d+"','"+e+"')"):$(f).attr("onclick","DeleteElement('"+(g+1)+"', '"+b+"','"+c+"','"+d+"','"+e+"','"+k+"')"))});$(l).find("script").each(function(a,c){""==h?$(c).text($(c).text().replace(b+"_"+(g-1),b+"_"+g)):$(c).text($(c).text().replace(b+"_"+(k-
1)+"_"+(g-1),b+"_"+(k-1)+"_"+g));$("input",l).attr("onfocus",$(c).text())});var n="";$(a).find("img").each(function(a,b){n=$(b).attr("id");n.split("_")[0].toLowerCase()==d.toLowerCase()&&$(b).hide();n.split("_")[0].toLowerCase()==e.toLowerCase()&&$(b).show()});l.appendTo($(a.parent()))}function DeleteElement(a,b,c,d,e,f){a=parseInt(a);b="";null!=f&&(b="_"+(parseInt(f)-1));c=$("#"+c+b+"_"+(a-1));$(c).remove()}
function validateMandatory(a,b,c){if(null!=a&&""!=a&&null!=$("#"+a).val()&&""!=$("#"+a).val())return setValidInput(b);try{if(a==FirstAndLastNameFieldId)return setInvalidInput(b,7,3)}catch(d){}return setInvalidInput(b,c,typeOfErrorMessageMandatory)}function validateEmail(a,b,c){return validateByRegexExpression(a,/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,b,c)}
function validatePhoneNumber(a,b,c){var d=/^[0-9,\-,\(,\),\s]{8,15}$/;if(0!=$("#"+SecurityMobilePhoneCallingCodeId+" option:selected").index())return validateByRegexExpression(a,d,b,c)}
function validatePassword(a,b,c){(a=validateByRegexExpression(a,/^((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&\/=?_.,:;\\-])|(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%&\/=?_.,:;\\-])|(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%&\/=?_.,:;\\-])).{8,}$/,b,c))&&(a=validateMatch(PasswordFieldId,ConfirmPasswordFieldId,b,validationErrorMessages[4].forValidationType));return a}
function validateMatch(a,b,c,d){return""==$("#"+PasswordFieldId).val().trim()&&""==$("#"+ConfirmPasswordFieldId).val().trim()?setInvalidInput(c,6,3):""==$("#"+PasswordFieldId).val().trim()?setInvalidInput(c,3,0):""==$("#"+ConfirmPasswordFieldId).val().trim()?setInvalidInput(c,5,3):null!=a&&null!=b&&""!=a&&""!=b?null!=$("#"+a).val()&&""!=$("#"+a).val()&&null!=$("#"+b).val()&&""!=$("#"+b).val()?$("#"+a).val()==$("#"+b).val()?setValidInput(c):setInvalidInput(c,d,typeOfErrorMessageInvalid):setInvalidInput(c,
d,typeOfErrorMessageInvalid):setInvalidInput(c,d,typeOfErrorMessageMandatory)}function validateByRegexExpression(a,b,c,d){if(null!=a&&""!=a&&null!=b&&""!=b&&null!=$("#"+a).val()&&""!=$("#"+a).val()){var e=$("#"+a).val();return b.test(e)?a==PasswordFieldId&&""==$("#"+ConfirmPasswordFieldId).val().trim()?void 0:setValidInput(c):setInvalidInput(c,d,typeOfErrorMessageInvalid)}return setInvalidInput(c,d,typeOfErrorMessageMandatory)}var switchClassAnimationSpeed=350,switchClassAnimationEasingSpeed="easeInOutQuad";
function setValidInput(a){var b=document.getElementById(a+"_validationDiv");null!=b?b.className="validInput":(b=document.createElement("span"),b.textContent=" ",b.id=a+"_validationDiv",b.className="validInput",$("#"+a).append(b));validationsCounter("Valid");previousErrorMessage=document.getElementById(a+"_errorMessage");null!=previousErrorMessage&&previousErrorMessage.parentNode.removeChild(previousErrorMessage);$("#"+a).find("input, select").removeClass("IWantToJoin_InvalidInput");$("#"+a).switchClass("IWantToJoin_InvalidBox",
"IWantToJoin_ValidBox",switchClassAnimationSpeed,switchClassAnimationEasingSpeed);if("divContainer_Country"==a||"divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country"==a)$("#divContainer_Country, #divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country").find("br").remove(),$("#divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country_validationDiv").css("margin-left","0px");return!0}
function setInvalidInput(a,b,c){var d=document.getElementById(a+"_validationDiv");$("#"+a).find("input, select").addClass("IWantToJoin_InvalidInput");$("#"+a).switchClass("IWantToJoin_ValidBox","IWantToJoin_InvalidBox",switchClassAnimationSpeed,switchClassAnimationEasingSpeed,function(){if(null!=d)d.className="invalidInput IWantToJoin_InvalidMessage";else{var e=document.createElement("span");e.id=a+"_validationDiv";e.className="invalidInput IWantToJoin_InvalidMessage";$("#"+a).append(e)}if("divContainer_Country"==
a||"divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country"==a)0==$("#divContainer_Country, #divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country").find("br").length&&$("#divContainer_Country_validationDiv, #divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country_validationDiv").before("<br/>"),$("#divSearchCompanyContainer_incSearchCompanyIncludedivContainer_Country_validationDiv").css("margin-left","21%");validationsCounter("Invalid");e=getErrorMessage(b,
c,a);displayErrorMessage(a,e)});return!1}function activateContextualErrorMessages(a){for(var b in a){var c=document.getElementById(a[b].key);null!=c&&(parentContainer=c.parentNode,$("#"+parentContainer.id).find("input, select").addClass("IWantToJoin_InvalidInput"),$("#"+parentContainer.id).switchClass("IWantToJoin_ValidBox","IWantToJoin_InvalidBox",switchClassAnimationSpeed,switchClassAnimationEasingSpeed),displayErrorMessage(parentContainer.id,a[b].value))}}
function cleanContextualErrorMessage(a){for(var b in a){var c=document.getElementById(a[b]);null!=c&&setValidInput(c.parentNode.id)}}
function getErrorMessage(a,b,c){var d=null,e;for(e in validationErrorMessages)validationErrorMessages[e].forValidationType==a&&validationErrorMessages[e].type==b&&(d=validationErrorMessages[e].message);null==d&&(d=validationErrorMessages[0].message,e=0);if(b==typeOfErrorMessageMandatory||0==e)a=document.getElementById(c).getElementsByTagName("label")[0],d=$(a).text().slice(0,-1)+" "+d;return d}
function displayErrorMessage(a,b){var c=$("#"+a+"_errorMessage");appendOrShowErrorIcon(a);0==c.length?(c=$('<span id="'+a+'_errorMessage" class="Red_1">'+b+"</span>"),$("#"+a).append(c)):c.text(b)}function appendOrShowErrorIcon(a){var b=document.getElementById(a+"_validationDiv");null!=b?b.className="invalidInput IWantToJoin_InvalidMessage":(b=document.createElement("span"),b.id=a+"_validationDiv",b.className="invalidInput IWantToJoin_InvalidMessage",$("#"+a).append(b))}
function validationsCounter(a){totalValidFields=$(".validInput").length;null!=fieldsUnderValidation&&0<fieldsUnderValidation&&null!=totalValidFields&&null!=submitButtonId&&canSubmit()}var submitButtonOnClickAction=null;
function canSubmit(){var a=document.getElementById(submitButtonId);null!=a&&(totalValidFields>=fieldsUnderValidation?($(a).removeClass("arrowBlueButton-right_inactive"),null!=submitButtonOnClickAction&&$(a).attr("onclick",submitButtonOnClickAction)):($(a).addClass("arrowBlueButton-right_inactive"),null==submitButtonOnClickAction&&(submitButtonOnClickAction=$(a).attr("onclick")),$(a).attr("onclick","")))}
function RemoveInvalidCallingCodes(a){a=$("#"+a).find("option");for(var b=0,b=0;b<a.length;b++)-1!=$(a[b]).val().indexOf("?")&&$(a[b]).remove();for(b=0;b<a.length-1;)$(a[b]).val()==$(a[b+1]).val()&&$(a[b]).remove(),b++}function remove_dups(a){var b=[],c=0;a:for(;c<a.length;c++){for(var d=0;d<b.length;d++)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b}
function FixOwnSecurityQuestionMessage(){try{var a=$("#"+SecurityOpsSelectID).find("option").length;-1==$($("#"+SecurityOpsSelectID).find("option")[a-1]).html().indexOf(":")&&$($("#"+SecurityOpsSelectID).find("option")[a-1]).html($($("#"+SecurityOpsSelectID).find("option")[a-1]).html()+":")}catch(b){}}
function limitInputToNumbers(a){$("#"+a).keypress(function(a){var c=a.keyCode?a.keyCode:a.which,d=a.charCode?a.charCode:-1;47<c&&58>c||45==c||40==c||41==c||32==c||127==c||8==c||37==c||39==c||46==c&&46!=d||a.preventDefault()})}function changeElementValue(a,b){null!=a&&null!=b&&(document.getElementById(a).value=b)}"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});
if("undefined"===typeof console||"undefined"===typeof console.log)console={};function UserRegistrationFormResizeFix(){UserRegistrationFormResizeFixHandler();$(window).resize(function(){UserRegistrationFormResizeFixHandler()})}
function UserRegistrationFormResizeFixHandler(){try{var a=$("input.Field")[0],b=parseInt($(a).css("width"));$("select.Width60").css("width",b+12);0<$("#pwdContainer_ConfirmPassword_Field").length&&$("#lblContainer_ConfirmPassword_Label").css("width",b-parseInt($("#pwdContainer_Password_Field").css("width"))-parseInt($("#pwdContainer_ConfirmPassword_Field").css("width"))-35);0<$("#pmContainer_PasswordMeter_ValueProgressBar").length&&$("#pmContainer_PasswordMeter_ValueProgressBar").css("width",b+12-
2)}catch(c){console.log("Error on UserRegistrationFormResizeFix: "+c)}}function CompanyManualMembershipRequestResizeFix(){CompanyManualMembershipRequestResizeFixHandler();$(window).resize(function(){CompanyManualMembershipRequestResizeFixHandler()})}function CompanyManualMembershipRequestResizeFixHandler(){try{var a=$("input.Field")[0],b=parseInt($(a).css("width"));$("select.Width20").css("width",b+12)}catch(c){console.log("Error on CompanyManualMembershipRequestResizeFixHandler: "+c)}}
function IsBrowserOnWindows(){return-1!=navigator.platform.toLowerCase().indexOf("win32")}function IsBrowserOnLinux(){return-1!=navigator.platform.toLowerCase().indexOf("linux")}function IsBrowserIE9(){return IsBrowserOnWindows()&&0==$.browser.version.indexOf("9.0")}
function ProcedureEditFormResizeFix(){try{1025>screen.width&&IsBrowserOnLinux()&&0<$("div.GridContainer").length&&($("div.GridContainer").find("*").css("padding-left","5px"),$("div.GridContainer").find("*").css("padding-right","0px"),console.log("ProcedureEditFormResizeFix Applied"))}catch(a){console.log("Error on ProcedureEditFormResizeFix: "+a)}}
function OpportunityWorkAreaButtonsFix(){try{IsBrowserIE9()&&($(".ContextMenuButton_4, .ContextMenuButtonNoContent_4").css("width","100%"),console.log("OpportunityWorkAreaButtonsFix Applied"))}catch(a){console.log("Error on OpportunityWorkAreaButtonsFix: "+a)}}function LotsTableSizeFix(a){try{$("#"+a).find(".FltCheckTd, .FltRootIdTd, .FltRootLeafTd, .FltHeaderContent").css("width","1%"),$("#"+a).find(".FltContextTd").css("width","10%")}catch(b){console.log("Error on LotsTableSizeFix: "+b)}}
function ContractNoticeManagementTableResizeFix(){$(".FormContainer .VortalGrid th").css("white-space","normal");$(".FormContainer .VortalGrid th").last().css("width","5%");console.log("ContractNoticeManagementTableResizeFixOnResize Applied")}
var FlatTreeFixedHeader={_rootSelector:"#frmMainForm",_root:null,_instances:[],_detecting:!1,_create:function(a){this._setup=function(a){this._node=$(a);this._clone=this._node.clone();this._clone.attr("id",this._node.attr("id")+"_Clone");this._clone.css({position:"fixed","pointer-events":"none",visibility:"hidden"});this._clone.addClass("FlatTreeFixedHeader");this._node.parent().prepend(this._clone);this.updateWidth();var c=this;$(window).scroll(function(){c.onScroll()});FlatTreeFixedHeader._root.scroll(function(){c.onScroll()});
$(window).resize(function(){c.updateWidth()})};this._getLastRow=function(){var a=this._node.nextAll(".FltTr.QuestionnaireLine.QuestionLine:visible");return 0==a.length?this._node.parent().children(":visible:last"):a.prevAll("tr.FltTr.PriceListLine:first:visible")};this.onScroll=function(){if(!1!=this._node.is(":visible")){var a=$(window).scrollTop(),c=this._node.offset().top-FlatTreeFixedHeader._root.offset().top,d=this._getLastRow().offset().top-FlatTreeFixedHeader._root.offset().top;a>c&&a<d?(this._clone.css({visibility:"visible",
top:FlatTreeFixedHeader._root.offset().top,left:this._node.offset().left,clip:"rect(auto, "+(FlatTreeFixedHeader._root.scrollLeft()+FlatTreeFixedHeader._root.width())+"px, auto, "+FlatTreeFixedHeader._root.scrollLeft()+"px)"}),"visible"==FlatTreeFixedHeader._root.css("overflow")?this._clone.css({left:this._node.offset().left-$(window).scrollLeft(),clip:"none"}):this._clone.css({left:this._node.offset().left,clip:"rect(auto, "+(FlatTreeFixedHeader._root.scrollLeft()+FlatTreeFixedHeader._root.width())+
"px, auto, "+FlatTreeFixedHeader._root.scrollLeft()+"px)"})):this._clone.css({visibility:"hidden"})}};this.updateWidth=function(){var a=this._node,c=this._clone;c.width(a.width());var d=a.children("td:visible");c.children("td:visible").each(function(a){$(this).width(d.eq(a).width())});this.onScroll()};this._setup(a)},_getInstance:function(a){for(var b=FlatTreeFixedHeader._instances.length,c=0;c<b;c++){var d=FlatTreeFixedHeader._instances[c];if(d._node[0]==a)return d}return null},_setup:function(a){var b=
FlatTreeFixedHeader._getInstance(a);if(null!=b)return b;b=new FlatTreeFixedHeader._create(a);FlatTreeFixedHeader._instances.push(b);return b},_onDetectTimeout:function(){FlatTreeFixedHeader._detecting=!1;if(null==FlatTreeFixedHeader._root&&(FlatTreeFixedHeader._root=$(FlatTreeFixedHeader._rootSelector),0==FlatTreeFixedHeader._root.length)){console.log("#### Couldn't find scrollable area '"+FlatTreeFixedHeader._rootSelector+"'");FlatTreeFixedHeader._root=null;return}$(".FltTr.PriceListLine.Header:not(.FlatTreeFixedHeader)").each(function(a,
b){FlatTreeFixedHeader._setup(b)})},detect:function(){FlatTreeFixedHeader._detecting||(setTimeout(FlatTreeFixedHeader._onDetectTimeout,100),FlatTreeFixedHeader._detecting=!0)}},FlatTreeMapFixedColumns={_container:null,_detecting:!1,_updating:!1,_listening:!1,_element:null,_enabled:!0,_setOriginalColumnsVisibility:function(a){return this._element.find(".FltHeaderContent, .FltCheckTd, .FltRootIdTd, .FltExpTd, .FltRootContentTd, .FltRootLeafTd, .FltPaginatorSpacerTd, .FltPaginatorTd").add(this._element.find(".FtlExpandCollapseAll").parent()).css({visibility:a?
"visible":"hidden"})},_updatePosition:function(){FlatTreeMapFixedColumns._updating=!1;$(".FltMapFixedCheckBox").css({top:15-$(window).scrollTop()});!1!=this._enabled&&this._container.css({top:this._element.position().top-$(window).scrollTop()})},_clear:function(){null!=this._container&&(this._container.remove(),this._container=null,this._setOriginalColumnsVisibility(!0))},_getFixedHeadersWidth:function(a){a.find(".FltHeaderContent:first");a=a.find(".FltRootContentTd");return a.position().left+a.width()},
_setup:function(){if(!1==this._listening){this._listening=!0;var a=this;$(window).scroll(function(){a._updatePosition()});$(window).resize(function(){a._updateWidth()})}!1!=this._enabled&&(this._detecting=!1,this._clear(),this._element=$(".Flt:first"),0!=this._element.length&&(this._container=$('<div class="FixedContainer"/>'),this._container.css({position:"fixed",overflow:"hidden","z-index":1,width:this._getFixedHeadersWidth(this._element)+"px",height:this._element.height()+"px",left:this._element.offset().left}),
this._container.append(this._element.clone()),this._element.parent().append(this._container),this._setOriginalColumnsVisibility(!1),this._updatePosition()))},detect:function(){if(!1!=this._enabled&&!FlatTreeMapFixedColumns._detecting){FlatTreeMapFixedColumns._detecting=!0;var a=FlatTreeMapFixedColumns;setTimeout(function(){a._setup()},50)}},updatePosition:function(){if(!1!=this._enabled&&!FlatTreeMapFixedColumns._updating){FlatTreeMapFixedColumns._updating=!0;var a=FlatTreeMapFixedColumns;setTimeout(function(){a._updatePosition()},
35)}},setEnabled:function(a){a!=this._enabled&&((this._enabled=a)?this._setup():this._clear())},toggleEnabled:function(){this.setEnabled(!this._enabled)}};
