function validateStateAgainstCountry(a,b,c){var d=!0;a&&b&&c&&(d=a+","+b==c);return d} function getValidationErrorMessageForStateProvinceCountryCombination(a,b,c,d){var e=!1,f="";"0"==c&&(e=!0,f="Please enter your Country information.");""!=a&&""!=b&&(e=!0,f="Cannot enter both state and province");if(!e&&(""!=b||""==a)&&("1"==c||"2"==c))e=!0,f="Please select a state from the states dropdown";!e&&!validateStateAgainstCountry(a,c,d)&&(f="Selected state does not belong to the selected country");return f} function getStateCodeFromStateCountryCombination(a){var b="";a&&(b=(""+a).substr(0,(""+a).indexOf(",")));return b}function getMinPasswordLength(){return 4}function getMinLoginLength(){return 4}function getMaxPasswordLength(){return 50}function getMaxLoginLength(){return 100}function isAlphaAndDigitString(a){var b=!0;for(i=0;i<a.length;i++){ch=a.charAt(i);for(j=0;72>j&&!(ch=='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@%*()#"'.charAt(j));j++);if(72==j){b=!1;break}}return b} function isDigitString(a){var b=!0;for(i=0;i<a.length;i++){ch=a.charAt(i);for(j=0;11>j&&!(ch=="0123456789.".charAt(j));j++);if(11==j){b=!1;break}}return b}function isStringValidForLogin(a){var b=!0;for(i=0;i<a.length;i++){ch=a.charAt(i);for(j=0;12>j;j++){if(ch=='%*/()_+=,;#"'.charAt(j)){b=!1;break}if(!b)break}}return b} function getCleanKeywords(a){var b=a,b=(" "+a).replace(/(^ *)|( *$)/g,""),b=b.replace(/( +)/g," ");-1==b.toLowerCase().indexOf(" and ")&&-1==b.toLowerCase().indexOf(" or ")&&-1==b.toLowerCase().indexOf(" near ")&&(-1==b.indexOf('"')?b=b.replace(/ /g," and "):(re=/(".*" )/g,b=b.replace(re,"$1and ")));return b} function validateDeleteItem(a){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you want to delete the selected item?"))self.document.FormDeleteItem.action=a,self.document.FormDeleteItem.submit()}function validatePlaceOrder(a){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you would like to place this order?"))self.document.FormDeleteItem.action=a,self.document.FormDeleteItem.submit()} function validateCloneJob(a){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you would like to clone this job?"))self.document.FormDeleteItem.action=a,self.document.FormDeleteItem.submit()} function validateAndSubmitBulkAction(){var a=!1,b=!1,c="",d=!1,e="";with(document.FormBulk){switch(BulkOperationType.options[BulkOperationType.selectedIndex].value){case "DeleteSelected":b=!0;c="delete";d=!1;break;case "DeleteFilter":b=!1;c="delete";d=!1;break;case "DisableSelected":b=!0;c="disable";d=!1;break;case "DisableFilter":b=!1;c="disable";d=!1;break;case "EnableSelected":b=!0;c="enable";d=!1;break;case "EnableFilter":b=!1;c="enable";d=!1;break;case "ExportSelected":b=!0;c="export";d=!0;break; case "ExportFilter":b=!1;c="export";d=!0;break;case "RefreshSelected":b=!0;c="refresh";d=!1;break;case "RefreshFilter":b=!1,c="refresh",d=!1}if(b){if(0<elements.length)for(b=0;b<elements.length;b++)if("checkbox"==elements[b].type&&elements[b].checked){a=!0;break}if(!a)return alert("Please select at least one item."),!1;confirm("Are you sure you want to "+c+" the selected items?")&&(d&&(target="NewWindow"),submit())}else confirm("Are you sure you want to "+c+" all items that\nqualify the filter condition?"+ ("\n\nNOTE: Specifying no filter will "+c+" all items. ")+"\n\nWARNING: Depending on your filter condition \nthis operation can take a few minutes.")&&(d&&(target="NewWindow"),submit())}} function submitBulkAction(){var a=!1,b="",c="",c=!1,d=document.getElementById("FormBulk"),e=document.getElementById("BulkOperationType");with(d){switch(e.options[e.selectedIndex].value){case "DeleteSelected":a=!0;b="delete";break;case "DeleteFilter":a=!1;b="delete";break;case "DisableSelected":a=!0;b="disable";break;case "DisableFilter":a=!1;b="disable";break;case "EnableSelected":a=!0;b="enable";break;case "EnableFilter":a=!1;b="enable";break;case "ExportSelected":a=!0;b="export";break;case "ExportFilter":a= !1;b="export";break;case "RefreshSelected":a=!0;b="refresh";break;case "RefreshFilter":a=!1;b="refresh";break;case "ApplySelected":a=!1,c=!0}if(a){if(0==getNumberOfSelectedCheckboxes())return validationAlert("BulkOperationType","Please select at least one item.","bulkValidation");pageDialog.message="Are you sure you want to "+b+" the selected items?";pageDialog.title="Confirm "+b+" operation";pageDialog.onOk=function(){document.getElementById("FormBulk").submit()};pageDialog.onCancel=function(){}; pageDialog.modal=!0;pageDialog.show()}else if(c){if(0==getNumberOfSelectedCheckboxes())return validationAlert("BulkOperationType","Please select at least one item.","bulkValidation");document.getElementById("FormBulk").submit()}else pageDialog.message="Are you sure you want to "+b+" all items that</br>qualify the filter condition?"+("</br></br>NOTE: Specifying no filter will "+b+" all items. ")+"</br></br>WARNING: Depending on your filter condition </br>this operation can take a few minutes.",pageDialog.title= "Confirm "+b+" operation",pageDialog.onOk=function(){document.getElementById("FormBulk").submit()},pageDialog.onCancel=function(){},pageDialog.modal=!0,pageDialog.show()}}function validatePublishCompanyProfile(a,b){var c="",c=b?"un-publish":"publish";if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you want to "+c+" the selected company profile?"))self.document.FormPublish.action=a,self.document.FormPublish.submit()} function ConfirmJobSlotStatusChange(a,b){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you want to "+(""+b).toLowerCase()+" job slot?"))self.document.FormDeleteItem.action=a,self.document.FormDeleteItem.submit()}function validateEmail(a){a=new String(a);a=a.replace(/( +)/g,"*");return-1!=a.indexOf("@")&&-1!=a.indexOf(".")&&-1==a.indexOf("*")} function validateUrl(a){return-1!=a.indexOf(".")&&(0==a.toLowerCase().indexOf("http://")||0==a.toLowerCase().indexOf("https://"))&&-1==a.indexOf(" ")}function validateExtendAgentExpirationDate(a){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you want to extend the selected agent?"))self.document.FormExtendExpirationDate.action=a,self.document.FormExtendExpirationDate.submit()} function validateExpiredExpirationDate(a){if(!a||""==a)alert("URL for redirect is not found");else if(confirm("Are you sure you want to deactivate the selected agent?"))self.document.FormExtendExpirationDate.action=a,self.document.FormExtendExpirationDate.submit()}function canDeleteCompanyProfile(){return confirm("One or more jobs are attached to this company profile.\nThose jobs will be detached from this profile once deleted. \nDo you wish to proceed?")} function canBulkDeleteCompanyProfiles(a){var b="",b=a?"Jobs may be attached to one or more of the company profiles that qualify the filter. \nThose jobs will be detached from this profile once deleted. \nDo you wish to proceed?\n\nNOTE: This action can delete all company profiles depending on your filter.":"Jobs may be attached to one or more of the selected company profiles. \nThose jobs will be detached from this profile once deleted. \nDo you wish to proceed?";return confirm(b)} function validateBulkActionCompanyProfiles(){var a="",b=!1;with(document.FormBulk)if(a=BulkOperationType.options[BulkOperationType.selectedIndex].value,"DeleteSelected"==a||"DeleteFilter"==a){if("DeleteSelected"==a){if(0<elements.length)for(var c=0;c<elements.length;c++)if("checkbox"==elements[c].type&&elements[c].checked){b=!0;break}if(!b)return alert("Please select at least one item."),!1}canBulkDeleteCompanyProfiles("DeleteFilter"==a)&&submit()}else validateAndSubmitBulkAction()} function validateBulkActionEmployerInboxItems(){var a="",b=!1,c="",a=!1,d="";with(document.FormBulk)if(d=document.FormBulk.target,a=BulkOperationType.options[BulkOperationType.selectedIndex].value,"DeleteSelectedItems"==a||"DeleteSelectedReferences"==a||"ContactSelected"==a){c="DeleteSelectedReferences"==a?"blkInboxItemReferenceID":"blkInboxItemID";if(0<elements.length)for(var e=0;e<elements.length;e++)if("checkbox"==elements[e].type&&elements[e].name==c&&elements[e].checked){b=!0;break}if(b)"ContactSelected"== a?(PopupViewWindow("","contactJobSeekers","550","500"),document.FormBulk.target="contactJobSeekers",a=!0):a=confirm("Are you sure you want to delete the selected "+("DeleteSelectedItems"==a?"items":"references")+"?"),a&&(submit(),target=d);else return"DeleteSelectedReferences"==a?alert("Please select at least one related job."):alert("Please select at least one item."),!1}else validateAndSubmitBulkAction()}var dFilterStep; function dFilterStrip(a,b){b=replace(b,"#","");for(dFilterStep=0;dFilterStep<b.length++;dFilterStep++)a=replace(a,b.substring(dFilterStep,dFilterStep+1),"");return a}function dFilterMax(a){dFilterTemp=a;for(dFilterStep=0;dFilterStep<a.length+1;dFilterStep++)"#"!=a.charAt(dFilterStep)&&(dFilterTemp=replace(dFilterTemp,a.charAt(dFilterStep),""));return dFilterTemp.length} function dFilter(a,b,c){dFilterNum=dFilterStrip(b.value,c);if(9==a)return!0;8==a&&0!=dFilterNum.length?dFilterNum=dFilterNum.substring(0,dFilterNum.length-1):47<a&&58>a&&dFilterNum.length<dFilterMax(c)?dFilterNum+=String.fromCharCode(a):95<a&&106>a&&dFilterNum.length<dFilterMax(c)&&(dFilterNum+=getnumfromnumpad(a));a="";for(dFilterStep=0;dFilterStep<c.length;dFilterStep++)"#"==c.charAt(dFilterStep)?0!=dFilterNum.length?(a+=dFilterNum.charAt(0),dFilterNum=dFilterNum.substring(1,dFilterNum.length)): a+="":"#"!=c.charAt(dFilterStep)&&(a+=c.charAt(dFilterStep));b.value=a;return!1}function getnumfromnumpad(a){return a-96}function replace(a,b,c){var d=a.length,e=b.length;if(0==d||0==e)return a;var f=a.indexOf(b);if(!f&&b!=a.substring(0,e))return a;if(-1==f)return a;var g=a.substring(0,f)+c;f+e<d&&(g+=replace(a.substring(f+e,d),b,c));return g} function validateUploadedResumeExt(a){var b=new String(a),c=b.lastIndexOf(".",b.length);if(-1==c)return!1;a=new String(".pdf.doc.docx.rtf.txt.htm.html");b=b.substr(c,b.length-c).toLocaleLowerCase();return 0<=a.indexOf(b)}function validateUploadedImageExt(a){var b=new String(a),c=b.lastIndexOf(".",b.length);if(-1==c)return!1;a=new String(".gif.jpg.jpeg.pjpeg.png.x-png");b=b.substr(c,b.length-c).toLocaleLowerCase();return 0<=a.indexOf(b)} function isValidDate(a,b){var c=null,d=0,e=0,f=0;"string"!=typeof b&&(b="mm/dd/yyyy");b=(""+b).toLowerCase();switch(b){case "mm/dd/yyyy":c=/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})$/;if(null!=(""+a).match(c))d=RegExp.$1,e=RegExp.$2,f=RegExp.$3;break;case "mm/dd/yy":c=/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})$/;if(null!=(""+a).match(c))d=RegExp.$1,e=RegExp.$2,f=RegExp.$3;break;case "dd/mm/yyyy":c=/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})$/;if(null!=(""+a).match(c))e=RegExp.$1,d=RegExp.$2,f=RegExp.$3;break; case "dd/mm/yy":c=/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})$/;if(null!=(""+a).match(c))e=RegExp.$1,d=RegExp.$2,f=RegExp.$3;break;default:if(c=/^(\d{1,2})[\/|\-](\d{1,2})[\/|\-](\d{4})$/,null!=(""+a).match(c))d=RegExp.$1,e=RegExp.$2,f=RegExp.$3}if(!c.test(a))return!1;c=getDaysInMonth(d,f);return 1>d||12<d||1>e||e>c||0>f?!1:!0}function DateAdd(a,b,c){a=MsInIntervalType(a)*b;return new Date(c.valueOf()+a)} function MsInIntervalType(a){switch(a){case "s":return 1E3;case "m":return 6E4;case "h":return 36E5;case "d":return 864E5;case "w":return 6048E5}return 1}function getValidPayRate(a){a=(new String(a)).replace(/\s/gim,"");a=a.replace(",","");a=a.replace(/[^\d\.?]/gim,"");a=Math.round(a);return isNaN(a)||0>a?0:a} function validateFileExtention(a,b){var c=new String(a),d=new String(b),e=c.lastIndexOf(".",c.length);if(-1==e)return!1;if(""==d)return!1;c=c.substr(e,c.length-e).toLocaleLowerCase();return 0<=d.indexOf(c)} function validationAlertForTinyMCE(a,b,c){var d=tinyMCE.getInstanceById(a);if(null==d)return!1;c=document.getElementById(null==c?"validationMessage":c);if(null==c)return!1;c.innerHTML=b;c.className="validationMessage";c.style.visibility="visible";c.style.display="block";c.scrollIntoView(!1);d.getBody().style.border="thin double #FF6600";d.onKeyUp.add(function(){d.getBody().style.border="none"});tinyMCE.execCommand("mceFocus",!1,a);return!1} function getMSOValidationMessageForTinyMCE(){var a;return"Pasted text contains hidden formatting characters that affect text appearance when being viewed.<br/>Please follow these steps to ensure text appears correctly formatted:<ul><li>Be sure to copy and save any text currently in the field so you do not lose your changes, then delete all text from the field.</li><li>From the tool bar, press either the Paste from Text (<img src='/ClientScripts/tiny_mce/plugins/paste/images/pastetext.gif' width='20' height='20' alt='Paste as Plain Text' title='Paste as Plain Text'/>) or Paste from Word (<img src='/ClientScripts/tiny_mce/plugins/paste/images/pasteword.gif' width='20' height='20' alt='Paste from Word' title='Paste from Word'/>) buttons to open a separate window and re-paste your text.</li></ul>"} function textHasVideoHtmlTags(a){if(""==Trim(a))return!1;a=new String(a);return/<object.*?>.*?<embed.*?>.*?<\/embed>.*?<\/object>/im.test(a)}function jsonResponseHasError(a){var b=!1;try{void 0!=a.Response.Error&&(b=!0)}catch(c){b=!1}return b}function IsValidEmailSyntax(a){return 0==(new String(a)).replace(/\s/,"").length?!1:-1!=a.search(/\w+((-\w+)|(\.\w+)|(\_\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,5}/gi)} function isValidTime(a){var b=!1;if(!/^\d{1,2}[:]\d{1,2}([:]\d{2})?( {0,1}[aApP][mM]?)?$/.test(a))return!1;-1!=a.toLowerCase().indexOf("p")&&(b=!0);-1!=a.toLowerCase().indexOf("a")&&(b=!0);a=a.split(":");return 0>parseFloat(a[0])||23<parseFloat(a[0])?!1:b&&(1>parseFloat(a[0])||12<parseFloat(a[0]))?!1:0>parseFloat(a[1])||59<parseFloat(a[1])?!1:2<a.length&&(0>parseFloat(a[2])||59<parseFloat(a[2]))?!1:!0};
