
var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}
return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}
qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}
child=child.nextSibling;}
return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}
var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}
return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){add(obj[i],i);}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}
return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}
this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onClick:function(input){self._onInputClick(input);},onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}
var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}
var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputClick:function(input){},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}
this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}
for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}
if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}
return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}
r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}
return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}
for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()=='.'+ext||allowed[i].toLowerCase()==ext){return true;}}
return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,templateEnabled:true,fileListEnabled:true,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;if(this._options.templateEnabled){this._element.innerHTML=this._options.template;}
if(this._options.fileListEnabled){this._listElement=this._options.listElement||this._find(this._element,'list');}
this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindTemplateEvents();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_bindTemplateEvents:function(){this._bindCancelEvent();this._setupDragDrop();},_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}
return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);if(!item)return;var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}
qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);if(!item)return;qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){if(!this._options.fileListEnabled)return;var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){if(!this._options.fileListEnabled)return null;var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){if(!this._options.fileListEnabled)return;var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}
e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onClick:function(input){},onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}
qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}
input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'click',function(){self._options.onClick(input);});qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}
return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}
this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}
return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){if(!this._files[id])return;this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}
var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}
if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}
callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}
return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype)
qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}
return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}
this.log("xhr - server response received with status "+xhr.status);this.log("responseText = "+xhr.responseText);if(xhr.status!==200&&!response.error&&!response.success){response={error:response};}
this._options.onComplete(id,name,response);this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){if(!this._files[id])return;this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});
;
;(function($){$.fn.extend({hxfileuploader:function(options){options=$.extend(true,{},$.hxFileuploadControl._options,options);if(options.lazyLoad){options.lazyLoad=false;$.fn.hxfileuploader.lazyLoadList.push({"element":this,"options":options});return this;}
return this.each(function(){options=$.extend(options,{element:$(this)[0]});var uploader=new $.hxFileuploadControl(this,options);return uploader;});},clearFileUploader:function(){return this.trigger('clearfileuploader');},onFileUploadInputClicked:function(handler){return this.bind('fileuploadinputclick',handler);},onFileUploadInputChange:function(handler){return this.bind('fileuploadinputchange',handler);},onFileUploadError:function(handler){return this.bind('fileuploaderror',handler);},onFileUploadSuccess:function(handler){return this.bind('fileuploadsuccess',handler);},setInputFileName:function(fileName){return this.trigger('setinputfilename',[fileName]);},unhxfileuploader:function(){return this.trigger('unhxfileuploader');}});$.fn.hxfileuploader.lazyLoadList=[];$.fn.hxfileuploader.lazyLoadById=function(id){if($.fn.hxfileuploader.lazyLoadList.length===0){return;}
var lazy=null;$.fn.hxfileuploader.lazyLoadList=$.grep($.fn.hxfileuploader.lazyLoadList,function(v,i){if($(v.element.selector).get(0)&&$(v.element.selector).get(0).id===id){lazy=v;return false;}
return true;});if(!lazy){return;}
$.fn.hxfileuploader.apply($(lazy.element.selector),[lazy.options]);};$.fn.hxfileuploader.lazyLoad=function(){while($.fn.hxfileuploader.lazyLoadList.length>0){var lazy=$.fn.hxfileuploader.lazyLoadList.pop();$.fn.hxfileuploader.apply($(lazy.element.selector),[lazy.options]);}};$.fn.hxfileuploader._inherits=function(childCtor,parentCtor){function tempCtor(){}
tempCtor.prototype=parentCtor.prototype;childCtor.uber=parentCtor.prototype;childCtor.prototype=new tempCtor();childCtor.prototype.constructor=childCtor;};$.fn.hxfileuploader._base=function(me,var_args){var caller=arguments.callee.caller;if(caller.uber){return caller.uber.constructor.apply(me,Array.prototype.slice.call(arguments,1));}};$.hxFileuploadControl=function(input,options){if(!input){throw new Error('input required');}
this._contextJQ=$(input);this._inputFileElementJQ=null;this._progressElementJQ=null;this._jqElements=[];var self=this;this._contextJQ.bind('unhxfileuploader',function(){self._contextJQ.unbind();}).bind('clearfileuploader',function(){self._clear();}).bind('setinputfilename',function(e,fileName){self._setInputFileName(fileName);});if(!options.multiple){options.maxConnections=1;}
options.showMessage=options.showMessage||function(message){self._showMessage(message);};$.fn.hxfileuploader._base(this,options);};$.fn.hxfileuploader._inherits($.hxFileuploadControl,qq.FileUploader);$.hxFileuploadControl.prototype._createUploadButton=function(element){var button=qq.FileUploader.prototype._createUploadButton.apply(this,arguments);this._getInputFileElementJQ().removeAttr('readonly');if(this._options.fileName){this._setInputFileName(this._options.fileName);}
return button;};$.hxFileuploadControl.prototype._bindTemplateEvents=function(){qq.FileUploader.prototype._bindTemplateEvents.apply(this,arguments);var self,cancelJQ;self=this;cancelJQ=this._getProgressElementJQ().children('a.qq-upload-cancel').click(function(e){var file=$(this).data('file');if(file){self._cancelFileUpload(file.id,file.fileName);}
e.stopPropagation();e.preventDefault();});};$.hxFileuploadControl.prototype._onInputClick=function(input){this._contextJQ.trigger('fileuploadinputclick');qq.FileUploader.prototype._onInputClick.apply(this,arguments);};$.hxFileuploadControl.prototype._onInputChange=function(input){this._setInputFileName(input.value);this._contextJQ.trigger('fileuploadinputchange',[input.value]);qq.FileUploader.prototype._onInputChange.apply(this,arguments);};$.hxFileuploadControl.prototype._validateFile=function(file){var valid=qq.FileUploader.prototype._validateFile.apply(this,arguments);if(!valid){this._revertInputToLastSavedFile();}
return valid;};$.hxFileuploadControl.prototype._formatSize=function(bytes){var kilobytes=bytes/1024;kilobytes=kilobytes.toFixed(2);return Math.max(kilobytes,0.1)+'KB';};$.hxFileuploadControl.prototype._onProgress=function(id,fileName,loaded,total){var progress,size,text;progress=this._getProgressElementJQ();size=progress.children('.qq-upload-size');size.css('display','inline');if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}
size.html(text);};$.hxFileuploadControl.prototype._onSubmit=function(id,fileName){this._clearMessage();this._showProgress(id,fileName);qq.FileUploader.prototype._onSubmit.apply(this,arguments);};$.hxFileuploadControl.prototype._onComplete=function(id,fileName,result){this._hideProgress(id,fileName);if(result){var extResult={fileName:fileName};if(result.error){$.extend(extResult,result.error);this._onFileUploadError(extResult);}
else if(result.errors&&result.errors.length>0){this._onFileUploadValidationErrors(result.errors);}
else if(result.success){$.extend(extResult,result);this._onFileUploadSuccess(extResult);}}
qq.FileUploader.prototype._onComplete.apply(this,arguments);};$.extend($.hxFileuploadControl.prototype,{_getElementJQ:function(selector){if(!this._jqElements[selector]){this._jqElements[selector]=this._contextJQ.find(selector);}
return this._jqElements[selector];},_getInputFileElementJQ:function(){this._inputFileElementJQ=this._inputFileElementJQ||$(this._contextJQ).find(':text');return this._inputFileElementJQ;},_getProgressElementJQ:function(){this._progressElementJQ=this._progressElementJQ||$(this._contextJQ).find('div.qq-upload-progress');return this._progressElementJQ;},_onFileUploadSuccess:function(result){this._clearMessage();this._contextJQ.trigger('fileuploadsuccess',[result]);if(this._options.onFileUploadSuccess){this._options.onFileUploadSuccess(result);}},_onFileUploadValidationErrors:function(errors){if(errors&&errors.length>0){if(errors.length===1){this._showMessage(errors[0].message);}else{var sb=[];for(var i=0;i<errors.length;i++){sb.push(errors[i].message);if(i<(errors.length-1)){sb.push('<br />');}}
this._options.showMessage(sb.join(''));}}
this._revertInputToLastSavedFile();},_onFileUploadError:function(error){if(error&&error.message){this._showMessage(error.message);}
this._revertInputToLastSavedFile();this._contextJQ.trigger('fileuploaderror',[error]);if(this._options.onFileUploadError){this._options.onFileUploadError(error);}},_cancelFileUpload:function(id,fileName){this._handler.cancel(id);this._hideProgress(id,fileName);this._revertInputToLastSavedFile();},_showProgress:function(id,fileName){var progress=this._getProgressElementJQ();progress.children('.qq-upload-size').hide();this._getProgressElementJQ().children('a.qq-upload-cancel').data('file',{id:id,fileName:fileName});progress.show();},_hideProgress:function(id,fileName){if(this._handler._queue.length>1){return;}
var progress=this._getProgressElementJQ();this._getProgressElementJQ().hide();},_clear:function(){this._getInputFileElementJQ().val('').data('lastFileName','');this._clearMessage();},_clearMessage:function(){var div=this._getElementJQ('div.qq-upload-error');div.hide();},_showMessage:function(message){if(typeof message!='string'){return;}
var div=this._getElementJQ('div.qq-upload-error');$(div.children()[0]).html(message);div.show();},_setInputFileName:function(fileName){var lastFileName=this._getInputFileElementJQ().val();if(fileName!==lastFileName){this._getInputFileElementJQ().data('lastFileName',lastFileName).val(fileName);}},_revertInputToLastSavedFile:function(){var lastFileName=this._getInputFileElementJQ().data('lastFileName');this._getInputFileElementJQ().val(lastFileName);}});$.hxFileuploadControl._options={lazyLoad:false,templateEnabled:false,fileListEnabled:false,multiple:false,onFileUploadSuccess:null,onFileUploadError:null};})(jQuery);
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter=function(element){Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter.initializeBase(this,[element]);this.createProperty("sbJobDetails");this.createProperty("sbPostingOptions");this.createProperty("sbCheckout");this.createProperty("_jobDetailsVisited");this.createProperty("_postingOptionsVisited");this.createProperty("_checkoutVisited");this.createProperty("sbCJD");}
Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("currentPage");this.registerDataProperty("hideCJDCrumb");},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"currentPage":var currentPage=this._dataStore.get_property("currentPage");if(currentPage=="JobPostingOptions"){this._jobDetailsVisited=true;this._postingOptionsVisited=true;this.sbJobDetails.className="visited first";this.sbPostingOptions.className="current";$clearHandlers(this.sbPostingOptions);$addHandlers(this.sbJobDetails,{click:this.CrumbClick},this);}
else if(currentPage=="JobDetail"){this._jobDetailsVisited=true;this.sbJobDetails.className="current first";$clearHandlers(this.sbJobDetails);if(this._postingOptionsVisited){this.sbPostingOptions.className="visited";$addHandlers(this.sbPostingOptions,{click:this.CrumbClick},this);}
else{this.sbPostingOptions.className="notVisited";}}
break;case"hideCJDCrumb":var temp=this._dataStore.get_property("hideCJDCrumb");if(this.sbCJD){if(!temp){this.sbCJD.style.display="none";}
else{this.sbCJD.style.display="block";}}
break;default:break;}},CrumbClick:function(){var currentPage=this._dataStore.get_property("currentPage");if(currentPage=="JobDetail"){this._dataStore.set_property("InitiateContinueClick","OptionsBreadCrumb");}
else if(currentPage=="JobPostingOptions"){this._dataStore.set_property("InitiateGoBackClick","DetailsBreadCrumb");}}}
Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsOptionsBreadcrumbAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter=function(element){Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter.initializeBase(this,[element]);this.createProperty("errorSummaryDisplay");this.createProperty("error_ActionDisplay");this.createProperty("error_ActionDisplay_CustomFailure");this.RequiredErrors=null;}
Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this.registerDataProperty("ErrorSummaryDisplay_AddError");this.registerDataProperty("ErrorSummaryDisplay_ClearErrors");this.registerDataProperty("ErrorSummaryDisplay_AddCajaError");this.registerDataProperty("ErrorStore");this.registerDataProperty("CajaWarning");this.registerDataProperty("TriggerRequiredErrorDisplay");this._dataStore.set_property("ErrorStore","");},initOnDemand:function(){this._webService=EBiz.Services.JPW.PostingSummaryService;this.registerDataProperty("DetailsRequiredErrorsCollector");this.registerDataProperty("OptionsRequiredErrorsCollector");},dispose:function(){if(MonsPageManager.initState(this._id)){this._dataStore.remove_propChangeEventHandler("ErrorSummaryDisplay_AddError",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("ErrorSummaryDisplay_ClearErrors",this._dataChangeDelegate);}
Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){var temp="";switch(args.get_propertyName()){case"ErrorSummaryDisplay_AddError":if(this.error_ActionDisplay_CustomFailure.innerHTML.length!=0)
this.error_ActionDisplay_CustomFailure.innerHTML+="<br />";this.error_ActionDisplay_CustomFailure.innerHTML+=this._dataStore.get_property("ErrorSummaryDisplay_AddError");this.errorSummaryDisplay.style.display="block";this.error_ActionDisplay.style.display="block";this.error_ActionDisplay_CustomFailure.style.display="block";break;case"ErrorSummaryDisplay_AddCajaError":var message=this._dataStore.get_property("CajaWarning");var desc=this._dataStore.get_property("ErrorSummaryDisplay_AddCajaError");this._dataStore.set_property("ReplaceJobDesc",desc);$.showMessage("Confirmation",[{NodeType:"Information",Value:message}]);break;case"ErrorSummaryDisplay_ClearErrors":this.error_ActionDisplay_CustomFailure.innerHTML="";this.errorSummaryDisplay.style.display="none";this.error_ActionDisplay.style.display="none";this.error_ActionDisplay_CustomFailure.style.display="none";break;case"DetailsRequiredErrorsCollector":temp=this._dataStore.get_property("DetailsRequiredErrorsCollector");var err=this._dataStore.get_property("ErrorStore");for(var i=0;i<temp.length;i++)
err=err+temp[i]+"<br>";this._dataStore.set_property("ErrorStore",err);err="";break;case"OptionsRequiredErrorsCollector":temp=this._dataStore.get_property("OptionsRequiredErrorsCollector");var err=this._dataStore.get_property("ErrorStore");for(var i=0;i<temp.length;i++)
err=err+temp[i]+"<br>";this._dataStore.set_property("ErrorStore",err);err="";break;case"TriggerRequiredErrorDisplay":var lst=this._dataStore.get_property("ErrorStore");this._dataStore.set_property("ErrorSummaryDisplay_AddError",lst);this._dataStore.set_property("ErrorStore","");this.webTrend(lst);break;default:break;}},webTrend:function(errlst){var err;if(errlst.search("<br >")>-1)
{err=errlst.split("<br >");}
else{err=errlst.split("<br>");}
for(var i=0;i<=err.length-2;i++){dcsMultiTrack("DCS.dcsuri","jobs/JobPostingDetailsOptions_er.evt","DCS.ext_hx_jpwerror",err[i]);}}}
Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter.registerClass('Monster.Client.Behavior.JobPosting.ErrorSummaryDisplayAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter=function(element){this._createStart=new Date();Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter.initializeBase(this,[element]);this._createEnd=new Date();this.adapter=this;this.locationChoice=false;this.checkfields=null;this.reqErrors=[];this.KEY_JOBTITLE=0;this.KEY_ZIPCODE=1;this.KEY_MINSALARY=2;this.KEY_MAXSALARY=3;this.JobInformation_AdAgencyIsEditingPart=null;this.JobInformation_AdAgencyChange=null;this.AutoCompleteType=function(XMLName,TypeID,MinFields){this.XMLName=XMLName;this.TypeID=TypeID;this.MinFields=MinFields;};this.createProperty("JobInformation_jobTitleControl");this.createProperty("JobInformation_rbAdAgencyControl");this.createProperty("JobInformation_rbAdAgencyClientControl");this.createProperty("JobInformation_IONumberControl");this.createProperty("JobInformation_streetAddress1Control");this.createProperty("JobInformation_streetAddress2Control");this.createProperty("JobInformation_zipCodeControl");this.createProperty("JobInformation_cityControl");this.createProperty("JobInformation_stateControl");this.createProperty("JobInformation_countryControl");this.createProperty("JobInformation_minWageControl");this.createProperty("JobInformation_maxWageControl");this.createProperty("JobInformation_salaryDescControl");this.createProperty("JobInformation_currencyTypeControl");this.createProperty("JobInformation_salaryTypeControl");this.createProperty("JobInformation_salaryOther");this.createProperty("JobInformation_careerControl");this.createProperty("JobInformation_workExperienceControl");this.createProperty("JobInformation_educationControl");this.createProperty("JobInformation_eecoControl");this.createProperty("JobInformation_aapGroupControl");this.createProperty("JobInformation_dispRefCode");this.createProperty("JobInformation_txtRefCode");this.createProperty("JobInformation_editBtnControl");this.createProperty("JobInformation_radioBtn0");this.createProperty("JobInformation_radioBtn1");this.createProperty("JobInformation_radioBtn2");this.createProperty("JobInformation_radioBtn3");this.createProperty("JobInformation_adaptControl");this.createProperty("JobInformation_proDiversityLogoControl");this.createProperty("JobInformation_telecommuteDiv");this.createProperty("JobInformation_AdAgencyControl");this.createProperty("JobInformation_AdAgencydivIONumberControl");this.createProperty("JobInformation_CampusToJobTypeDepCtrl");this.createProperty("JobInformation_LocationDefaultRecommend");this.createProperty("JobInformation_LocationIntlRecommend");this.createProperty("JobInformation_LocationNoFixedRecommend");this.createProperty("JobInformation_LocationNoRegionRecommend");this.createProperty("JobInformation_jobStatusesControl");this.createProperty("JobInformation_jobTypesControl");this.createProperty("JobInformation_lblZipCode");this.createProperty("JobInformation_stateElement");this.createProperty("JobInformation_findZipLink");this.createProperty("JobInformation_salaryBenchMarkLink");this.createProperty("JobInformation_readOnlyDefaultText");this.createProperty("JobInformation_salaryToText");this.createProperty("JobInformation_otherSalaryInfoDefaultText");this.createProperty("JobInformation_salaryRangeMinText");this.createProperty("JobInformation_salaryRangeMaxText");this.createProperty("JobInformation_AdAgencyChange");this.createProperty("JobInformation_AdAgencyIsEditingPart");this.createProperty("JobInformation_validationGroupName");this.createProperty("JobInformationLocation_validationGroupName");this.createProperty("JobInformation_DefaultCurrencyType");this.createProperty("jobTitleLabelClientID");this.createProperty("JobInformation_EducationLevelConst");this.createProperty("JobInformation_ShowInitialEdit");this.createProperty("JobInformation_cityControlName");this.createProperty("JobInformation_stateControlName");this.createProperty("JobInformation_stateMessageName");this.createProperty("DefaultCountry");this.createProperty("DefaultCountryName");this.createProperty("JobInformation_USTag");this.createProperty("JobInformation_IntTag");this.createProperty("JobInformation_NoFixTag");this.createProperty("JobInformation_CountryScreen");this.createProperty("JobInformation_CityStateZipScreen");this.createProperty("JobInformation_NoLocationScreen");this.createProperty("JobInformation_showSalaryBenchmarkLink");this.createProperty("JobInformation_salaryBenchmarkPopupUrl");this.createProperty("SALARY_RANGE_ERROR_MESSAGE_ID");this.createProperty("JOB_LOCATION_ERROR_MESSAGE_ID");this.createProperty("JOB_TYPE_ERROR_MESSAGE_ID");this.createProperty("JOB_TITLE_ERROR_MESSAGE_ID");this.createProperty("HOURS_PER_WEEK_ERROR_MESSAGE_ID");this.createProperty("EEO_ERROR_MESSAGE_ID");this.createProperty("AAP_ERROR_MESSAGE_ID");this.createProperty("FIELDS_OF_STUDY_ERROR_MESSAGE_ID");this.createProperty("LANGUAGE_SKILLS_ERROR_MESSAGE_ID");this.createProperty("EDUCATION_LEVEL_ERROR_MESSAGE_ID");this.createProperty("JobInformation_regionText");this.createProperty("JobInformation_postalCodeText");this.createProperty("JobInformation_zipCodeText");this.createProperty("JobInformation_stateText");this.createProperty("BillingPageRedirect");this.createProperty("IsInternationalPosting");this.createProperty("SelectedLocationType");this.createProperty("IsEditMode");this.createProperty("AdAjencyAlert");this.createProperty("IsTempUser");this.createProperty("ChannelID");this.createProperty("CareerLevelRequired");this.createProperty("CAREER_ERROR_MESSAGE");this.createProperty("DefaultSelect");}
Array.prototype.contains=function(element){for(var i=0;i<this.length;i++){if(this[i]==element){return true;}}
return false;}
Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter.prototype={initialize:function(){this._initStart=new Date();this.checkfields=[this.JobInformation_txtRefCode,this.JobInformation_jobTitleControl,this.JobInformation_zipCodeControl,this.JobInformation_minWageControl,this.JobInformation_maxWageControl,this.JobInformation_cityControl,this.JobInformation_salaryDescControl];for(var i=0;i<this.checkfields.length;i++)
$addHandler(this.checkfields[i],'keypress',this.onEnterPress);Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
if((this.JobInformation_radioBtn1.checked==true)||(this.JobInformation_radioBtn2.checked==true)||(this.JobInformation_radioBtn3.checked==true)){if(this.JobInformation_USTag!=null){this.JobInformation_USTag.className="location-like-link";}
if(this.JobInformation_IntTag!=null){this.JobInformation_IntTag.className="location-like-link";}
if(this.JobInformation_NoFixTag!=null){this.JobInformation_NoFixTag.className="location-like-label";}}
else if(this.JobInformation_countryControl.selectedIndex>0){if(this.JobInformation_USTag!=null){this.JobInformation_USTag.className="location-like-link";}
if(this.JobInformation_IntTag!=null){this.JobInformation_IntTag.className="location-like-label";}
if(this.JobInformation_NoFixTag!=null){this.JobInformation_NoFixTag.className="location-like-link";}}
else{if(this.JobInformation_USTag!=null){this.JobInformation_USTag.className="location-like-label";}
if(this.JobInformation_IntTag!=null){this.JobInformation_IntTag.className="location-like-link";}
if(this.JobInformation_NoFixTag!=null){this.JobInformation_NoFixTag.className="location-like-link";}}
if(this.get_BillingPageRedirect()=="true"||this.get_BillingPageRedirect()=="True"){if(this.JobInformation_eecoControl!=null){if(this.JobInformation_eecoControl.selectedIndex<=0){this.reqErrors.push("EEO entry required");}}
if(this.JobInformation_aapGroupControl!=null){if(this.JobInformation_aapGroupControl.selectedIndex<=0){this.reqErrors.push("AAP entry required");}}
if(this.reqErrors.length>0){var err="";for(var i=0;i<this.reqErrors.length;i++){err=err+this.reqErrors[i]+"<br>";}}
this._dataStore.set_property("ErrorStore",err);this._dataStore.set_property("TriggerRequiredErrorDisplay","");}
if(this.IsEditMode!=="false"){this.onShowEditData(true);}
this.bindPostalCodeFormatingMask();},initOnDemand:function(){this._initEnd=new Date();this.registerDataProperty("UberDetailsObject");this.registerDataProperty("GetInformationView");this.registerDataProperty("GetCommonData");this.registerDataProperty("LoadData");this.registerDataProperty("CommonPostingID");this.registerDataProperty("ModifyContact");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("ModifyInfo");this.registerDataProperty("JobTitleIsEnabled");this.registerDataProperty("JobInformation_DataTransformationImpact");this.registerDataProperty("IsChange");this.registerDataProperty("SetValidationErrors");this.registerDataProperty("PrePopulateMailDetails");this.registerDataProperty("ValidateJobSave");this.registerDataProperty("ChannelIDInfo");this.registerDataProperty("SelectedState");this.JobInformation_AdAgencyIsEditingPart=parseInt(this.get_JobInformation_AdAgencyIsEditingPart);this.JobInformation_AdAgencyChange=(this.get_JobInformation_AdAgencyChange()=="true");this._webService=EBiz.Services.JPW.JobDetailsService;this._dataStore.set_property("ChannelIDInfo",this.get_ChannelID());$addHandlers(this.get_JobInformation_radioBtn1(),{click:this.locationChoosen},{instance:this,value:true});$addHandlers(this.get_JobInformation_radioBtn2(),{click:this.locationChoosen},{instance:this,value:true});$addHandlers(this.get_JobInformation_radioBtn3(),{click:this.locationChoosen},{instance:this,value:true});if(this.JobInformation_rbAdAgencyControl!=null&&this.JobInformation_rbAdAgencyControl.style!=null){$addHandlers(this.JobInformation_rbAdAgencyControl,{click:this.AdAgencyAlert},{instance:this,value:[false,this.JobInformation_rbAdAgencyControl]});}
if(this.JobInformation_rbAdAgencyClientControl!=null&&this.JobInformation_rbAdAgencyClientControl.style!=null){$addHandlers(this.JobInformation_rbAdAgencyClientControl,{click:this.AdAgencyAlert},{instance:this,value:[true,this.JobInformation_rbAdAgencyClientControl]});}
if(this.get_ChannelID()=="58"){$addHandlers(this.JobInformation_jobTitleControl,{blur:this.UpdateValue},this);}
if(this.JobInformation_showSalaryBenchmarkLink!="false"){$addHandlers(this.JobInformation_salaryBenchMarkLink,{click:this.OpenSalaryBenchmark},{instance:this,value:[true,this.JobInformation_salaryBenchMarkLink]});}},ValidateField:function(element){},UpdateValue:function(evt){if(evt&&evt.type=="blur"){this.TriggerDescriptionTitleBox();}},initValidator:function(element,args){if(MonsPageManager.enableInitOnDemand){MonsPageManager.onClick();}
if(args[1]!=null){switch(args[1]){case element.get_JobInformation_minWageControl():element.SetDefaultTextBlur(1);break;case element.get_JobInformation_maxWageControl():element.SetDefaultTextBlur(2);break;case element.JobInformation_zipCodeControl:element.ToggleIcon(element.JobInformation_zipCodeControl,!args[0]);element.ShowError(element.JobInformation_zipCodeControl,!args[0]);if(args[0]){element.RouteEvents(element.JobInformation_zipCodeControl);}
break;default:break;}}},initHandlers:function(element,event,context){event.preventDefault();switch(element){case this.get_JobInformation_USTag():case this.get_JobInformation_IntTag():case this.get_JobInformation_NoFixTag():if(event.type=="click"){$addHandlers(element,{click:this.ScreenFilter},{instance:this,value:element});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.ScreenFilter(element,true);}}
break;case this.get_JobInformation_countryControl():if(event.type=="change"){$addHandlers(element,{change:this.OnLocationCountryChange},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.OnLocationCountryChange();}}
break;case this.get_JobInformation_stateControl():if(event.type=="change"){$addHandlers(element,{change:this.GetRelatedInfo},this);$addHandlers(element,{change:this.onUpdateStateControl},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.GetRelatedInfo();this.onUpdateStateControl();}}
break;case this.get_JobInformation_cityControl():if(event.type=="blur"){$addHandlers(element,{blur:this.GetRelatedInfo},this);$addHandlers(element,{blur:this.onUpdateCityControl},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.GetRelatedInfo();this.onUpdateCityControl();}}
break;case this.get_JobInformation_streetAddress1Control():if(event.type=="blur"){$addHandlers(element,{blur:this.onUpdateAddress1Control},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.onUpdateAddress1Control();}}
break;case this.get_JobInformation_minWageControl():if(event.type=="focus"){$addHandlers(element,{focus:this.SetDefaultTextFocus},{instance:this,value:1});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextFocus(1);break;}}
if(event.type=="blur"){$addHandlers(element,{blur:this.SetDefaultTextBlur},{instance:this,value:1});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextBlur(1);}}
break;case this.get_JobInformation_maxWageControl():if(event.type=="focus"){$addHandlers(element,{focus:this.SetDefaultTextFocus},{instance:this,value:2});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextFocus(2);break;}}
if(event.type=="blur"){$addHandlers(element,{blur:this.SetDefaultTextBlur},{instance:this,value:2});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextBlur(2);}}
break;case this.get_JobInformation_salaryDescControl():if(event.type=="focus"){$addHandlers(element,{focus:this.SetDefaultTextFocus},{instance:this,value:3});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextFocus(3);break;}}
if(event.type=="blur"){$addHandlers(element,{blur:this.SetDefaultTextBlur},{instance:this,value:3});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SetDefaultTextBlur(3);}}
break;case this.JobInformation_educationControl:case this.JobInformation_careerControl:if(event.type=="change"){$addHandlers(element,{change:this.RouteEvents},{instance:this,value:element});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.RouteEvents(element);}}
break;case this.JobInformation_jobTitleControl:if(event.type=="change"){$addHandlers(element,{change:this.TriggerDescriptionTitleBox},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.TriggerDescriptionTitleBox();}}
else if(event.type=="blur"){$addHandlers(element,{blur:this.TriggerDescriptionTitleBox},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.TriggerDescriptionTitleBox();}}
break;default:break;}},dispose:function(){if(MonsPageManager.initState(this._id)){}},RouteEvents:function(element){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){element=this.value;}
switch(element){case me.JobInformation_educationControl:me._dataStore.set_property("ModifyContact",["EDUC",element.selectedIndex]);break;case me.JobInformation_zipCodeControl:if(me.JobInformation_IntTag!=null&&me.JobInformation_IntTag.className=="location-like-label"){me._dataStore.set_property("ModifyContact",["ZIP",element.value,me.JobInformation_countryControl.value,this.IsTempUser]);}
else{me._dataStore.set_property("ModifyContact",["ZIP",element.value,me.get_DefaultCountry(),this.IsTempUser]);}
this.onZipCode(element.value);break;case me.JobInformation_careerControl:me._dataStore.set_property("ModifyContact",["CARR",element.selectedIndex]);break;case me.JobInformation_countryControl:me._dataStore.set_property("ModifyContact",["COUNTRY",element,this.IsTempUser]);break;case me.JobInformation_NoFixTag:me._dataStore.set_property("ModifyContact",["NOLOCATION","nolocation",me.JobInformation_countryControl,me.get_DefaultCountry(),me.get_DefaultCountryName()]);break;case me.JobInformation_IntTag:me._dataStore.set_property("ModifyContact",["INTERNATIONAL","international",me.JobInformation_countryControl]);break;case me.JobInformation_USTag:me._dataStore.set_property("ModifyContact",["DEFAULTPANEL",me.get_DefaultCountry(),me.get_DefaultCountryName()]);break;default:break;}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":var view=this.BuildJobInformationViewObject();this._dataStore.set_property("GetInformationView",view);break;case"LoadData":result=this._dataStore.get_property("LoadData");if(result.JobInformation!=null){this.LoadInformationView(result.JobInformation);}
break;case"GetCommonData":this._dataStore.set_property("CommonJobTitle",this.JobInformation_jobTitleControl.value);break;case"validateDetailsPage_request":var valPass=this.CheckRequired();this._dataStore.set_property("ValidateInformation",valPass);if((!valPass)&&(this.reqErrors.length>0)){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);}
break;case"PrePopulateMailDetails":if(this.IsTempUser=="true"){this._dataStore.set_property("ModifyContact",["COUNTRY",this.JobInformation_countryControl,this.IsTempUser]);this._dataStore.set_property("ModifyContact",["ZIP",this.JobInformation_zipCodeControl.value,this.JobInformation_countryControl.value,this.IsTempUser]);this._dataStore.set_property("ModifyContact",["CITY",this.get_JobInformation_cityControl().value,this.IsTempUser]);if(this.JobInformation_stateElement.style.display!="none"){this._dataStore.set_property("ModifyContact",["STATE",this.get_JobInformation_stateControl().value,this.IsTempUser]);}}
break;case"ModifyInfo":var temp=this._dataStore.get_property("ModifyInfo");switch(temp[0]){case"EDUC":if(temp[1]!=0)
this.JobInformation_educationControl.selectedvalue=temp[1];break;case"CARR":if(temp[1]!=0)
this.JobInformation_careerControl.selectedvalue=temp[1];break;default:break;}
break;case"JobTitleIsEnabled":this.JobInformation_jobTitleControl.disabled=this._dataStore.get_property("JobTitleIsEnabled")=="true"?false:true;break;case"JobInformation_DataTransformationImpact":if(this.JobInformation_jobTitleControl!=null&&this.JobInformation_jobTitleControl.value!=null&&this.JobInformation_jobTitleControl.value.length>0){this._dataStore.set_property("HasDataTransformationImpact","true");}
break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement){case"IONumber":this.ShowError(this.JobInformation_IONumberControl,temp.isShow);break;case"JobLocation":this.ShowError(this.JobInformation_zipCodeControl,temp.isShow);break;case"Salary":this.ShowError(this.JobInformation_minWageControl,temp.isShow);break;default:break;}
break;default:break;}},CheckCurrentFlow:function(parameter){var flow=null;parameter=parameter.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];},onEnterPress:function(e){var code;if(!e)e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;else if(e.charCode)code=e.charCode;if(code==13){if(typeof window.event=='undefined'){e.stopPropagation();e.preventDefault();}}},onShowEditData:function(flag){var isInternational=(this.get_IsInternationalPosting()==='true');var positionLocationType=this.get_SelectedLocationType();if(isInternational){this.ScreenFilter(this.get_JobInformation_IntTag(),isInternational);if(this.get_JobInformation_stateElement().style.display=="none"){this.showScreen(this.get_JobInformation_LocationNoRegionRecommend(),flag);this.showScreen(this.get_JobInformation_LocationIntlRecommend(),!flag);this.showScreen(this.get_JobInformation_LocationDefaultRecommend(),!flag);}
else{this.showScreen(this.get_JobInformation_LocationNoRegionRecommend(),!flag);this.showScreen(this.get_JobInformation_LocationDefaultRecommend(),!flag);this.showScreen(this.get_JobInformation_LocationIntlRecommend(),flag);}}
if(positionLocationType!=Presenters.JPW.DTO.PositionLocationType.PhysicalAddressLocation){this.JobInformation_NoFixTag.className="location-like-link";this.ScreenFilter(this.get_JobInformation_NoFixTag(),true);switch(parseInt(positionLocationType)){case Presenters.JPW.DTO.PositionLocationType.MultipleLocations:this.JobInformation_radioBtn1.checked=true;break;case Presenters.JPW.DTO.PositionLocationType.Telecomute:this.showScreen(this.get_JobInformation_telecommuteDiv(),flag);this.showScreen(this.get_JobInformation_LocationDefaultRecommend(),!flag);this.showScreen(this.get_JobInformation_LocationIntlRecommend(),!flag);this.showScreen(this.get_JobInformation_LocationNoFixedRecommend(),!flag);this.JobInformation_radioBtn2.checked=true;break;case Presenters.JPW.DTO.PositionLocationType.NoDisclosure:this.JobInformation_radioBtn3.checked=true;break;default:break;}}},CheckRequired:function(){this.reqErrors=[];var temp=[false,false,false,false,false,true,true,true,true,true];if(this.get_CareerLevelRequired()=="true"||this.get_CareerLevelRequired()=="True"){temp[9]=false;}
else{temp[9]=true;}
var ischk=false;var isSaveMode=this._dataStore.get_property("ValidateJobSave");if(this.JobInformation_jobTitleControl.value!=""&&this.JobInformation_jobTitleControl.value!=null){temp[0]=true;this.ShowError(this.JobInformation_jobTitleControl,false);}
else{this.reqErrors.push(this.get_JOB_TITLE_ERROR_MESSAGE_ID());this.ShowError(this.JobInformation_jobTitleControl,true);}
if(this.JobInformation_NoLocationScreen.style.display=="block"){if((this.JobInformation_radioBtn1.checked==true)||(this.JobInformation_radioBtn2.checked==true)||(this.JobInformation_radioBtn3.checked==true)){temp[1]=true;}}
else{if(this.JobInformation_zipCodeControl.value!=""){temp[1]=true;}
if(this.JobInformation_cityControl.value!=""&&this.JobInformation_stateControl.selectedIndex>0){temp[1]=true;}
if(this.JobInformation_cityControl.value!=""&&(this.JobInformation_stateElement.style.display=="none"||this.JobInformation_stateControl==null)){temp[1]=true;}
if(this.JobInformation_CountryScreen.style.display=="block"){if(this.JobInformation_countryControl.value!=""){temp[1]=true;}}
if(this.JobInformation_CityStateZipScreen.style.display=="block"){if(this.JobInformation_stateControl.value!=""){temp[1]=true;}}}
if(temp[1]!=true){this.reqErrors.push(this.get_JOB_LOCATION_ERROR_MESSAGE_ID());this.ShowError(this.JobInformation_zipCodeControl,true);}
else{this.ShowError(this.JobInformation_zipCodeControl,false);}
if(!isSaveMode){if(this.JobInformation_jobTypesControl!=null){var selectedJobTypesItem=this.JobInformation_jobTypesControl.value;if(selectedJobTypesItem!=null||selectedJobTypesItem!="0"){temp[2]=true;}
else{temp[2]=false;}
if(selectedJobTypesItem=="34"){temp[5]=temp[6]=temp[7]=true;if(this.JobInformation_educationControl.selectedIndex<=0){temp[8]=false;this.reqErrors.push(this.get_EDUCATION_LEVEL_ERROR_MESSAGE_ID());this.ShowError(this.JobInformation_EducationLevelConst,true);}
else{temp[8]=true;this.ShowError(this.JobInformation_EducationLevelConst,false);}}}
if(temp[2]!=true){var status=this.JobInformation_jobStatusesControl.value;if(status!=null||status!="0"){temp[2]=true;}
else{temp[2]=false;}}
if(temp[2]!=true){this.reqErrors.push(this.get_JOB_TYPE_ERROR_MESSAGE_ID());this.ShowError(this.JobInformation_jobTypesControl,true);}
else{this.ShowError(this.JobInformation_jobTypesControl,false);}
if(this.JobInformation_eecoControl!=null){if(this.JobInformation_eecoControl.style!=undefined){if(this.JobInformation_eecoControl.selectedIndex>0){temp[3]=true;}
else{temp[3]=false;this.reqErrors.push(this.get_EEO_ERROR_MESSAGE_ID());}}
else{temp[3]=true;}}
else{temp[3]=true;}
if(temp[3]){this.ShowError(this.JobInformation_eecoControl,false);}
else{this.ShowError(this.JobInformation_eecoControl,true);}
if(this.JobInformation_aapGroupControl!=null){if(this.JobInformation_aapGroupControl.style!=undefined){if(this.JobInformation_aapGroupControl.selectedIndex>0){temp[4]=true;}
else{temp[4]=false;this.reqErrors.push(this.get_AAP_ERROR_MESSAGE_ID());}}
else{temp[4]=true;}}
else{temp[4]=true;}
if(temp[4]){this.ShowError(this.JobInformation_aapGroupControl,false);}
else{this.ShowError(this.JobInformation_aapGroupControl,true);}
if(!temp[9]){if(this.JobInformation_careerControl&&this.JobInformation_careerControl.style){if(this.JobInformation_careerControl.selectedIndex>0){temp[9]=true;this.ShowError(this.JobInformation_careerControl,false);}
else{temp[9]=false;this.reqErrors.push(this.get_CAREER_ERROR_MESSAGE());this.ShowError(this.JobInformation_careerControl,true);}}}
if((temp[0])&&(temp[1])&&(temp[2])&&(temp[3])&&(temp[4])&&(temp[5])&&(temp[6])&&(temp[7])&&(temp[8])&&(temp[9]))
ischk=true;else
ischk=false;}
else{if(temp[0]&&temp[1])
ischk=true;else
ischk=false;}
return ischk;},ClearJobStatus:function(){this.JobInformation_jobStatusesControl.selectedIndex=0;},ClearJobTypes:function(){this.JobInformation_jobTypesControl.selectedIndex=0;},LoadInformationView:function(view){var countryId=0;this.JobInformation_jobTitleControl.value=view.JobTitle;if(view.Address.ZipCode){this.get_JobInformation_zipCodeControl().value=view.Address.ZipCode;}
this.get_JobInformation_cityControl().value=view.Address.City;if(this.JobInformation_radioBtn0.checked){this.JobInformation_stateControl.value=view.Address.StateId;}else{if(this.JobInformation_countryControl){countryId=this.JobInformation_countryControl.value;if(view.Address.CountryId>0){this.JobInformation_countryControl.value=view.Address.CountryId;}}
if(view.Address.CountryId!=countryId){stateId=view.Address.StateId;this.OnLocationCountryChange();}
else{this.JobInformation_stateControl.value=view.Address.StateId;}}
if(parseInt(view.LocationType)>1){this.SelectAreaOptions(parseInt(view.LocationType));this.ScreenFilter(this.JobInformation_NoFixTag,true);}
else{this.JobInformation_radioBtn0.checked=true;this.locationChoosen(false);var isInternational=(this.get_DefaultCountry()!=view.Address.CountryId);if(isInternational){this.ScreenFilter(this.JobInformation_IntTag,true);}
else{this.ScreenFilter(this.JobInformation_USTag,true);}
if(this.JobInformation_countryControl){countryId=this.JobInformation_countryControl.value;if(view.Address.CountryId>0){this.JobInformation_countryControl.value=view.Address.CountryId;}}
if(isInternational){this.OnLocationCountryChange();}
this._dataStore.set_property("SelectedState",view.Address.StateId);this.get_JobInformation_cityControl().value=view.Address.City;if(view.Address.ZipCode){this.get_JobInformation_zipCodeControl().value=view.Address.ZipCode;}}
this.ClearJobStatus();this.JobInformation_jobStatusesControl.value=view.SelectedJobStatus;if(this.JobInformation_jobTypesControl!=null){this.ClearJobTypes();this.JobInformation_jobTypesControl.value=view.SelectedJobType;}
if(this.JobInformation_minWageControl!=null&&this.JobInformation_maxWageControl!=null&&this.JobInformation_currencyTypeControl!=null&&this.JobInformation_salaryTypeControl!=null){if(view.Salary.MinimalWage!==""&&view.Salary.MinimalWage!=="0"){this.JobInformation_minWageControl.style.color='#000000';this.JobInformation_minWageControl.value=view.Salary.MinimalWage;}
else{this.JobInformation_minWageControl.style.color='#C2C2C2';this.JobInformation_minWageControl.value=this.get_JobInformation_salaryRangeMinText();}
if(view.Salary.MaximalWage!==""&&view.Salary.MaximalWage!=="0"){this.JobInformation_maxWageControl.style.color='#000000';this.JobInformation_maxWageControl.value=view.Salary.MaximalWage;}
else{this.JobInformation_maxWageControl.style.color='#C2C2C2';this.JobInformation_maxWageControl.value=this.get_JobInformation_salaryRangeMaxText();}
if(this.JobInformation_salaryDescControl!=null){if(view.Salary.SalaryDescription.trim().length>0){this.JobInformation_salaryDescControl.style.color='#000000';this.JobInformation_salaryDescControl.value=view.Salary.SalaryDescription;}else{this.JobInformation_salaryDescControl.style.color='#C2C2C2';this.JobInformation_salaryDescControl.value=this.get_JobInformation_otherSalaryInfoDefaultText();}}
this.JobInformation_currencyTypeControl.value=view.Salary.CurrencyId>0?view.Salary.CurrencyId:this.get_JobInformation_DefaultCurrencyType();this.JobInformation_salaryTypeControl.value=view.Salary.SalaryTypeId;}
if(view.CareerLevelId>0){this.JobInformation_careerControl.value=view.CareerLevelId;}
else{this.JobInformation_careerControl.value="";}
if(view.RelevantWorkExperienceId>0){this.JobInformation_workExperienceControl.value=view.RelevantWorkExperienceId;}
else{this.JobInformation_workExperienceControl.value="";}
if(view.EducationLevelId>0){this.JobInformation_educationControl.value=view.EducationLevelId;}
else{this.JobInformation_educationControl.value="";}
if(this.JobInformation_eecoControl){if(view.EEOCJobCatId>0){this.JobInformation_eecoControl.value=view.EEOCJobCatId;}
else{this.JobInformation_eecoControl.value="";}}
if(this.JobInformation_aapGroupControl){if(view.AAPJobGroupId>0){this.JobInformation_aapGroupControl.value=view.AAPJobGroupId;}
else{this.JobInformation_aapGroupControl.value="";}}
if(this.JobInformation_adaptControl!=null){this.JobInformation_adaptControl.checked=view.Adapt;}
if(this.JobInformation_proDiversityLogoControl!=null){this.JobInformation_proDiversityLogoControl.checked=view.ProDiversityLogo;}
if(this.JobInformation_AdAgencyControl){if(view.IsAdAgencyClientPosting){this.JobInformation_rbAdAgencyClientControl.checked=true;this.JobInformation_rbAdAgencyControl.checked=false;if(this.JobInformation_IONumberControl!=null){this.JobInformation_IONumberControl.value=view.IONumber;}
if(this.JobInformation_AdAgencydivIONumberControl){this.JobInformation_AdAgencydivIONumberControl.style.display='block';}}
else{this.JobInformation_rbAdAgencyClientControl.checked=false;this.JobInformation_rbAdAgencyControl.checked=true;if(this.JobInformation_AdAgencydivIONumberControl.style){this.JobInformation_AdAgencydivIONumberControl.style.display='none';}}}
if(view.ReferenceCode!==null){if(view.ReferenceCode.length>0){this.JobInformation_txtRefCode.value=view.ReferenceCode;}
else{this.JobInformation_txtRefCode.value="";}}},TriggerDescriptionTitleBox:function(){this._dataStore.set_property("JobDescriptionTitlePopulate",{value:this.JobInformation_jobTitleControl.value});this.ShowError(this.JobInformation_jobTitleControl,false);},showScreen:function(element,display){if(element!=null){if(display==true)
element.style.display='block';else
element.style.display='none';}},clearCityStateScreen:function(){this.get_JobInformation_stateControl().selectedIndex=0;this.get_JobInformation_cityControl().value="";this.get_JobInformation_zipCodeControl().value="";},clearCountry:function(){this.get_JobInformation_countryControl().selectedIndex=0;},clearRadios:function(){this.get_JobInformation_radioBtn1().checked=false;this.get_JobInformation_radioBtn2().checked=false;this.get_JobInformation_radioBtn3().checked=false;},ScreenFilter:function(element,flag){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){element=this.value;flag=true;}
switch(element){case me.get_JobInformation_USTag():if(me.get_JobInformation_USTag().className!="location-like-label"){me.showScreen(me.get_JobInformation_CityStateZipScreen(),flag);me.showScreen(me.get_JobInformation_CountryScreen(),!flag);me.showScreen(me.get_JobInformation_NoLocationScreen(),!flag);me.showScreen(me.get_JobInformation_LocationNoFixedRecommend(),!flag);me.clearCityStateScreen();me.clearRadios();me.clearCountry();me.get_JobInformation_USTag().className="location-like-label";me.get_JobInformation_IntTag().className="location-like-link";me.get_JobInformation_NoFixTag().className="location-like-link";me.get_JobInformation_lblZipCode().parentNode.style.display="";if(me.get_DefaultCountry()=="164"){me.get_JobInformation_lblZipCode().innerHTML=me.get_JobInformation_zipCodeText();$get(me.get_JobInformation_stateMessageName()).innerHTML=me.get_JobInformation_stateText();me.showScreen(me.get_JobInformation_LocationDefaultRecommend(),flag);me.showScreen(me.get_JobInformation_LocationIntlRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationNoRegionRecommend(),!flag);}
else{me.get_JobInformation_lblZipCode().innerHTML=me.get_JobInformation_postalCodeText();if(me.get_DefaultCountry()=="8")
$get(me.get_JobInformation_stateMessageName()).innerHTML=me.get_JobInformation_stateText();else
$get(me.get_JobInformation_stateMessageName()).innerHTML=me.get_JobInformation_regionText();me.showScreen(me.get_JobInformation_LocationDefaultRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationIntlRecommend(),flag);me.showScreen(me.get_JobInformation_LocationNoRegionRecommend(),!flag);}
me.RouteEvents(me.JobInformation_USTag);me.OnLocationCountryChange();if(me.JobInformation_findZipLink&&typeof(me.JobInformation_findZipLink.style)!="undefined"){me.JobInformation_findZipLink.style.display="";}}
break;case me.get_JobInformation_IntTag():if(me.get_JobInformation_IntTag().className!="location-like-label"){me.showScreen(me.get_JobInformation_CityStateZipScreen(),flag);me.showScreen(me.get_JobInformation_CountryScreen(),flag);me.showScreen(me.get_JobInformation_NoLocationScreen(),!flag);me.showScreen(me.get_JobInformation_LocationDefaultRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationIntlRecommend(),flag);me.showScreen(me.get_JobInformation_LocationNoFixedRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationNoRegionRecommend(),!flag);me.clearRadios();me.clearCityStateScreen();me.clearCountry();me.get_JobInformation_USTag().className="location-like-link";me.get_JobInformation_IntTag().className="location-like-label";me.get_JobInformation_NoFixTag().className="location-like-link";me.get_JobInformation_stateMessageName().innerHTML=me.get_JobInformation_regionText();me.get_JobInformation_lblZipCode().innerHTML=me.get_JobInformation_postalCodeText();$get(me.get_JobInformation_stateMessageName()).innerHTML=me.get_JobInformation_regionText();var stateList=me.get_JobInformation_stateControl();for(var count=stateList.options.length-1;count>-1;count--){stateList.options[count]=null;}
me.RouteEvents(me.JobInformation_IntTag);if(me.JobInformation_findZipLink&&typeof(me.JobInformation_findZipLink.style)!="undefined"){me.JobInformation_findZipLink.style.display="none";}}
break;case me.get_JobInformation_NoFixTag():if(me.get_JobInformation_NoFixTag().className!="location-like-label"){me.showScreen(me.get_JobInformation_CityStateZipScreen(),!flag);me.showScreen(me.get_JobInformation_CountryScreen(),!flag);me.showScreen(me.get_JobInformation_NoLocationScreen(),flag);me.showScreen(me.get_JobInformation_LocationDefaultRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationIntlRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationNoRegionRecommend(),!flag);me.showScreen(me.get_JobInformation_LocationNoFixedRecommend(),flag);me.clearCityStateScreen();me.clearCountry();me.get_JobInformation_USTag().className="location-like-link";me.get_JobInformation_IntTag().className="location-like-link";me.get_JobInformation_NoFixTag().className="location-like-label";me.RouteEvents(me.JobInformation_NoFixTag);}
break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"SendJobInformation":userContext.onJobInformationSuccessSend(result);break;case"GetStateListByCountryId":userContext.onJobLocationCountrySuccess(result,userContext,null);break;case"GetCityStateByCountryAndZipCode":userContext.CityStateRetrieveSucceededCallback(result,null,userContext);break;case"GetAdAgencyData":if(result!=null)
userContext._dataStore.set_property("LoadAdAjency",result);break;default:break;}},OnFailure:function(result,userContext,methodName){switch(methodName){case"GetStateListByCountryId":break;case"GetCityStateByCountryAndZipCode":break;case"GetAdAgencyData":break;default:break;}},onFailure:function(result,userContext,methodName){},IsNotEmpty:function(str){if(str.length>0)
return true;else
return false;},BlankClass:function(element){if(element!=null)
element.className="";},onZipCode:function(value){if(this.get_JobInformation_countryControl()&&this.get_JobInformation_stateControl())
if(value!=""){this.GetCityState(this.get_JobInformation_countryControl().value,value);}},GetCityState:function(countryID,zipCode){if(countryID===null||countryID===""){countryID=this.get_DefaultCountry();}
this._webService=Services.GeographyLocation.Location;this.callServer("GetCityStateByCountryAndZipCode",[countryID,zipCode]);},AdAgencyAlert:function(event){var me=(typeof(this.instance)!=='undefined')?this.instance:this;var _passAgr=null;if(this.value!=null||this.value!=undefined){_passAgr=this.value[0];}
var msg=me.get_AdAjencyAlert();var answer=confirm(msg.trim());if(answer){me.AdAgencyClientChoosen(_passAgr);if(_passAgr){me._dataStore.set_property("ClearAdAjency",1);}
else{me._dataStore.set_property("GetCommonData");var pid=me._dataStore.get_property("CommonPostingID");me.callServer("GetAdAgencyData",[pid]);}}
else{event.preventDefault();return false;}},resetAdAgencyIsEditingPart:function(){this.JobInformation_AdAgencyIsEditingPart=0;},setJobInformationAdAgencyChange:function(_isChange){this.JobInformation_AdAgencyChange=_isChange;return;},HasJobInformationAdAgencyChanged:function(){return this.JobInformation_AdAgencyChange;},AdAgencyClientChoosen:function(isVisible){if(isVisible){if(this.get_JobInformation_AdAgencydivIONumberControl()!=null){this.get_JobInformation_AdAgencydivIONumberControl().style.display='block';return;}}
else{if(this.get_JobInformation_AdAgencydivIONumberControl()!=null){this.get_JobInformation_AdAgencydivIONumberControl().style.display='none';}
if(this.get_JobInformation_IONumberControl()!=null){this.get_JobInformation_IONumberControl().value='';}}},CityStateRetrieveSucceededCallback:function(result,eventArgs,usercontext){if(result[0]!=null&&result[1]!=null){var _stateControl=$get(this.JobInformation_stateControl.id);var _cityControl=$get(this.JobInformation_cityControl.id);if(_cityControl.value==""&&_stateControl.selectedIndex==0){_cityControl.value=result[0];for(var i=0;i<_stateControl.length;i++){if(_stateControl[i].value==result[1]){_stateControl.selectedIndex=i;break;}}
this.onUpdateStateControl();this.onUpdateCityControl();}}},BuildJobInformationViewObject:function(){var view=new Presenters.JPW.DTO.JobInformationView();view.JobTitle=this.get_JobInformation_jobTitleControl().value;jQuery.data(document.body,"PreviewJobTitle",this.get_JobInformation_jobTitleControl().value);var addressData=new Presenters.JPW.DTO.AddressView();if(this.JobInformation_NoLocationScreen.style.display=="block"){view.LocationType=this.GetSelectedAreaOptions();}
else{view.LocationType=1;addressData=this.JobInformation_GetAddressData();}
view.Address=addressData;view.SelectedJobStatus=this.JobInformation_jobStatusesControl.value;if(this.JobInformation_jobTypesControl!=null){view.SelectedJobType=this.JobInformation_jobTypesControl.value;}
if(this.get_JobInformation_minWageControl()!=null&&this.get_JobInformation_maxWageControl()!=null&&this.get_JobInformation_currencyTypeControl()!=null&&this.get_JobInformation_salaryTypeControl()!=null){var salaryData=new Presenters.JPW.DTO.SalaryView();salaryData.MinimalWage=this.get_JobInformation_minWageControl().value!=this.get_JobInformation_salaryRangeMinText()?this.get_JobInformation_minWageControl().value:"";salaryData.MaximalWage=this.get_JobInformation_maxWageControl().value!=this.get_JobInformation_salaryRangeMaxText()?this.get_JobInformation_maxWageControl().value:"";salaryData.CurrencyId=parseInt(this.get_JobInformation_currencyTypeControl().value);salaryData.SalaryTypeId=parseInt(this.get_JobInformation_salaryTypeControl().value);if(this.get_JobInformation_salaryDescControl()!=null){salaryData.SalaryDescription=this.get_JobInformation_salaryDescControl().value==this.get_JobInformation_otherSalaryInfoDefaultText()?"":this.get_JobInformation_salaryDescControl().value;}
else{salaryData.SalaryDescription="";}
view.Salary=salaryData;}
if(this.JobInformation_CheckIntValue(this.get_JobInformation_careerControl())){view.CareerLevelId=parseInt(this.get_JobInformation_careerControl().value);}
if(this.get_JobInformation_salaryDescControl()!=null){if((this.get_JobInformation_salaryDescControl().value.trim().length>0)&&(this.get_JobInformation_salaryDescControl().value!=this.get_JobInformation_otherSalaryInfoDefaultText())){view.Salary.SalaryDescription=this.get_JobInformation_salaryDescControl().value;}}
if(this.JobInformation_CheckIntValue(this.get_JobInformation_workExperienceControl())){view.RelevantWorkExperienceId=parseInt(this.get_JobInformation_workExperienceControl().value);var k=this.get_JobInformation_workExperienceControl().selectedIndex;jQuery.data(document.body,"PreviewExperience",this.get_JobInformation_workExperienceControl().options[k].text);}
if(this.JobInformation_CheckIntValue(this.get_JobInformation_educationControl())){view.EducationLevelId=parseInt(this.get_JobInformation_educationControl().value);}
if(this.get_JobInformation_eecoControl()){if(this.JobInformation_CheckIntValue(this.get_JobInformation_eecoControl())){view.EEOCJobCatId=parseInt(this.get_JobInformation_eecoControl().value);}}
if(this.get_JobInformation_aapGroupControl()){if(this.JobInformation_CheckIntValue(this.get_JobInformation_aapGroupControl())){view.AAPJobGroupId=parseInt(this.get_JobInformation_aapGroupControl().value);}}
if(this.get_JobInformation_adaptControl()!=null&&this.get_JobInformation_adaptControl().style){if(this.get_JobInformation_adaptControl()!=null){view.Adapt=this.get_JobInformation_adaptControl().checked;}
else{view.Adapt=false;}}
if(this.get_JobInformation_proDiversityLogoControl()!=null&&this.get_JobInformation_proDiversityLogoControl().style){if(this.get_JobInformation_proDiversityLogoControl()!=null){view.ProDiversityLogo=this.get_JobInformation_proDiversityLogoControl().checked;}
else{view.ProDiversityLogo=false;}}
if(this.get_JobInformation_AdAgencyControl()!=null){if(this.get_JobInformation_rbAdAgencyClientControl().checked==true){view.IsAdAgencyClientPosting=true;view.IONumber=this.get_JobInformation_IONumberControl().value;}
else{view.IsAdAgencyClientPosting=false;view.IONumber="";}}
else{view.IsAdAgencyClientPosting=false;}
if(this.get_JobInformation_txtRefCode().value!=undefined){if(this.get_JobInformation_txtRefCode().value.trim().length>0){view.ReferenceCode=this.get_JobInformation_txtRefCode().value;}}
return view;},JobInformation_GetAddressData:function(){var addressData=new Presenters.JPW.DTO.AddressView();addressData.ZipCode=this.get_JobInformation_zipCodeControl().value;addressData.City=this.get_JobInformation_cityControl().value;var addressInfo={Country:null,City:null,State:null,Zip:null};if(this.get_JobInformation_stateControl()&&this.JobInformation_CheckIntValue(this.get_JobInformation_stateControl())){addressData.StateId=parseInt(this.get_JobInformation_stateControl().value);var k=this.get_JobInformation_stateControl().selectedIndex;addressInfo.State=this.get_JobInformation_stateControl().options[k].text;}
if(this.get_JobInformation_countryControl()&&this.JobInformation_CheckIntValue(this.get_JobInformation_countryControl())){addressData.CountryId=parseInt(this.get_JobInformation_countryControl().value);var k=this.get_JobInformation_countryControl().selectedIndex;addressInfo.Country=this.get_JobInformation_countryControl().options[k].text;}
else{addressData.CountryId=this.get_DefaultCountry();addressInfo.Country="";}
addressInfo.City=this.get_JobInformation_cityControl().value;addressInfo.Zip=this.get_JobInformation_zipCodeControl().value;jQuery.data(document.body,"PreviewAddress",addressInfo);return addressData},JobInformation_CheckIntValue:function(control){if(control!=null&&!(isNaN(parseInt(control.value)))){return true;}
else{return false;}},locationChoosen:function(status){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){status=this.value;}
var shouldTelecomuteWarningBeVisible=(me.GetSelectedAreaOptions()==3);if(shouldTelecomuteWarningBeVisible){me.get_JobInformation_telecommuteDiv().style.display="";}
else{me.get_JobInformation_telecommuteDiv().style.display="none";}},SelectAreaOptions:function(index){switch(index){case parseInt(this.get_JobInformation_radioBtn1().value):this.get_JobInformation_radioBtn1().checked=true;this.locationChoosen(true);break;case parseInt(this.get_JobInformation_radioBtn2().value):this.get_JobInformation_radioBtn2().checked=true;this.locationChoosen(true);break;case parseInt(this.get_JobInformation_radioBtn3().value):this.get_JobInformation_radioBtn3().checked=true;this.locationChoosen(true);break;default:break;}},GetSelectedAreaOptions:function(){var index=4;if(this.get_JobInformation_radioBtn1().checked){index=this.get_JobInformation_radioBtn1().value;}
else if(this.get_JobInformation_radioBtn2().checked){index=this.get_JobInformation_radioBtn2().value;}
else if(this.get_JobInformation_radioBtn3().checked){index=this.get_JobInformation_radioBtn3().value;}
return index;},DisableJobLocation:function(status){this.get_JobInformation_cityControl().disabled=status?'disabled':'';if(this.get_JobInformation_countryControl())this.get_JobInformation_countryControl().disabled=status?'disabled':'';if(this.get_JobInformation_stateControl())this.get_JobInformation_stateControl().disabled=status?'disabled':'';this.get_JobInformation_zipCodeControl().disabled=status?'disabled':'';this.get_JobInformation_streetAddress1Control().disabled=status?'disabled':'';this.get_JobInformation_streetAddress2Control().disabled=status?'disabled':'';},GetRelatedInfo:function(){city=this.get_JobInformation_cityControl().value.trim();state=this.get_JobInformation_stateControl?this.get_JobInformation_stateControl().value:'';zipCode=this.get_JobInformation_zipCodeControl().value.trim();jobTitle=this.get_JobInformation_jobTitleControl().value.trim();if(city.length>0&&state.length>0&&zipCode.length==0){Services.GeographyLocation.Location.GetZipCode(city,state,this.OnGetZipCodeComplete);}},onUpdateStateControl:function(){this._dataStore.set_property("ModifyContact",["STATE",this.get_JobInformation_stateControl().value,this.IsTempUser]);},onUpdateCityControl:function(){this._dataStore.set_property("ModifyContact",["CITY",this.get_JobInformation_cityControl().value,this.IsTempUser]);},onUpdateAddress1Control:function(){this._dataStore.set_property("ModifyContact",["ADDR1",this.get_JobInformation_streetAddress1Control().value,this.IsTempUser]);},OnGetZipCodeComplete:function(result,eventArgs){if(result.length>0){this.get_JobInformation_zipCodeControl().value=result;}},DisablePhysicalLocation:function(status){if(status=='True'){this.get_JobInformation_radioBtn0().checked=true;this.DisableJobLocation(false);}
this.get_JobInformation_radioBtn1().disabled=status=='True'?'disabled':'';this.get_JobInformation_radioBtn2().disabled=status=='True'?'disabled':'';this.get_JobInformation_radioBtn3().disabled=status=='True'?'disabled':'';if(this.get_JobInformation_telecommuteDiv().style.display!='none'&&status=='True'){this.get_JobInformation_telecommuteDiv().style.display='none';}},SetDefaultTextFocus:function(index){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){index=this.value;}
me.DetermineInput(index);if(me.JobInformation_inputData.value.trim()==me.get_JobInformation_otherSalaryInfoDefaultText()||me.JobInformation_inputData.value.trim()==me.get_JobInformation_salaryRangeMinText()||me.JobInformation_inputData.value.trim()==me.get_JobInformation_salaryRangeMaxText()){me.JobInformation_inputData.value="";}
me.JobInformation_inputData.style.color='#000000';},DetermineInput:function(index){switch(index){case 1:this.JobInformation_inputData=this.get_JobInformation_minWageControl();break;case 2:this.JobInformation_inputData=this.get_JobInformation_maxWageControl();break;case 3:this.JobInformation_inputData=this.get_JobInformation_salaryDescControl();break;default:this.JobInformation_inputData=null;}},SetDefaultTextBlur:function(index){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){index=this.value;}
me.DetermineInput(index);if(me.JobInformation_inputData){if(me.JobInformation_inputData.value==null||me.JobInformation_inputData.value.trim()==""||me.JobInformation_inputData.value.trim()==me.GetInputDefaultText(index)){me.JobInformation_inputData.value=me.GetInputDefaultText(index);me.JobInformation_inputData.style.color='#C2C2C2';}
else{me.JobInformation_inputData.style.color='#000000';}}
if(me.JobInformation_inputData!=this.JobInformation_salaryDescControl){var isError=me.ValidateSalaryRange(me.JobInformation_minWageControl);if(isError==true){me.ShowValidatorDisplay("ErrorSalaryRange",true);}
else{isError=me.ValidateSalaryRange(me.JobInformation_maxWageControl);if(isError){me.ShowValidatorDisplay("ErrorSalaryRange",true);}
else{me.ShowValidatorDisplay("ErrorSalaryRange",false);}}}},ShowValidatorDisplay:function(errorLabel,status){var message=null;var popLocation=null;switch(errorLabel){case"ErrorSalaryRange":popLocation=Sys.UI.DomElement.getBounds(this.JobInformation_salaryTypeControl);message=this.SALARY_RANGE_ERROR_MESSAGE_ID;break;case"ErrorZip":popLocation=Sys.UI.DomElement.getBounds(this.JobInformation_zipCodeControl);message=this.HOURS_PER_WEEK_ERROR_MESSAGE_ID;break;default:break;}
if(message!=null&&popLocation!=null){popupErrorText.innerHTML=message;var xPoint,yPoint;if(Sys.Browser.agent==Sys.Browser.InternetExplorer){xPoint=this.JobInformation_salaryTypeControl.parentNode.offsetLeft+295;yPoint=popLocation.y-12;}
else{xPoint=this.JobInformation_salaryTypeControl.parentNode.offsetLeft+160;yPoint=popLocation.y+4;}
Sys.UI.DomElement.setLocation(modLayer,xPoint,yPoint);if(status==true){modLayer.style.display="block";if(Sys.Browser.agent==Sys.Browser.InternetExplorer){valIframe.style.display="block";valIframe.style.height=modLayer.clientHeight-6+"px";valIframe.style.width=modLayer.clientWidth+"px";}}else{modLayer.style.display="none";}}},GetInputDefaultText:function(index){var default_text;switch(index){case 1:default_text=this.get_JobInformation_salaryRangeMinText();break;case 2:default_text=this.get_JobInformation_salaryRangeMaxText();break;case 3:default_text=this.get_JobInformation_otherSalaryInfoDefaultText();break;}
return default_text;},ValidateSalaryRange:function(element){var errsalary=false;var salary=element.value;var salarymax=this.JobInformation_maxWageControl.value;var salarymin=this.JobInformation_minWageControl.value;var salnum='';var salnum2='';var comparetype="NONE";switch(element){case this.JobInformation_minWageControl:if(salary.length!=0&&salary!=this.JobInformation_salaryRangeMinText){salnum=this.GetSalaryNumeric(salary);}
if(salarymax.length!=0&&salarymax!=this.JobInformation_salaryRangeMaxText){salnum2=this.GetSalaryNumeric(salarymax);}
if(salnum2>=0&&salnum2!=''&&salnum!=''){comparetype="MAXCHECK";}
break;case this.JobInformation_maxWageControl:if(salary.length!=0&&salary!=this.JobInformation_salaryRangeMaxText){salnum=this.GetSalaryNumeric(salary);}
if(salarymin.length!=0&&salarymin!=this.JobInformation_salaryRangeMinText){salnum2=this.GetSalaryNumeric(salarymin);}
if(salnum2>=0&&salnum2!=''&&salnum!=''){comparetype="MINCHECK";}
break;default:break;}
if((salnum<=0||salnum=="NO_VALID_NUMBER")&&(salnum!='')){errsalary=true;}
else{errsalary=false;switch(comparetype){case"MAXCHECK":if(salnum2<salnum)
errsalary=true;break;case"MINCHECK":if(salnum2>salnum)
errsalary=true;break;default:break;}}
this.ToggleIcon(element,errsalary);return errsalary;},GetSalaryNumeric:function(salary){var salarynumeric=0;for(var i=0;i<salary.length;i++){if(isNaN(salary.charAt(i))){if(salary.charAt(i)=='.'){salarynumeric=salarynumeric+salary.charAt(i)}
else if(salary.charAt(i)!=','){salarynumeric="NO_VALID_NUMBER";break;}}
else{salarynumeric=salarynumeric+salary.charAt(i)}}
if(salarynumeric==""){salarynumeric="NO_VALID_NUMBER";}
return(salarynumeric*1);},ToggleIcon:function(element,flag){var icontag=null;switch(element){case this.JobInformation_minWageControl:case this.JobInformation_maxWageControl:icontag="errorSalaryRange";break;case this.JobInformation_jobTitleControl:icontag="errorJobTitle";break;case this.JobInformation_zipCodeControl:icontag="errorZip";break;default:break;}
if(icontag!=null){if(flag==true){$get(icontag).style.display="inline";}else{$get(icontag).style.display="none";}}},OnLocationCountryChange:function(){var cdValue=null;var index=1;if(this.JobInformation_CountryScreen.style.display!="block"){cdValue=this.get_DefaultCountry();}
else{cdValue=this.get_JobInformation_countryControl().value;if(this.JobInformation_countryControl.selectedIndex==0)
index=0;this.RouteEvents(this.JobInformation_countryControl);}
this._dataStore.set_property("GetCommonData");var pid=this._dataStore.get_property("CommonPostingID");if(this.IsNotEmpty(cdValue)&&!isNaN(cdValue)){countryId=parseInt(cdValue);}
if(index==0){var stateList=this.get_JobInformation_stateControl();for(var count=stateList.options.length-1;count>-1;count--){stateList.options[count]=null;}}
else{this._webService=EBiz.Services.JPW.JobDetailsService;this.callServer("GetStateListByCountryId",[pid,countryId]);}},onJobLocationCountrySuccess:function(result,userContext,eventArgs){var stateList=userContext.get_JobInformation_stateControl();var i=0;for(var count=stateList.options.length-1;count>-1;count--){stateList.options[count]=null;}
if(result!=null){for(var item in result){if(result[item].Value==""){result[item].Text=this.DefaultSelect;}
if(result[item].Text!=null&&result[item].Value!=null){var optionItemName=new Option(result[item].Text,result[item].Value,false,false);stateList.options[i]=optionItemName;i++;}}
userContext.get_JobInformation_stateElement().style.display="list-item";if(result.length==1&&result[0].Value==""){userContext.get_JobInformation_stateElement().style.display="none";this.showScreen(this.get_JobInformation_LocationNoRegionRecommend(),true);this.showScreen(this.get_JobInformation_LocationIntlRecommend(),false);}
else{this.showScreen(this.get_JobInformation_LocationNoRegionRecommend(),false);if(this.get_JobInformation_IntTag().className=="location-like-label")
this.showScreen(this.get_JobInformation_LocationIntlRecommend(),true);}
if(userContext.get_JobInformation_zipCodeControl()!=null)
userContext.get_JobInformation_zipCodeControl().value='';if(userContext.get_JobInformation_cityControl()!=null)
userContext.get_JobInformation_cityControl().value='';}
else{userContext.get_JobInformation_stateElement().style.display="none";this.clearCityStateScreen();}
if(userContext.get_JobInformation_stateControl()){userContext.get_JobInformation_stateControl().selectedvalue=0;var StateID=this._dataStore.get_property("SelectedState");if(StateID){userContext.get_JobInformation_stateControl().value=StateID;this._dataStore.set_property("SelectedState","");}}
this.bindPostalCodeFormatingMask();},bindPostalCodeFormatingMask:function(){var me=(typeof(this.instance)!=='undefined')?this.instance:this;zipCodeFormating.bindPostalCodeEvents(me.JobInformation_GetAddressData().CountryId,me.JobInformation_zipCodeControl);},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.JobInformation_minWageControl:case this.JobInformation_maxWageControl:labelTag="lblSalary";iconTag="errorSalaryRange";break;case this.JobInformation_jobTitleControl:labelTag="lbljobtitle";iconTag="errorJobTitle";break;case this.JobInformation_careerControl:labelTag="lblCareerLevel";iconTag="errorCareerLevel";break;case this.JobInformation_IONumberControl:labelTag="lblIONumber";iconTag="errorIONumber";break;case this.JobInformation_zipCodeControl:labelTag="lblJobLocation";iconTag="errorZip";break;case this.JobInformation_jobTypesControl:labelTag="lblJobTypes";iconTag="errorJobTypes";break;case this.JobInformation_eecoControl:labelTag="lblEEOExp";iconTag="errorEEOClassification";break;case this.JobInformation_aapGroupControl:labelTag="lblAAPInformation";iconTag="errorAAPInfo";break;case this.JobInformation_EducationLevelConst:labelTag="lblEducationLevel";iconTag="errorEducationLevel";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}},OpenSalaryBenchmark:function(event){var me=(typeof(this.instance)!=='undefined')?this.instance:this;var popupUrl=me.JobInformation_salaryBenchmarkPopupUrl;var industryElems;var industryValue="";var industryText="";var separator="";me._dataStore.set_property("GetIndustriesIDForSalaryBenchmark");industryElems=me._dataStore.get_property("IndustriesID");for(var i=0;i<industryElems.length;i++){separator=(i==industryElems.length-1)?"":",";if(industryElems[i].selectedIndex>0){industryValue=industryValue+industryElems[i].value+separator;industryText=industryText+industryElems[i].options[industryElems[i].selectedIndex].text+separator;}}
if(industryValue.charAt(industryValue.length-1)==","){industryValue=industryValue.substring(0,industryValue.length-1);}
if(industryText.charAt(industryText.length-1)==","){industryText=industryText.substring(0,industryText.length-1);}
var provinceElem,provinceValue,provinceText,cityElem,cityText;if(me.get_JobInformation_CityStateZipScreen().style.display=="block"){provinceElem=me.get_JobInformation_stateControl();provinceValue=provinceElem.value;if(provinceElem.selectedIndex<=0){provinceText="";}else{provinceText=provinceElem.options[provinceElem.selectedIndex].text;}
cityElem=me.get_JobInformation_cityControl();cityText=cityElem.value;}else{provinceValue="";provinceText="";cityText="";}
popupUrl=popupUrl.replace("{0}",encodeURIComponent(industryValue)).replace("{1}",encodeURIComponent(provinceValue)).replace("{2}",encodeURIComponent(cityText)).replace("{3}",encodeURIComponent(industryText)).replace("{4}",encodeURIComponent(provinceText));window.open(popupUrl,"SalaryBenchmarkPopup","width=894,height=359,resizable=no,scrollbars=no");dcsMultiTrack('WT.z_clicktype','salbench');}}
Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsInformationAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter=function(element){this._createStart=new Date();Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter.initializeBase(this,[element]);this._createEnd=new Date();this._promptType={overwrite:overrideDesscriptionPrompt,clear:clearDescriptionPrompt};this._contextJQ=null;this.Mocs=null;this.MocStore=[];this.selectedMOC=null;this.reqErrors=[];this._allowNoResultsMsg=true;this._editor=null;this._fileUploaderJQ=null;this._hiddenfileNameJQ=null;this._hiddenfileNameToPersistJQ=null;this._fileUploaderUIEnabled;this.createProperty("wordCountLabel");this.createProperty("charCountLabel");this.createProperty("messageDescriptionInstruction");this.createProperty("msgLinkText");this.createProperty("msgLinkURL");this.createProperty("msgLinkNew");this.createProperty("msgLinkBtnCancel");this.createProperty("msgLinkBtnInsertLink");this.createProperty("jobDescMinimumLength");this.createProperty("enableMocLookup");this.createProperty("divMonsterStatisticsControlID");this.createProperty("jobTitleControlID");this.createProperty("editorControlID");this.createProperty("hiddenMocControlID");this.createProperty("postingid");this.createProperty("JOB_DESCRIPTION_ERROR_MESSAGE_ID");this.createProperty("IsMHxSlotJob");this.createProperty("fileUploaderEnabled");this.createProperty("fileUploadPersistEnabled");this.createProperty("btnClearControlID");this.createProperty("fileUploaderControlID");this.createProperty("hiddenfileNameControlID");this.createProperty("hiddenfileNameToPersistControlID");this.createProperty("fileUploaderPreviewMsg");this.createProperty("divFileUploadControlID");this.createProperty("divShortcutSeperatorControlID");this.createProperty("pShortcutHeaderControlID");this.createProperty("JobDesc_lblJobDescription");this.createProperty("JobDesc_jobTitle");this.createProperty("JobDesc_rcJobDescriptions");this.createProperty("btnSearch");this.createProperty("mocSearchPanel");this.createProperty("dvJDlockMonsSecurityMessage");this.set_jobDescMinimumLength(parseInt(this.get_jobDescMinimumLength()));this.set_enableMocLookup(this.get_enableMocLookup()=='true');}
Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter.prototype={initialize:function(){this._initStart=new Date();this.addTelerikCommands();this._contextJQ=$(this._element);this._editor=$find(this.editorControlID);var theEditor=this._editor;theEditor.set_stripFormattingOptions(Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage);window.setTimeout(function(){var localizationCollection=theEditor._localization;var fontNameToolButton=theEditor.getToolByName("FontName");if(fontNameToolButton)fontNameToolButton._text=localizationCollection["fontname"];var fontSizeToolButton=theEditor.getToolByName("RealFontSize");if(fontSizeToolButton)fontSizeToolButton._text=localizationCollection["realfontsize"];},300);if(this.fileUploaderEnabled){this.fileUploaderEnabled=this.fileUploaderEnabled=='true';}
this._fileUploaderUIEnabled=this.fileUploaderEnabled;if(this.fileUploadPersistEnabled){this.fileUploadPersistEnabled=this.fileUploadPersistEnabled=='true';}
if(this._fileUploaderUIEnabled){this._fileUploaderJQ=this._contextJQ.find('#'+this.fileUploaderControlID);if(this._fileUploaderJQ[0]&&$.fn.hxfileuploader){var self=this;this._fileUploaderJQ.onFileUploadSuccess(function(e,result){self.onFileUploadSuccess(e,result);}).onFileUploadInputChange(function(e,fileName){self.onFileUploadInputChange(e,fileName);}).onFileUploadInputClicked(function(e){self.onFileUploadInputClicked(e);});var btnClearElement=$get(this.btnClearControlID);if(btnClearElement){$addHandlers(btnClearElement,{click:this.onClearClicked},{instance:this});}
this._contextJQ.bind('sessionfilenamechanged',function(e,value){self.onSessionFileNameChanged(e,value);});}else{this.fileUploaderEnabled=false;this._fileUploaderUIEnabled=this.fileUploaderEnabled;}}
var prevLink=$('a#wordJobDescriptionPreview');if(prevLink[0]!=null){prevLink[0].href="javascript:var MONSPREVHANDLER=window.open('', 'prevWindow1');void(0);";}
Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._initEnd=new Date();this._webService=EBiz.Services.JPW.JobDetailsService;this.registerDataProperty("JobDescriptionTitlePopulate");this.registerDataProperty("UberDetailsObject");this.registerDataProperty("GetDescriptionView");this.registerDataProperty("LoadData");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("JobDescriptionIsVisible");this.registerDataProperty("JobDesc_DataTransformationImpact");this.registerDataProperty("DisableDescription");this.registerDataProperty("SetValidationErrors");this.registerDataProperty("ReplaceJobDesc");this.registerDataProperty("GetJobDescriptionFileForPreviewRequest");},dispose:function(){if(MonsPageManager.initState(this._id)){}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"JobDescriptionTitlePopulate":if(!this._editor){this._editor=$find(this.editorControlID);}
var editorContents=this._editor.get_text();if(editorContents){editorContents=editorContents.trim();}
if(editorContents==""||editorContents=="&nbsp;"){this.JobDesc_jobTitle.value=this._dataStore.get_property("JobDescriptionTitlePopulate").value;this.GetMatchingJobDescriptions(this.JobDesc_jobTitle.value,false);}
break;case"ReplaceJobDesc":if(!this._editor){this._editor=$find(this.editorControlID);}
var result=this._dataStore.get_property("ReplaceJobDesc");this._editor.set_html(result);break;case"UberDetailsObject":var view=this.BuildJobDescriptionViewObject();this._dataStore.set_property("GetDescriptionView",view);break;case"LoadData":result=this._dataStore.get_property("LoadData");if(result.JobDescription!=null){this.LoadDescriptionView(result.JobDescription);}
break;case"validateDetailsPage_request":var valPass=this.CheckRequired();this._dataStore.set_property("ValidateDescription",valPass);if((!valPass)&&(this.reqErrors.length>0)){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);}
break;case"JobDescriptionIsVisible":this.JobDesc_rcJobDescriptions.style.display=this._dataStore.get_property("JobDescriptionIsVisible")=="true"?"block":"none";break;case"JobDesc_DataTransformationImpact":var editor=$find(this.editorControlID);var text=editor.get_text().trim();if(text.length>0&&text!="&nbsp;"){this._dataStore.set_property("HasDataTransformationImpact","true");}
break;case"DisableDescription":var editor=$find(this.editorControlID);var temp=this._dataStore.get_property("DisableDescription");editor.set_editable(true);if(temp){editor.set_mode(Telerik.Web.UI.EditModes.Preview);}
else{editor.set_mode(Telerik.Web.UI.EditModes.Design);}
this.toggleFileUploadUI(!temp);break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors");switch(temp.validateElement){case"JobDescription":this.ShowError(this.JobDesc_lblJobDescription,temp.isShow);break;default:break;}
break;case'GetJobDescriptionFileForPreviewRequest':var file=this.getFile();if(file&&file.fileName){this._dataStore.set_property('JobDescriptionFileRetrievedForPreviewRequest',file);}
break;default:break;}},CheckRequired:function(){var isChk=false;this.reqErrors=[];var editor=$find(this.editorControlID);var text=editor.get_text().trim();if(text.length>0&&text!="&nbsp;"){isChk=true;this.ShowError(this.JobDesc_lblJobDescription,false);}
else{isChk=false;this.reqErrors.push(this.get_JOB_DESCRIPTION_ERROR_MESSAGE_ID());this.ShowError(this.JobDesc_lblJobDescription,true);}
return isChk;},LoadDescriptionView:function(view){if(!this._editor){this._editor=$find(this.editorControlID);}
this._editor.set_html(view.JobDescription);this._dataStore.set_property("DisableDescription",view.IsJobDescLocked);this.clearFileUploader();if(view.IsJobDescLocked!=null){this.mocSearchPanel.style.display=(view.IsJobDescLocked==false)?"block":"none";this.dvJDlockMonsSecurityMessage.style.display=(view.IsJobDescLocked==true)?"block":"none";if(view.IsJobDescLocked==false){this._editor.set_editable(true);this._editor.set_mode(Telerik.Web.UI.EditModes.Design);if($('.reEditorModesCell')[0]){$('.reEditorModesCell')[0].style.display="block";}}
else{this._editor.set_editable(false);this._editor.set_mode(Telerik.Web.UI.EditModes.Preview);if($('.reEditorModesCell')[0]){$('.reEditorModesCell')[0].style.display="none";}}}},initHandlers:function(element,event,context){if(element.id!="wordJobDescriptionPreview"){event.preventDefault();}
switch(element.id){case"wordJobDescriptionPreview":$addHandlers(element,{click:this.wordDescriptionPreview},this);if(!$isIE())
this.wordDescriptionPreview(event);break;case"RetMocID":$addHandlers(element,{click:this.prefill},{instance:this,value:element.value});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.prefillDescLinkAdapter(element.value);}
break;case this.btnSearch.id:if(this.JobDesc_jobTitle.value!=""){$addHandlers(element,{click:this.SearchClick},{instance:this,value:this.JobDesc_jobTitle});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.SearchClick(this.JobDesc_jobTitle);}}
break;case this.JobDesc_jobTitle.id:if(event.type=="click"){$addHandlers(element,{keydown:this.catchEnter},this);element.onclick="";}
break;case'preview_'+this.fileUploaderControlID:$addHandlers(element,{click:this.onFileUploadPreviewClicked},this);if(!$isIE()){this.onFileUploadPreviewClicked(event);}
break;default:break;}
var temp;if(element.id.indexOf("jobDescriptionLink")>=0){temp=element.id.split("_");$addHandlers(element,{click:this.showpopup},{instance:this,Fieldptr:element,value:temp[1]});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.popupPreview(element,temp[1]);}}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"GetMocs":if(result!=null){userContext.Mocs=result;var ulElement="";var temp;var pnl=document.getElementById('searchResultsPanel');if(pnl!=null){pnl.innerHTML="";for(moc in userContext.Mocs){temp=userContext.Mocs[moc];if(temp.MocId&&temp.MocId!='undefined')
{userContext.MocStore.push(temp.MocId);ulElement+='<ul><li><a href="#" id="jobDescriptionLink_'+temp.MocId+'" onclick="initClick(this, event, [{adapterID:\''+userContext._id+'\' , context: \'Links\'}]);';ulElement+='">'+temp.JobTitle+'</a></li></ul>';}}
if(userContext.Mocs!=null&&userContext.Mocs.length>0){pnl.innerHTML=ulElement;dcsMultiTrack('DCS.dcsuri','/jobs/MOCDisplayed.evt','DCSext.en','MOCLoad','WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Search'),'WT.z_jpw_ssc','1');}}}
else{var pnl=document.getElementById('searchResultsPanel');if(pnl!=null){if(userContext._allowNoResultsMsg)
pnl.innerHTML=matchNotFound;else
pnl.innerHTML="";}}
break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"onFailureMocMatch":document.getElementById('searchResultsPanel').innerHTML=serviceNotAvailable;break;default:break;}},catchEnter:function(evt){if(evt&&evt.type=="keydown"){var k=(evt.rawEvent.which||evt.rawEvent.keyCode||evt.rawEvent.charCode);if(k==13){evt.preventDefault();evt.stopPropagation();this.btnSearch.click();}
else{return;}}},BuildJobDescriptionViewObject:function(){var view=new Presenters.JPW.DTO.JobDescriptionView();var editor=$find(this.editorControlID);view.MocId=$get(this.get_hiddenMocControlID()).value;this.RemoveSpaceOffFocus(editor);view.JobDescription=editor.get_html();jQuery.data(document.body,"PreviewDescription",editor.get_text());if(this._fileUploaderUIEnabled){view.PersistFile=this.fileUploadPersistEnabled;if(view.PersistFile){var file=this.getFile();if(file&&file.fileName&&file.fileName.length>0){view.FileName=file.fileName}}}
return view;},AddLineBreakSpacing:function(editor){if(document.all){var oDocument=editor._getTextArea();if(editor.get_mode()=="1"){var elementArray=oDocument.getElementsByTagName("p");for(var i=0;i<elementArray.length;i++){if(elementArray[i].innerText==""&&elementArray[i].style.margin==""){elementArray[i].innerHTML=" ";}}}}},RemoveSpaceOffFocus:function(editor){if(editor!=null){if(editor._getTextArea!=null){var contentText="";var contentTextTemp="";var oDocument="";oDocument=editor._contentArea.innerHTML;if(oDocument!=""||oDocument!=null){if(editor.get_mode()=="1"){contentText+=oDocument;contentTextTemp+=oDocument;contentText=contentText.replace(new RegExp('<p></p>','g'),'<p> </p><br />');contentText=contentText.replace(new RegExp('<p>&nbsp;</p>','g'),'<p> </p><br />');contentText=contentText.replace(new RegExp('<br /><br />','g'),'<br />');contentText=contentText.replace(new RegExp('<p class="MsoNormalOverwrite"></p>','g'),'<p> </p><br />');contentText=contentText.replace(new RegExp('<p class="MsoNormalOverwrite">&nbsp;</p>','g'),'<p> </p><br />');contentText=contentText.replace(new RegExp('<br /><br />','g'),'<br />');contentText=contentText.replace(new RegExp('\n','g'),'\n ');if(contentText!=contentTextTemp){editor._contentArea.innerHTML=contentText;}}}}}},GetMatchingJobDescriptions:function(jobTitle,showNoResultsMsg){if(jobTitle.length>0){this._allowNoResultsMsg=showNoResultsMsg;this.callServer("GetMocs",[this.postingid,jobTitle,1,4,58]);}},SearchClick:function(element){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){element=this.value;}
me.GetMatchingJobDescriptions(element.value,true);},prefill:function(event){var me=(typeof(this.instance)!=='undefined')?this.instance:this;this.value=event.target.value;if(this.value!=null|this.value!=undefined){me.prefillDescLinkAdapter(this.value);}},prefillDescLinkAdapter:function(mocId){var blnContinue=true;blnContinue=this.ConfirmJobBodyOverWrite();if(blnContinue){var moc=this.GetMocById(mocId);if(moc){var editor=$find(this.editorControlID);var text=new String(moc.JobDescription);text=text.replace(/\r?\n/g,'<br/>');editor.set_mode(2);editor.set_html(text);editor.set_mode(1);$get(this.get_hiddenMocControlID()).value=moc.MocId;}}},GetMocById:function(moc){if(this.Mocs!=null&&this.Mocs.length>0){for(i in this.Mocs){if(this.Mocs[i].MocId==moc){return this.Mocs[i];break;}}
return null;}},showpopup:function(event){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.Fieldptr!=null&&this.Fieldptr!=undefined&&this.value!=null&&this.value!=undefined){me.popupPreview(this.Fieldptr,this.value);}},popupPreview:function(ctrl,mocId){var jobDescriptionHost=window.location.host;var viewJobDescLocation="http://"+jobDescriptionHost+"/jobs/viewjobdescription.aspx?monsteroc=";dcsMultiTrack('DCS.dcsuri','/jobs/SelectFromMoc.evt','DCSext.en','AutoCompleteMoc','WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Title:View+Description'),'WT.z_jpw_ssc','1');var moc=this.GetMocById(mocId);if(moc){var thisValue,winPop,WinWidth,mocUrl,options;WinWidth="835";mocUrl=viewJobDescLocation+moc.JobTitle+"&moc="+mocId+"&automatchlink="+ctrl.id+"&jobbodyctrl="+this.get_editorControlID()
options="width=907,height=520,scrollbars=1,toolbar=0,directories=0,resizable=yes,left=175,top=50";winPop=window.open(mocUrl,"newPopup",options);winPop.focus();}},wordDescriptionPreview:function(event){this._dataStore.set_property("JPW_JOB_DESCRIPTION_PREVIEW_REQUEST",null);event.stopPropagation();},ConfirmJobBodyOverWrite:function(promptType){var prompt=promptType||this._promptType.overwrite;var rte=$find(this.editorControlID);if(rte.get_text().length>0){return confirm(prompt);}else{return true;}},GetCharacterCount:function(){var editor=$find(this.editorControlID);var alertString=characterCountMessage;if(editor){alert(alertString+" "+editor.get_text().trim().replace(/\r\n/g,'').length);}},JobDescription_ClearAll:function(){var jobDescriptionControl=$find(this.editorControlID);if(jobDescriptionControl){jobDescriptionControl.set_html("");AddMonsterStatistics(this._editor);}},IsJobDescriptionLengthValid:function(){if(JobTemplate_tmpDescriptionID!=0){return true;}
var editor=$find(this.editorControlID);return(editor.get_text().trim().replace(/\r\n/g,'').length>=this.get_jobDescMinimumLength());},addTelerikCommands:function(){Telerik.Web.UI.Editor.CommandList["CustomLinkManagerDialog"]=function(commandName,editor,args){this.showCustomLinkManagerDialog(commandName,editor,args);};Telerik.Web.UI.Editor.CommandList["CustomLinkManagerDialogEdit"]=function(commandName,editor,args){this.showCustomLinkManagerDialog(commandName,editor,args);};},showCustomLinkManagerDialog:function(commandName,editor,args){var myElement=editor.getSelectedElement();var windowArgs={};windowArgs.linkHref=myElement.href;windowArgs.linkTarget=myElement.target;if(typeof windowArgs.linkHref=="undefined"){windowArgs.linkText=editor.getSelection().getText();}else{windowArgs.linkText=myElement.innerHTML;}
windowArgs.labelLinkText=(this.get_msgLinkText().length==0)?"Link text":this.get_msgLinkText();windowArgs.labelLinkUrl=(this.get_msgLinkURL.length()==0)?"Link URL":this.get_msgLinkURL();windowArgs.labelLinkNew=(this.get_msgLinkNew.length()==0)?"Open link in a new window.":this.get_msgLinkNew();windowArgs.labelBtnCancel=(this.get_msgLinkBtnCancel()==0)?"Cancel":this.get_msgLinkBtnCancel();windowArgs.labelBtnInsertLink=(this.get_msgLinkBtnInsertLink()==0)?"Insert Link":this.get_msgLinkBtnInsertLink();var myCallbackFunction=function(sender,args){if(myElement.tagName=="A"){myElement.href=args.href;myElement.target=args.target;myElement.innerHTML=args.text;}else{editor.pasteHtml(String.format("<a href=\"{0}\" target=\"{1}\">{2}</a> ",args.href,args.target,args.text))}}
editor.showDialog("CustomLinkManagerDialog",windowArgs,myCallbackFunction);},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.JobDesc_lblJobDescription:labelTag="lblJobDescription";iconTag="errorJobDescription";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';isShow!=true?$get(labelTag).style.fontWeight='normal':$get(labelTag).style.fontWeight='bold';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}},getHiddenFileNameJQ:function(){if(!this._hiddenfileNameJQ){this._hiddenfileNameJQ=this._contextJQ.find('#'+this.hiddenfileNameControlID);}
return this._hiddenfileNameJQ;},getHiddenFileNameToPersistJQ:function(){if(!this._hiddenfileNameToPersistJQ){this._hiddenfileNameToPersistJQ=this._contextJQ.find('#'+this.hiddenfileNameToPersistControlID);}
return this._hiddenfileNameToPersistJQ;},getFile:function(){if(!this._fileUploaderUIEnabled)return null;var file={fileName:null,clearedFileName:null};var hiddenfileNameToPersist=this.getHiddenFileNameToPersistJQ();var fileName=$.trim(hiddenfileNameToPersist.val());if(fileName.length>0){file.fileName=fileName;}
var clearedFileName=this.getHiddenFileNameJQ().data('clearedFileName');if(clearedFileName){clearedFileName=$.trim(clearedFileName);if(clearedFileName.length>0){file.clearedFileName=clearedFileName;}}
return file;},toggleFileUploadUI:function(flag){if(!this.fileUploaderEnabled)return;if(this._fileUploaderUIEnabled===flag)return;this._fileUploaderUIEnabled=flag;var displayStyle=this._fileUploaderUIEnabled?'':'none';var btnClearElement=$get(this.btnClearControlID);if(btnClearElement){btnClearElement.style.display=displayStyle;}
var divFileUploadElement=$get(this.divFileUploadControlID);if(divFileUploadElement){divFileUploadElement.style.display=displayStyle;}
var divShortcutSeperatorElement=$get(this.divShortcutSeperatorControlID);if(divShortcutSeperatorElement){divShortcutSeperatorElement.style.display=displayStyle;}
var pShortcutHeaderElement=$get(this.pShortcutHeaderControlID);if(pShortcutHeaderElement){pShortcutHeaderElement.style.display=displayStyle;}},clearFileUploader:function(){if(!this._fileUploaderUIEnabled)return;this._fileUploaderJQ.clearFileUploader();var hiddenfileNameJQ=this.getHiddenFileNameJQ();var lastSavedFileName=hiddenfileNameJQ.val();if(lastSavedFileName.length>0){hiddenfileNameJQ.data('clearedFileName',lastSavedFileName);}
hiddenfileNameJQ.val('').trigger('sessionfilenamechanged',['']);},setFileUploadHtml:function(html){var fileUploadFilter=this._editor.get_filtersManager().getFilterByName('MonsterFileUploadFilter');if(!fileUploadFilter){fileUploadFilter=new Monster.Telerik.Extensions.FileUploadFilter();this._editor.get_filtersManager().add(fileUploadFilter);fileUploadFilter.Enabled=true;}
this._editor.set_html(html);AddMonsterStatistics(this._editor);this._editor.attachEventHandler("onkeyup",function(e){AddMonsterStatistics(this._editor,e);});},onFileUploadPreviewClicked:function(e){e.stopPropagation();e.preventDefault();this._dataStore.set_property("JPW_JOB_DESCRIPTION_PREVIEW_REQUEST",null);},onClearClicked:function(e){var self=(typeof(this.instance)!=='undefined')?this.instance:this;var confirm=self.ConfirmJobBodyOverWrite(self._promptType.clear);if(confirm){self.JobDescription_ClearAll();self.clearFileUploader();self._dataStore.set_property('JobDescriptionClearRequest');}
e.stopPropagation();e.preventDefault();},onFileUploadInputClicked:function(e){this._dataStore.set_property('JobDescriptionFileBrowseRequest');e.stopPropagation();e.preventDefault();},onFileUploadInputChange:function(e,fileName){this._dataStore.set_property('JobDescriptionFileUploadRequest');e.stopPropagation();e.preventDefault();},onSessionFileNameChanged:function(e,value){this.getHiddenFileNameToPersistJQ().val(value);},onFileUploadSuccess:function(e,result){if(!result)return;var hiddenfileNameJQ=this.getHiddenFileNameJQ();var lastFileName=hiddenfileNameJQ.val();var confirm=this.ConfirmJobBodyOverWrite();if(!confirm){this._fileUploaderJQ.setInputFileName(lastFileName);}else{if(dcsMultiTrack){dcsMultiTrack('WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Continue+After+Word+Doc+Upload'),'WT.z_jpw_ssc','1');}
this._fileUploaderJQ.setInputFileName(result.fileName);hiddenfileNameJQ.val(result.fileName).trigger('sessionfilenamechanged',[result.fileName]);this.setFileUploadHtml(result.html);if(this.fileUploaderPreviewMsg){$.showMessage("Info",[{NodeType:"Information",Value:this.fileUploaderPreviewMsg}]);}}}};Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsDescriptionAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter=function(element){Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter.initializeBase(this,[element]);this._actionDelegates=[];this.reqErrors=[];this.checkfields=null;this.AdAgencyContentInternalEdit=null;this.CompanyNameAndLogoValidationGroupName="CompanyNameAndLogoValidationGroup";this.logoUploadErrorMsg="";this.logoDeleteConfirmMsg="";this.emptyUploadControlErrorMsg="";this.dispCompanyLogoMessage="";this.confidentialMessage="";this.defaultCompanyName="";this.previewPath="";this.viewLogoMsg="";this.deleteLogoMsg="";this.useLogoMsg="";this.selectedLogoID=0;this.jobLogoEnhancementId="";this.encryptedPostingId="";this._folder=null;this.divCompanyLogoDefinition=null;this.logoEnum_UploadNew=null;this.logoEnum_UseMonster=null;this.radioUseLogos=null;this.lblCompanylogo=null;this.isCompanyTemplateVisible=false;this.isInEditMode=false;this.createProperty("logoUploadValidator");this.createProperty("cbxUseLogoFeature");this.createProperty("txtCompanyName");this.createProperty("ckbCompanyConfidentiality");this.createProperty("divConfidentialMsg");this.createProperty("companyNameValidator");this.createProperty("validationSummary");this.createProperty("logoGrid");this.createProperty("lblLogoUploadExceeded");this.createProperty("pnlViewAllLogos");this.createProperty("ifrUpload");this.createProperty("lstCompanyIndusties");this.createProperty("divLogoSelector");this.createProperty("divCompanyLogoEdit");this.createProperty("logoLibraryWindowElement");this.createProperty("lblFileRequirements");this.createProperty("divLogoUploaded");this.createProperty("isUserUploadedLogoPresent");this.createProperty("folderId");this.createProperty("COMPANY_NAME_ERROR_MESSAGE_ID");}
Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter.prototype={initialize:function(){this._initStart=new Date();this.checkfields=[this.txtCompanyName];for(var i=0;i<this.checkfields.length;i++){$addHandler(this.checkfields[i],'keypress',this.onEnterPress);}
Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter.callBaseMethod(this,'initialize');Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter.prototype._instance=this;if(this.logoUploadValidator!=null){this.logoUploadValidator.clientvalidationfunction="$find(\""+this._id+"\").logoUploadValidate";}
this.divCompanyLogoDefinition=$get("companyLogoDefinition",this._targetControl);this.lblCompanylogo=$get("lblCompanylogo",this._targetControl);this.radioUseLogos=document.getElementsByName("cbxUseLogo");this._dataStore.set_property("logoSelector",this.selectedLogoID);this._webService=EBiz.Services.JPW.JobDetailsService;if(this.divCompanyLogoDefinition!=null){this.lblFileRequirements.style.display=this.isUserUploadedLogoPresent?"none":"block";}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this._toggleLogoSelectorDiv();this._toggleLogoUploadedDiv();},GetIndustryValues:function(){this._dataStore.set_property("GetIndustries");var temp=this._dataStore.get_property("IndustriesList");return temp;},_instance:null,initOnDemand:function(){this._initEnd=new Date();this.registerDataProperty("UberDetailsObject");this.registerDataProperty("GetCompanyView");this.registerDataProperty("LoadData");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("LoadAdAjency");this.registerDataProperty("ClearAdAjency");this.registerDataProperty("ResetJobLogoEnhancement");this.registerDataProperty("JobLogoIsVisible");this.registerDataProperty("LogoLibraryClosing");this.registerDataProperty("ValidateJobSave");this.registerDataProperty("GetIndustries");this.registerDataProperty("SetIndustries");this.registerDataProperty("IndustriesList");this.registerDataProperty("OPTIONS_FolderId");this.registerDataProperty("PrePopulateMailDetails");if(this.folderId!=null){this._folder=this.folderId*1;}},dispose:function(){if(MonsPageManager.initState(this._id)){}
for(var i=0,l=this._actionDelegates.length;i<l;i++){var del=this._actionDelegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
delete this._actionDelegates;},RouteEvents:function(element){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){element=this.value;}
me._dataStore.set_property("ModifyContact",["CMPNAME",element.value]);},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":var view=this.buildCompanyInformationViewObject();this._dataStore.set_property("GetCompanyView",view);break;case"LoadData":result=this._dataStore.get_property("LoadData");if(result.CompanyInformation!=null){this.LoadCompanyView(result.CompanyInformation);}
break;case"LoadAdAjency":result=this._dataStore.get_property("LoadAdAjency");if(result.CompanyInformation!=null)
this.LoadCompanyView(result.CompanyInformation);break;case"ClearAdAjency":this.ClearCompanyView();break;case"validateDetailsPage_request":var valPass=false;if(this._dataStore.get_property("ValidateJobSave")){valPass=true;}
else{valPass=this.CheckRequired();}
this._dataStore.set_property("ValidateCompany",valPass);if((!valPass)&&(this.reqErrors.length>0)){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);}
break;case"ResetJobLogoEnhancement":this._dataStore.set_property("selectedEnhancements",[]);this.updateEnhancementValue(this.cbxUseLogoFeature.checked);break;case"JobLogoIsVisible":this.divCompanyLogoEdit.style.display=this._dataStore.get_property("JobLogoIsVisible")=="true"?"block":"none";break;case"LogoLibraryClosing":if(this.logoLibraryWindowElement){var windowAdapter=this.logoLibraryWindowElement._behaviors[0];var saved=this._dataStore.get_property("LogoLibraryClosing");windowAdapter.hideDialog(saved);}
break;case"OPTIONS_FolderId":this._folder=this._dataStore.get_property("OPTIONS_FolderId")*1;break;case"PrePopulateMailDetails":if(this.ckbCompanyConfidentiality.checked){this._dataStore.set_property("ModifyContact",["CMPNAME",""]);}
else{this._dataStore.set_property("ModifyContact",["CMPNAME",this.txtCompanyName.value]);}
break;default:break;}},CheckRequired:function(){var isChk=false;this.reqErrors=[];if((this.txtCompanyName.value!="")&&(this.txtCompanyName.value.length>0)){isChk=true;this.ShowError(this.txtCompanyName,false);}
else{this.reqErrors.push(this.get_COMPANY_NAME_ERROR_MESSAGE_ID());this.ShowError(this.txtCompanyName,true);}
return isChk;},LoadCompanyView:function(view){this.txtCompanyName.value=view.CompanyName;this.ckbCompanyConfidentiality.checked=view.IsCompanyNameConfidential;if(this.lstCompanyIndusties){this._dataStore.set_property("SetIndustries",view.CompanyIndustry.SelectedValue);}
if(view.JobLogo!=null){this.reinitializeLogoControl(view.JobLogo,false);}},ClearCompanyView:function(view){this.txtCompanyName.value="";this.ckbCompanyConfidentiality.checked=false;this._dataStore.set_property("SetIndustries",null);},initHandlers:function(element,event,context){if(element.id=="lnkDeleteLogo"){event.preventDefault();var delegate=Function.createDelegate({adapter:this,logoID:context.logoID},this.showConfirmDeleteLogo);this._wireHandler(element,event,delegate);}
else if(element.name=="cbxUseLogo"){var delegate=Function.createDelegate({adapter:this,selectedValue:element.value},this.onRadioUseLogoClick);this._wireHandler(element,event,delegate);}
else if(element.id.indexOf("cbxUseLogoFeature")!=-1){var delegate1=Function.createDelegate(this,this._selLatestUploadedLogoRadioBtn);this._wireHandler(element,event,delegate1);var delegate3=Function.createDelegate(this,this._onCbxUseLogoFeatureClicked);this._wireHandler(element,event,delegate3);}
else if(element==this.txtCompanyName){$addHandlers(this.txtCompanyName,{change:this.RouteEvents},{instance:this,value:this.txtCompanyName});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.RouteEvents(this.txtCompanyName);}}
else if(element==this.ckbCompanyConfidentiality){var delegate1=Function.createDelegate(this,this._toggleLogoSelectorDiv);this._wireHandler(element,event,delegate1);var delegate2=Function.createDelegate(this,this._togglePinnedMessage);this._wireHandler(element,event,delegate2);}},_wireHandler:function(element,event,delegate){this._actionDelegates.push([element,event.type,delegate]);$addHandler(element,event.type,delegate);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){delegate(event);}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"GetCompanyInformation":userContext.onSuccessfulCompanyInformationLoad(result);break;case"RedrawJobLogoGrid":case"DeleteJobLogo":if(result!=null){userContext.reinitializeLogoControl(result,true);}
break;case"addons":userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result);break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"GetCompanyInformation":break;default:break;}},onEnterPress:function(e){var code;if(!e)e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;else if(e.charCode)code=e.charCode;if(code==13){if(typeof window.event=='undefined'){e.stopPropagation();e.preventDefault();}}},setRequiredFieldsDisplayClass:function(){if(this.get_CompanyNameAndLogo_dispCompanyIndustry()!=null){if(!IsTextValid(this.get_CompanyNameAndLogo_dispCompanyIndustry())){this.get_CompanyNameAndLogo_dispCompanyIndustry().className="notEntered";}
else{this.get_CompanyNameAndLogo_dispCompanyIndustry().className="";}}},loadCompanyInformation:function(){this.callServer("GetCompanyInformation",[]);},adAgencySetIsInternalEdit:function(edit){this.AdAgencyContentInternalEdit=edit;return;},adAgencyisInternalEdit:function(){return this.AdAgencyContentInternalEdit;},buildCompanyInformationViewObject:function(){var companyInformationView=new Presenters.JPW.DTO.CompanyInformationView();companyInformationView.CompanyName=this.txtCompanyName.value;companyInformationView.IsCompanyNameConfidential=this.ckbCompanyConfidentiality.checked;jQuery.data(document.body,"PreviewCompanyName",this.txtCompanyName.value);if(this.divCompanyLogoDefinition){companyInformationView.JobLogo=this.getJobLogoView();}
var companyIndustryView=new Presenters.JPW.DTO.CompanyIndustryView();if(this.lstCompanyIndusties){var nodes=this.GetIndustryValues();companyIndustryView.SelectedValue=nodes;}
companyInformationView.CompanyIndustry=companyIndustryView;return companyInformationView;},getJobLogoView:function(){var jobLogoView=new Presenters.JPW.DTO.JobLogoView();jobLogoView.IsJobLogoChecked=this.cbxUseLogoFeature.checked;if(this.cbxUseLogoFeature.checked){jobLogoView.SelectedLogoId=this.getSelectedLogoId();}
return jobLogoView;},generateIndustriesSelectionText:function(){var industriesSelectionList=this.getCompanyIndustriesSelectionDetails();var industriesText="";if(industriesSelectionList.itemCount>0){for(var i=0;i<industriesSelectionList.itemCount;i++){if(industriesText!=""){industriesText+=", ";}
industriesText+=industriesSelectionList.items[i].name;}}
return industriesText;},_getIframeDomRefs:function(){if(this.ifrUpload.contentWindow){return this.ifrUpload.contentWindow.getDOMReferences();}
else{return false;}
return false;},reinitializeLogoControl:function(jobLogoData,isAfterUploadOrDelete){this.isUserUploadedLogoPresent=false;if(this.logoGrid.rows){for(var i=this.logoGrid.rows.length-1;i>=0;i--){this.logoGrid.deleteRow(i);}}
if(jobLogoData!=null&&jobLogoData.JobLogoGridData!=null){for(var i=0,l=jobLogoData.JobLogoGridData.length;i<l;i++){this._addLogoToGrid(jobLogoData.JobLogoGridData[i]);this.isUserUploadedLogoPresent=true;}}
if(this.lblFileRequirements.style){this.lblFileRequirements.style.display=this.isUserUploadedLogoPresent?"none":"block";}
this.cbxUseLogoFeature.disabled=jobLogoData.IsJobLogoCheckboxDisabled;this.lblLogoUploadExceeded.innerHTML=jobLogoData.LogoUploadExceededMessage;if(this.pnlViewAllLogos.style){this.pnlViewAllLogos.style.display=jobLogoData.ShowViewAllLink?"":"none";}
if(isAfterUploadOrDelete){this.cbxUseLogoFeature.checked=this.isUserUploadedLogoPresent;this._selLatestUploadedLogoRadioBtn();}
else{this.cbxUseLogoFeature.checked=jobLogoData.SelectedLogoId==-1?false:true;this._selLogoRadioBtnByID(jobLogoData.SelectedLogoId);}
if(this._getIframeDomRefs()){this._getIframeDomRefs().txtFileUpload.disabled=jobLogoData.DisableLogoUploadControl;if(jobLogoData.DisableLogoUploadControl){this._getIframeDomRefs().btnFileBrowse.className='BtnLevelTwoDisabledSmall';this._getIframeDomRefs().btnFileUpload.className='hideMe';this._getIframeDomRefs().txtVisibleUpload.value='';}
else{this._getIframeDomRefs().btnFileBrowse.className='BtnLevelTwoSmall';}}
this._toggleLogoUploadedDiv();},_addLogoToGrid:function(jobLogoRowData){if(jobLogoRowData==null){return;}
if(this.logoGrid&&this.logoGrid.nodeName&&this.logoGrid.nodeName.toLowerCase()=="table"){var dataItem_CompanyLogoID=jobLogoRowData.CompanyLogoId;var dataItem_ImageUrl=unescape(jobLogoRowData.ImageUrl);var dataItem_ThumbnailUrl=unescape(jobLogoRowData.ThumbnailUrl);var dataItem_FileName=jobLogoRowData.FileName;var tblBody=document.createElement("tbody");var tr=document.createElement('tr');var radioButtonCell=document.createElement('td');radioButtonCell.className="radioButton";radioButtonCell.innerHTML="<input type='radio' name='cbxUseLogo' value='"+dataItem_CompanyLogoID+"' onclick=\"initClick(this, event, [{adapterID: '"+this.get_id()+"'}]);\" />";tr.appendChild(radioButtonCell);var filenameCell=document.createElement('td');filenameCell.className="fileName";filenameCell.innerHTML=dataItem_FileName+"&nbsp;";tr.appendChild(filenameCell);var thumbnailImageCell=document.createElement('td');thumbnailImageCell.className="thumbnailImage";thumbnailImageCell.innerHTML="<a target='_blank' href='"+dataItem_ImageUrl+"' ><img src='"+dataItem_ThumbnailUrl+"' border='0' /></a>";tr.appendChild(thumbnailImageCell);var actionLinksCell=document.createElement('td');actionLinksCell.className="actionLinks";actionLinksCell.innerHTML="<a target='_blank' href='"+dataItem_ImageUrl+"'>"+this.viewLogoMsg+"</a><br/><a href=' ' id='lnkDeleteLogo' "+"onclick=\"initClick(this, event, [{adapterID: '"+this.get_id()+"', context: {logoID:"+dataItem_CompanyLogoID+"}}]); "+"return false;\">"+this.deleteLogoMsg+"</a>";tr.appendChild(actionLinksCell);tblBody.appendChild(tr);this.logoGrid.appendChild(tblBody);}},_selLogoRadioBtnByID:function(id){this.setCbxUseLogoFeature((id>0?true:false));if(this.radioUseLogos.length){for(var i=0,l=this.radioUseLogos.length;i<l;i++){if(this.radioUseLogos[i].value==id){this.radioUseLogos[i].checked=true;this._dataStore.set_property("logoSelector",id);break;}}}},_selLatestUploadedLogoRadioBtn:function(){if(this.cbxUseLogoFeature==null||!this.cbxUseLogoFeature.checked){if(this.radioUseLogos.length){for(i=0,l=this.radioUseLogos.length;i<l;i++){this.radioUseLogos[i].checked=false;}}
else if(this.radioUseLogos){this.radioUseLogos.checked=false;}
this._dataStore.set_property("logoSelector",null);}
else{var tempId=this.logoEnum_UploadNew;if(this.radioUseLogos.length){for(i=0,l=this.radioUseLogos.length;i<l;i++){if(this.radioUseLogos[i].value>=tempId&&this.radioUseLogos[i].value!=this.logoEnum_UseMonster){tempId=this.radioUseLogos[i].value;this.radioUseLogos[i].checked=true;}}}
else if(this.radioUseLogos){this.radioUseLogos.checked=true;}
this._dataStore.set_property("logoSelector",tempId);}},logoUploadCallBack:function(message,isAutoResizeRequired,newLogoId,hasError){this.logoUploadErrorMsg="";if(hasError){this.logoUploadValidator.style.visibility="visible";$(this.ifrUpload).removeAttr("errorFlyout");new Monster.Client.Component.Validator().showError(this.ifrUpload,message);}
else{this.logoUploadValidator.style.visibility="hidden";new Monster.Client.Component.Validator().hideError(this.ifrUpload);}
if(isAutoResizeRequired){AutoResizeRequiredWindow=window.open("/jobs/reviewoutstanding.aspx?CLID="+newLogoId,"resizewindow","resizable=1, height=325, width=625");if(AutoResizeRequiredWindow)
{AutoResizeRequiredWindow.focus();}}
else{this.callServer("RedrawJobLogoGrid",[this.encryptedPostingId,this.logoEnum_UploadNew]);}},resizeWindowCallBack:function(logoId){this.callServer("RedrawJobLogoGrid",[this.encryptedPostingId,logoId]);},logoUploadValidate:function(sender,args){args.IsValid=true;if(this.divCompanyLogoDefinition){var selectedLogoId=this.getSelectedLogoId();if(selectedLogoId==this.logoEnum_UploadNew&&this._getIframeDomRefs().txtFileUpload&&this._getIframeDomRefs().txtFileUpload.value==""){this.logoUploadErrorMsg=this.emptyUploadControlErrorMsg;}
if(this.logoUploadErrorMsg!=""&&selectedLogoId==this.logoEnum_UploadNew){args.IsValid=false;this.logoUploadValidator.errormessage=this.logoUploadErrorMsg;}}
if(args.IsValid==false)
this.lblCompanylogo.className="requiredLabel";else
this.lblCompanylogo.className="";return args.IsValid;},onRadioUseLogoClick:function(e){this.adapter.setCbxUseLogoFeature(true);this.adapter._dataStore.set_property("logoSelector",this.selectedValue);},onLogoLibraryClosed:function(confirm){if(!confirm)
this.adapter.callServer("RedrawJobLogoGrid",[this.adapter.encryptedPostingId,this.adapter.getSelectedLogoId()]);else{var selectedLogoId=this.adapter._dataStore.get_property("LogoLibrarySelectedImage");if(selectedLogoId){this.adapter.callServer("RedrawJobLogoGrid",[this.adapter.encryptedPostingId,selectedLogoId]);}}},setCbxUseLogoFeature:function(onoff){if(this.cbxUseLogoFeature){this.cbxUseLogoFeature.checked=onoff;}},getSelectedLogoId:function(){var id=this._dataStore.get_property("logoSelector");if(id)return id;this._dataStore.set_property("logoSelector",this.logoEnum_UploadNew);return this.logoEnum_UploadNew;},showConfirmDeleteLogo:function(e){e.preventDefault();var id=this.logoID;var deleteLogo=true;deleteLogo=confirm(this.adapter.logoDeleteConfirmMsg);if(deleteLogo){if(id>0)
this.adapter.callServer("DeleteJobLogo",[this.adapter.encryptedPostingId,id,this.adapter.getSelectedLogoId()]);}},_toggleLogoSelectorDiv:function(){if(this.ckbCompanyConfidentiality.checked){if(this.divLogoSelector!=null&&typeof(this.divLogoSelector.style)!="undefined")
this.divLogoSelector.style.display="none";if(this.cbxUseLogoFeature!=null)
this.cbxUseLogoFeature.checked=false;this._selLatestUploadedLogoRadioBtn();}
else{if(this.divLogoSelector!=null&&typeof(this.divLogoSelector.style)!="undefined")
this.divLogoSelector.style.display="block";}},_toggleLogoUploadedDiv:function(){if(this.divLogoUploaded!=null&&typeof(this.divLogoUploaded.style)!="undefined"){this.divLogoUploaded.style.display=this.isUserUploadedLogoPresent?"block":"none";}},_onCbxUseLogoFeatureClicked:function(event){this.updateEnhancementValue(event.target.checked);},_togglePinnedMessage:function(){var m;if(this.ckbCompanyConfidentiality.checked){if(this.divConfidentialMsg!=null&&typeof(this.divConfidentialMsg.style)!="undefined")
this.divConfidentialMsg.style.display="block";var delegate=Function.createDelegate(this,this._clearPinnedMessage);m=setTimeout(delegate,10000);}
else{this.divConfidentialMsg.style.display="none";if(m!=null)
clearTimeout(m);}},_clearPinnedMessage:function(){this.divConfidentialMsg.style.display='none';},updateEnhancementValue:function(checked){var selectedEnhancements=this._dataStore.get_property("selectedEnhancements");if(typeof(selectedEnhancements)=="undefined"||selectedEnhancements==null)
selectedEnhancements=[];if(checked==null)
checked=this._checked;var selectionExists=false;for(var i=0;i<selectedEnhancements.length;i++){var currentEnhancement=selectedEnhancements[i];if(currentEnhancement.EnhancementType==this.jobLogoEnhancementId){selectedEnhancements[i].EnhancementFields=[];selectedEnhancements[i].IsSelected=checked;selectionExists=true;break;}}
if(!selectionExists){var newSelectionEntry={EnhancementType:this.jobLogoEnhancementId,IsSelected:checked,EnhancementFields:[]};selectedEnhancements.push(newSelectionEntry);}
this._checked=checked;var ref=window.location.search.substring(1);this.callServer("addons",[this.encryptedPostingId,this._folder,selectedEnhancements,ref]);this._dataStore.set_property("selectedEnhancements",selectedEnhancements);},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.txtCompanyName:labelTag="lblCompanyName";iconTag="errorCompanyName";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsCompanyNameAndLogoAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter=function(element){this._createStart=new Date();Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter.initializeBase(this,[element]);this._createEnd=new Date();this._delegates=[];this.JobContact_zipCodeValidateFailed=false;this.JobContact_OfflineZipCodeValidateFailed=false;this.JobContact_sendJobInfoUpdate=false;this.reqErrors=[];this.JobContact_arrEduLevel;this.JobContact_arrCareerLevelIds;this.firstCheck_Mail=true;this.checkfields=null;this.createProperty("JobContact_lblFax");this.createProperty("JobContact_lblPhone");this.createProperty("JobContact_lblContactMethod");this.createProperty("JobContact_lblEmail");this.createProperty("JobContact_txtEmail");this.createProperty("JobContact_hfCompanyEmail");this.createProperty("JobContact_chkApplyOnline");this.createProperty("JobContact_chkDirectEmail");this.createProperty("JobContact_chkFilterCandidate");this.createProperty("JobContact_ddlEduLevel");this.createProperty("JobContact_ddlCareerLevel");this.createProperty("JobContact_txtByZip");this.createProperty("JobContact_ddlByRadius");this.createProperty("JobContact_ddlByAuth");this.createProperty("JobContact_ddlRadius");this.createProperty("JobContact_chkByCitizenship");this.createProperty("JobContact_hfCitizenshipID");this.createProperty("JobContact_chkDirectContact");this.createProperty("JobContact_chkByPhone");this.createProperty("JobContact_txtByPhone");this.createProperty("JobContact_chkByFax");this.createProperty("JobContact_txtByFax");this.createProperty("JobContact_chkByMail");this.createProperty("JobContact_txtContactName");this.createProperty("JobContact_txtCompanyName");this.createProperty("JobContact_txtAddress");this.createProperty("JobContact_txtCity");this.createProperty("JobContact_ddlState");this.createProperty("JobContact_ddlCountry");this.createProperty("JobContact_txtPostalCode");this.createProperty("JobContact_txtEmailReq");this.createProperty("vsContactInfoSummaryClientID");this.createProperty("contactFilterOptionsScreen");this.createProperty("offlineContactInner");this.createProperty("mailContactSection");this.createProperty("msgEmailReq");this.createProperty("OfflineContactMethodSection");this.createProperty("OfflineContactSection");this.createProperty("JobContact_dvState");this.createProperty("JobContact_dvZip");this.createProperty("JobContact_dvZipWithoutState");this.createProperty("JobContact_txtCAOUrl");this.createProperty("JobContact_chkCAOJob");this.createProperty("JobContact_EnableJobCAOUrl");this.createProperty("JobContact_IsJobCAOUrlAlwaysRequired");this.createProperty("vldDistanceJobScreen");this.createProperty("JobContact_APPLY_ONLINE_MESSAGE");this.createProperty("JobContact_CONTACT_DIRECTLY_MESSAGE");this.createProperty("JobContact_EMAIL_DIRECT_MESSAGE");this.createProperty("JobContact_OFFLINE_CONTACT_ALERT");this.createProperty("JobContact_DIRECT_EMAIL_ALERT");this.createProperty("JobContact_faxErrorMessage");this.createProperty("JobContact_faxDefaultErrorMessage");this.createProperty("JobContact_faxRegularExpressionErrorMessage");this.createProperty("JobContact_phoneErrorMessage");this.createProperty("JobContact_phoneDefaultErrorMessage");this.createProperty("JobContact_phoneRegularExpressionErrorMessage");this.createProperty("JobContact_phoneValidationRegEx");this.createProperty("JobContact_phoneMaxLength");this.createProperty("JobContact_phoneMinLength");this.createProperty("JobContact_zipCodeMaxlength");this.createProperty("JobContact_arrEduLevelIds");this.createProperty("JobContact_arrEduLevelTexts");this.createProperty("JobContact_arrCareerLevelIds");this.createProperty("JobContact_arrCareerLevelTexts");this.createProperty("JobContact_isTempUser");this.createProperty("JobContact_dummyUser");this.createProperty("JobContact_defaultCareerLevelId");this.createProperty("JobContact_defaultEduLevelId");this.createProperty("JobContact_readOnlyDefaultText");this.createProperty("JobContact_isUSCountry");this.createProperty("JobContact_isEditFlow");this.createProperty("DefaultSelect");this.createProperty("EMAIL_ADDRESS_ERROR_MESSAGE_ID");this.createProperty("CONTACT_METHOD_ERROR_MESSAGE_ID");this.createProperty("CONTACT_METHOD_ATLEAST_ERROR_MESSAGE_ID");this.createProperty("JOB_CAO_URL_ERROR_MESSAGE");this.createProperty("JobContact_CitizenshipIDForChannel");this.createProperty("ShowZipCodeRaidusFilterscreen");}
Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter.prototype={initialize:function(){this.bindPostalCodeFormatingMask();this._initStart=new Date();this.checkfields=[this.JobContact_txtEmail,this.JobContact_txtByPhone,this.JobContact_txtEmailReq,this.JobContact_txtByFax,this.JobContact_txtContactName,this.JobContact_txtCompanyName,this.JobContact_ddlCountry,this.JobContact_txtAddress,this.JobContact_txtCity,this.JobContact_ddlState,this.JobContact_txtPostalCode,this.JobContact_txtCAOUrl];for(var i=0;i<this.checkfields.length;i++){$addHandler(this.checkfields[i],'keypress',this.onEnterPress);}
Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
if(this.JobContact_chkFilterCandidate.checked){this.contactFilterOptionsScreen.style.display="block";if(this.vldDistanceJobScreen!=null&&(typeof(this.vldDistanceJobScreen.style))!="undefined")
if(this.ShowZipCodeRaidusFilterscreen){this.vldDistanceJobScreen.style.display=this.ShowZipCodeRaidusFilterscreen;}}
if(this.JobContact_chkDirectContact.checked){this.offlineContactInner.style.display="block";}
if(this.JobContact_chkByMail.checked){this.mailContactSection.style.display="block";}},initOnDemand:function(){this._initEnd=new Date();this._webService=EBiz.Services.JPW.JobDetailsService;this.registerDataProperty("GetContactView");this.registerDataProperty("UberDetailsObject");this.registerDataProperty("LoadData");this.registerDataProperty("ModifyContact");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("CountryStateList");this.registerDataProperty("LoadAdAjency");this.registerDataProperty("OfflineContactIsVisible");this.registerDataProperty("ClearAdAjency");this.registerDataProperty("SetValidationErrors");this.registerDataProperty("ValidateJobSave");this.registerDataProperty("BuildContactView");$addHandlers(this.JobContact_chkFilterCandidate,{click:this.showFilters},this);$addHandlers(this.JobContact_chkDirectContact,{click:this.showContactDetails},this);$addHandlers(this.JobContact_chkByMail,{click:this.showMailDetails},this);$addHandlers(this.JobContact_chkDirectEmail,{click:this.showReqField},this);$addHandlers(this.JobContact_chkApplyOnline,{click:this.hideFilters},this);if(this.JobContact_chkByCitizenship)
$addHandlers(this.JobContact_chkByCitizenship,{click:this.setCitizenship},this);if(this.JobContact_ddlEduLevel)
$addHandlers(this.JobContact_ddlEduLevel,{change:this.RouteEvents},{instance:this,value:this.JobContact_ddlEduLevel});if(this.JobContact_ddlCareerLevel)
$addHandlers(this.JobContact_ddlCareerLevel,{change:this.RouteEvents},{instance:this,value:this.JobContact_ddlCareerLevel});$addHandlers(this.JobContact_ddlCountry,{change:this.PopulateState},{instance:this,type:"change"});$addHandlers(this.JobContact_txtByPhone,{blur:this.onBlurtxtByPhone},this);$addHandlers(this.JobContact_txtByFax,{blur:this.onBlurtxtByFax},this);$addHandlers(this.JobContact_txtEmailReq,{blur:this.onBlurtxtEmailReq},this);$addHandlers(this.JobContact_txtCAOUrl,{blur:this.onBlurtxtCAOUrl},this);},initHandlers:function(element,event,context){if(context=="txtEmailAddress_keypress"){var delegate=Function.createDelegate(this,this.onEmailKeyPressed);$addHandler(element,"keypress",delegate);this._delegates.push([element,"keypress",delegate]);if(!$isIE())
this.onEmailKeyPressed(event);}},initValidator:function(element,args){if(MonsPageManager.enableInitOnDemand){MonsPageManager.onClick();}
if(args[1]!=null){switch(args[1]){case element.JobContact_txtEmail:element.ToggleIcon(element.JobContact_txtEmail,!args[0]);element.ShowError(element.JobContact_txtEmail,!args[0]);if(args[0]){element.JobContact_txtEmailReq.value=element.JobContact_txtEmail.value;}
break;case element.JobContact_txtByZip:element.ToggleIcon(element.JobContact_txtByZip,!args[0]);element.ShowError(element.JobContact_txtByZip,!args[0]);break;case element.JobContact_txtEmailReq:element.ToggleIcon(element.JobContact_txtEmailReq,!args[0]);break;case element.JobContact_txtPostalCode:element.ToggleIcon(element.JobContact_txtPostalCode,!args[0]);element.ShowError(element.JobContact_txtPostalCode,!args[0]);break;default:break;}}},RouteEvents:function(){var me=(typeof(this.instance)!=='undefined')?this.instance:this;var element;if(this.value!=null||this.value!=undefined){element=this.value;}
switch(element){case me.JobContact_ddlCareerLevel:me._dataStore.set_property("ModifyInfo",["CARR",element.selectedvalue]);break;case me.JobContact_ddlEduLevel:me._dataStore.set_property("ModifyInfo",["EDUC",element.selectedvalue]);break;case me.JobContact_hfCitizenshipID:me._dataStore.set_property("ModifyInfo",["CITI",element.value]);default:break;}},PopulateState:function(){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.type!=null||this.type!=undefined){me._dataStore.set_property("IsChange",true);}
var cdValue=me.JobContact_ddlCountry.value;me._dataStore.set_property("GetCommonData");var pid=me._dataStore.get_property("CommonPostingID");var countryId=0;if((cdValue.length>0)&&!isNaN(cdValue)){countryId=parseInt(cdValue);}
me.callServer("GetStateListByCountryId",[pid,countryId]);},ContactInfoChanged:function(){var me=(typeof(this.instance)!=='undefined')?this.instance:this;var element;if(this.value!=null||this.value!=undefined){element=this.value;}
if(this.type!=null||this.type!=undefined){if(element.value!=""){me._dataStore.set_property("IsChange",true);}}},onBlurtxtByPhone:function(){if((this.JobContact_txtByPhone.value!="")&&(this.JobContact_txtByPhone.value.length>0)){this.JobContact_chkByPhone.checked=true;}
else{this.JobContact_chkByPhone.checked=false;}},onBlurtxtByFax:function(){if((this.JobContact_txtByFax.value!="")&&(this.JobContact_txtByFax.value.length>0)){this.JobContact_chkByFax.checked=true;}
else{this.JobContact_chkByFax.checked=false;}},onBlurtxtEmailReq:function(){if((this.JobContact_txtEmailReq.value!="")&&(this.JobContact_txtEmailReq.value.length>0)){this.JobContact_chkDirectEmail.checked=true;}
else{this.JobContact_chkDirectEmail.checked=false;}},onBlurtxtCAOUrl:function(){if((this.JobContact_txtCAOUrl.value!="")&&(this.JobContact_txtCAOUrl.value.length>0)){this.JobContact_chkCAOJob.checked=true;}
else{this.JobContact_chkCAOJob.checked=false;}},onContactCountrySuccess:function(result,userContext,eventArgs){var stateList=userContext.JobContact_ddlState;var i=0;for(var count=stateList.options.length-1;count>-1;count--){stateList.options[count]=null;}
if(result!=null){userContext.JobContact_ddlState.style.display="inline";userContext.JobContact_dvState.style.display="inline";userContext.JobContact_dvZip.style.display="inline";userContext.JobContact_dvZipWithoutState.style.display="none";for(var item in result){if(result[item].Text!=null&&result[item].Value!=null){if(result[item].Value==""){result[item].Text=this.DefaultSelect;}
var optionItemName=new Option(result[item].Text,result[item].Value,false,false);stateList.options[i]=optionItemName;i++;}}
if(result.length==1&&result[0].Value==""){userContext.JobContact_ddlState.style.display="none";userContext.JobContact_dvState.style.display="none";userContext.JobContact_dvZip.style.display="none";userContext.JobContact_dvZipWithoutState.style.display="inline";}}
else{userContext.JobContact_ddlState.style.display="none";userContext.JobContact_dvState.style.display="none";userContext.JobContact_dvZip.style.display="none";userContext.JobContact_dvZipWithoutState.style.display="inline";}
if(userContext.JobContact_ddlState){userContext.JobContact_ddlState.selectedvalue=0;}
this.bindPostalCodeFormatingMask();},ToggleIcon:function(element,flag){var icontag=null;switch(element){case this.JobContact_txtEmail:icontag="errorEmail1";break;case this.JobContact_txtByZip:icontag="errorZip1";break;case this.JobContact_txtEmailReq:icontag="errorEmail2";break;case this.JobContact_txtPostalCode:icontag="errorZip2";break;default:break;}
if(icontag!=null){if(flag==true){$get(icontag).style.display="inline";}else{$get(icontag).style.display="none";}}},showFilters:function(){if(this.JobContact_chkFilterCandidate.checked){this.JobContact_chkApplyOnline.checked=true;this.contactFilterOptionsScreen.style.display="block";if(typeof(this.vldDistanceJobScreen.style)!="undefined")
this.vldDistanceJobScreen.style.display=this.ShowZipCodeRaidusFilterscreen;}
else{this.contactFilterOptionsScreen.style.display="none";}},setCitizenship:function(){if(this.JobContact_chkByCitizenship.checked){this.JobContact_hfCitizenshipID.value=this.JobContact_CitizenshipIDForChannel;}
else{this.JobContact_hfCitizenshipID.value="0";}},showReqField:function(){if(this.JobContact_chkDirectEmail.checked){this.msgEmailReq.style.display="inline";}
else{this.msgEmailReq.style.display="none";}},hideFilters:function(){if(!this.JobContact_chkApplyOnline.checked){this.JobContact_chkFilterCandidate.checked=false;this.contactFilterOptionsScreen.style.display="none";this.msgEmailReq.style.display="none";}
else{this.msgEmailReq.style.display="inline";}},showContactDetails:function(){if(this.JobContact_chkDirectContact.checked){this.offlineContactInner.style.display="block";this.JobContact_txtEmailReq.value=this.JobContact_txtEmail.value;if((this.JobContact_txtEmail.value!="")&&(this.JobContact_txtEmail.value.length>0)){this.JobContact_chkDirectEmail.checked=true;}}
else{this.JobContact_chkByMail.checked=false;this.showMailDetails();this.offlineContactInner.style.display="none";}},showMailDetails:function(){if(this.JobContact_chkByMail.checked){this.mailContactSection.style.display="block";if(this.firstCheck_Mail){this._dataStore.set_property("PrePopulateMailDetails",true);this.firstCheck_Mail=false;}}
else{this.mailContactSection.style.display="none";}},onEmailKeyPressed:function(event){if(event.charCode==59)
event.preventDefault();},onEnterPress:function(e){var code;if(!e)e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;else if(e.charCode)code=e.charCode;if(code==13){if(typeof window.event=='undefined'){e.stopPropagation();e.preventDefault();}}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"GetStateListByCountryId":userContext.onContactCountrySuccess(result,userContext,null);break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"GetStateListByCountryId":break;default:break;}},dispose:function(){if(MonsPageManager.initState(this._id)){}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":var view=this.BuildJobContactView();this._dataStore.set_property("GetContactView",view);break;case"BuildContactView":var view=this.BuildJobContactView();this._dataStore.set_property("GetContactView",view);break;case"LoadData":result=this._dataStore.get_property("LoadData");if(result.ContactInformation!=null){this.LoadContactView(result.ContactInformation);}
break;case"ModifyContact":var temp=this._dataStore.get_property("ModifyContact");this.PrefillContact(temp);break;case"validateDetailsPage_request":var valPass=false;if(this._dataStore.get_property("ValidateJobSave")){valPass=true;}
else{valPass=this.CheckRequired();}
this._dataStore.set_property("ValidateContact",valPass);if((!valPass)&&(this.reqErrors.length>0)){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);}
break;case"LoadAdAjency":result=this._dataStore.get_property("LoadAdAjency");if(result.ContactInformation!=null)
this.LoadContactView(result.ContactInformation);break;case"ClearAdAjency":this.ClearContactView();break;case"OfflineContactIsVisible":var _display=this._dataStore.get_property("OfflineContactIsVisible")=="true"?"block":"none";this.OfflineContactMethodSection.style.display=_display;this.OfflineContactSection.style.display=_display;break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement){case"EmailAddress":this.ShowError(this.JobContact_txtEmail,temp.isShow);break;case"PhoneNumber":this.ShowError(this.JobContact_lblPhone,temp.isShow);break;case"FaxNumber":this.ShowError(this.JobContact_lblFax,temp.isShow);break;case"FilterZipCode":this.ShowError(this.JobContact_txtByZip,temp.isShow);break;case"ContactZipCode":this.ShowError(this.JobContact_txtPostalCode,temp.isShow);break;default:break;}
break;default:break;}},CheckRequired:function(){var isChk=false;var temp=[false,false];this.reqErrors=[];if(this.JobContact_EnableJobCAOUrl=="true"){temp[0]=true;if(this.JobContact_IsJobCAOUrlAlwaysRequired=="true"||this.JobContact_chkCAOJob.checked){var regexp=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;if((this.JobContact_txtCAOUrl.value!="")&&(this.JobContact_txtCAOUrl.value.length>0)&&regexp.test(this.JobContact_txtCAOUrl.value)){temp[1]=true;this.ShowError(this.JobContact_txtCAOUrl,false);}
else{temp[1]=false;this.reqErrors.push(this.get_JOB_CAO_URL_ERROR_MESSAGE());this.ShowError(this.JobContact_txtCAOUrl,true);}}
else if(this.JobContact_chkDirectContact.checked){if(this.JobContact_chkDirectEmail.checked||this.JobContact_chkByFax.checked||this.JobContact_chkByMail.checked||this.JobContact_chkByPhone.checked){temp[1]=true;this.ShowError(this.JobContact_txtCAOUrl,false);}
else{temp[1]=false;this.reqErrors.push(this.get_CONTACT_METHOD_ATLEAST_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_txtCAOUrl,true);}}
else{temp[1]=false;this.reqErrors.push(this.get_CONTACT_METHOD_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_txtCAOUrl,true);}}
else{if(this.JobContact_chkApplyOnline.checked){if((this.JobContact_txtEmail.value!="")&&(this.JobContact_txtEmail.value.length>0)){temp[0]=true;this.ShowError(this.JobContact_txtEmail,false);}
else{temp[0]=false;this.reqErrors.push(this.get_EMAIL_ADDRESS_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_txtEmail,true);}}
else if(this.JobContact_chkDirectContact.checked==true&&this.JobContact_chkDirectEmail.checked==true){if((this.JobContact_txtEmail.value!="")&&(this.JobContact_txtEmail.value.length>0)){temp[0]=true;this.ShowError(this.JobContact_txtEmail,false);}
else{temp[0]=false;this.reqErrors.push(this.get_EMAIL_ADDRESS_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_txtEmail,true);}}
else{temp[0]=true;this.ShowError(this.JobContact_txtEmail,false);}
if((this.JobContact_chkApplyOnline.checked==true)||(this.JobContact_chkDirectContact.checked==true)){if(this.JobContact_chkDirectContact.checked==true){if(this.JobContact_chkDirectEmail.checked==true||this.JobContact_chkByFax.checked==true||this.JobContact_chkByMail.checked==true||this.JobContact_chkByPhone.checked==true){temp[1]=true;this.ShowError(this.JobContact_chkApplyOnline,false);}
else{temp[1]=false;this.reqErrors.push(this.get_CONTACT_METHOD_ATLEAST_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_chkApplyOnline,true);}}
else{temp[1]=true;this.ShowError(this.JobContact_chkApplyOnline,false);}}
else{this.reqErrors.push(this.get_CONTACT_METHOD_ERROR_MESSAGE_ID());this.ShowError(this.JobContact_chkApplyOnline,true);}}
if((temp[0])&&(temp[1]))
isChk=true;else
isChk=false;return isChk;},PrefillContact:function(temp){switch(temp[0]){case"EDUC":if(this.JobContact_ddlEduLevel.options!=null){var arrEduLevelTexts=this.JobContact_arrEduLevelTexts;var arrEduLevelIds=this.JobContact_arrEduLevelIds;this.loadOptionList(this.JobContact_ddlEduLevel,arrEduLevelTexts,arrEduLevelIds);if(temp[1]!="0"){for(var i=this.JobContact_ddlEduLevel.options.length;i>0;i--){if((i!=temp[1])&&(i!=0)){this.JobContact_ddlEduLevel.remove(i);}}
this.JobContact_ddlEduLevel.selectedIndex=1;}
else
this.JobContact_ddlEduLevel.selectedIndex=temp[1];}
break;case"CARR":if(this.JobContact_ddlCareerLevel.options!=null){var arrCareerLevelTexts=this.JobContact_arrCareerLevelTexts;var arrCareerLevelIds=this.JobContact_arrCareerLevelIds;this.loadOptionList(this.JobContact_ddlCareerLevel,arrCareerLevelTexts,arrCareerLevelIds);if(temp[1]!="0"){for(var i=this.JobContact_ddlCareerLevel.options.length;i>0;i--){if((i!=temp[1])&&(i!=0))
this.JobContact_ddlCareerLevel.remove(i);}
this.JobContact_ddlCareerLevel.selectedIndex=1;}
else{this.JobContact_ddlCareerLevel.selectedIndex=temp[1];}}
break;case"ZIP":if(this.JobContact_txtByZip)
this.JobContact_txtByZip.value=temp[1];if(temp[1].length!=0&&temp[3]=="true"){this.JobContact_txtPostalCode.value=temp[1];this.JobContact_txtAddress.value="";}
if(this.JobContact_txtByZip){if(temp[1]=="")
this.JobContact_txtByZip.disabled=false;else
this.JobContact_txtByZip.disabled=true;}
break;case"COUNTRY":var element=temp[1];if(element.selectedIndex>0){this.InitializeWorkAuthDropDown(true,element.value,element[element.selectedIndex].text,"checkselected",false,false);if(temp[2]=="true")
this.JobContact_ddlCountry.value=element.value;this.PopulateState();}
else{this.InitializeWorkAuthDropDown(false,null,null,element,false,false);this.JobContact_ddlByAuth.selectedIndex=0;}
break;case"CMPNAME":this.JobContact_txtCompanyName.value=temp[1];this.JobContact_txtCompanyName.disabled=true;break;case"NOLOCATION":this.InitializeWorkAuthDropDown(false,temp[3],temp[4],temp[2],true,false);this.JobContact_ddlByAuth.selectedIndex=0;this.JobContact_ddlCountry.selectedIndex=0;this.JobContact_txtCity.value="";this.JobContact_ddlState.selectedIndex=0;this.JobContact_txtPostalCode.value="";this.JobContact_txtAddress.value="";this.JobContact_txtByZip.disabled=false;this.JobContact_txtByZip.value="";break;case"INTERNATIONAL":this.InitializeWorkAuthDropDown(false,null,null,temp[2],false,true);this.JobContact_ddlByAuth.selectedIndex=0;this.JobContact_ddlCountry.selectedIndex=0;this.JobContact_txtCity.value="";this.JobContact_ddlState.selectedIndex=0;this.JobContact_txtPostalCode.value="";this.JobContact_txtAddress.value="";this.JobContact_txtByZip.disabled=false;this.JobContact_txtByZip.value="";break;case"DEFAULTPANEL":if(temp[1]!=null){this.InitializeWorkAuthDropDown(true,temp[1],temp[2],null,false,false);this.JobContact_txtCity.value="";this.JobContact_txtPostalCode.value="";this.JobContact_ddlCountry.value=temp[1];this.PopulateState();}
break;case"CITY":if(temp[1].length!=0&&temp[2]=="true"){this.JobContact_txtCity.value=temp[1];this.JobContact_txtAddress.value="";}
break;case"STATE":if(temp[1]!=0&&temp[2]=="true"){this.JobContact_ddlState.value=temp[1];this.JobContact_txtAddress.value="";}
break;case"ADDR1":if(temp[1].length!=0&&temp[2]=="true"){this.JobContact_txtAddress.value=temp[1];}
break;default:break;}},loadOptionList:function(option,stringTextData,stringIds){if(option.options!=null){for(var i=option.options.length;i>0;i--){option.remove(i);}
var arrTextData=new Array();var arrIds=new Array();arrTextData=stringTextData.split("|");arrIds=stringIds.split("|");for(var i=0;i<arrTextData.length;i++){var optionItemName=new Option(arrTextData[i],arrIds[i],false,false);option[i]=optionItemName;}}},InitializeWorkAuthDropDown:function(isDefault,countryvalue,countrytext,cntrl,isNoLocation,isInt){if(this.JobContact_ddlByAuth.options){this.JobContact_ddlByAuth.disabled=false;if(isDefault){var isSel=false;this.ClearDropDown(this.JobContact_ddlByAuth);var optionItemName=new Option(countrytext,countryvalue,false,false);this.JobContact_ddlByAuth.options[1]=optionItemName;this.JobContact_ddlByAuth.options[0].text=this.DefaultSelect;if(cntrl!=null){if(countryvalue!=="0")
isSel=true;}
if(isSel){this.JobContact_ddlByAuth.selectedIndex=1;}
else{this.JobContact_ddlByAuth.selectedIndex=0;}}
else{this.ClearDropDown(this.JobContact_ddlByAuth);this.JobContact_ddlByAuth.options[0]=new Option(this.DefaultSelect,0);if(isNoLocation){var j=1;if(countryvalue!=null){var optionitem=new Option(countrytext,countryvalue,false,false);this.JobContact_ddlByAuth[1]=optionitem;j++;}
for(var i=1;i<cntrl.options.length;i++){var optionitem=new Option(cntrl[i].text,cntrl[i].value,false,false);this.JobContact_ddlByAuth[j]=optionitem;j++;}}
if(isInt){var temp=0;for(var i=0;i<cntrl.options.length;i++){var optionitem=new Option(cntrl[i].text,cntrl[i].value,false,false);this.JobContact_ddlByAuth[temp]=optionitem;temp++;}}}}},ClearDropDown:function(drpRef){if(drpRef.options){var i=0;for(var count=drpRef.options.length-1;count>-1;count--){drpRef.options[count]=null;}}},LoadContactView:function(view){this.JobContact_chkApplyOnline.checked=view.AllowApplyOnline;this.JobContact_chkDirectEmail.checked=view.AllowApplyByEMail;this.JobContact_chkDirectContact.checked=view.AllowDirectContact;this.JobContact_chkFilterCandidate.checked=view.FilterCandidateResponse;this.JobContact_ddlCareerLevel.value=view.Filter.CareerLevelId;this.JobContact_ddlEduLevel.value=view.Filter.EducationLevelId;this.JobContact_txtByZip.value=view.Filter.ZipCode;this.JobContact_ddlByAuth.value=view.Filter.WorkAuthorizationId;this.JobContact_ddlRadius.value=view.Filter.Radius;this.JobContact_chkByCitizenship.checked=view.Filter.FilterCitizenship;this.JobContact_hfCitizenshipID.value=view.Filter.CitizenshipID;this.JobContact_chkByPhone.checked=view.Contact.AllowPhoneContact;this.JobContact_chkByFax.checked=view.Contact.AllowFaxContact;this.JobContact_chkByMail.checked=view.Contact.AllowMailContact;this.JobContact_txtEmail.value=view.Contact.Contact.Email;this.JobContact_txtByPhone.value=view.Contact.Contact.Phone;this.JobContact_txtByFax.value=view.Contact.Contact.Fax;this.JobContact_txtContactName.value=view.Contact.Contact.ContactPerson;this.JobContact_txtCompanyName.value=view.Contact.Contact.Company;this.JobContact_txtEmailReq.value=view.Contact.Contact.Email;this.JobContact_txtAddress.value=view.Contact.Contact.Address.StreetAddress;this.JobContact_txtCity.value=view.Contact.Contact.Address.City;this.JobContact_ddlState.value=view.Contact.Contact.Address.StateId;this.JobContact_ddlCountry.value=view.Contact.Contact.Address.CountryId;this.JobContact_txtPostalCode.value=view.Contact.Contact.Address.ZipCode;if(this.JobContact_EnableJobCAOUrl=="true"){this.JobContact_txtCAOUrl.value=view.Contact.Contact.JobCAOUrl;this.JobContact_chkCAOJob.checked=(this.JobContact_txtCAOUrl.value!=null&&this.JobContact_txtCAOUrl.value!="");}
if(this.JobContact_chkFilterCandidate.checked){this.contactFilterOptionsScreen.style.display="block";if(typeof(this.vldDistanceJobScreen.style)!="undefined")
this.vldDistanceJobScreen.style.display=this.ShowZipCodeRaidusFilterscreen;}
if(this.JobContact_chkDirectContact.checked){this.offlineContactInner.style.display="block"}
this.showFilters();this.showContactDetails();this.showMailDetails();this.showReqField();},ClearContactView:function(){this.JobContact_chkApplyOnline.checked=false;this.JobContact_chkDirectEmail.checked=false;this.JobContact_chkDirectContact.checked=false;this.JobContact_chkFilterCandidate.checked=false;this.JobContact_ddlCareerLevel.selectedValue="";this.JobContact_ddlEduLevel.selectedValue="";this.JobContact_txtByZip.value="";this.JobContact_ddlByAuth.selectedaValue="";this.JobContact_ddlRadius.selectedValue="";this.JobContact_chkByCitizenship.checked=false;this.JobContact_hfCitizenshipID.value="0";this.JobContact_chkByPhone.checked=false;this.JobContact_chkByFax.checked=false;this.JobContact_chkByMail.checked=false;this.JobContact_txtEmail.value="";this.JobContact_txtByPhone.value="";this.JobContact_txtByFax.value="";this.JobContact_txtContactName.value="";this.JobContact_txtCompanyName.value="";this.JobContact_txtEmailReq.value="";this.JobContact_txtAddress.value="";this.JobContact_txtCity.value="";this.JobContact_ddlState.value="";this.JobContact_ddlCountry.value="";this.JobContact_txtPostalCode.value="";this.JobContact_txtCAOUrl.value="";this.JobContact_chkCAOJob.checked=false;if(this.JobContact_chkFilterCandidate.checked){this.contactFilterOptionsScreen.style.display="block";}
if(this.JobContact_chkDirectContact.checked){this.offlineContactInner.style.display="block"}
this.showFilters();this.showContactDetails();this.showMailDetails();this.showReqField();},LoadPartialContactView:function(view){this.JobContact_txtAddress.value=view.Address.StreetAddress;this.JobContact_txtCity.value=view.Address.City;this.JobContact_ddlState.selectedvalue=view.Address.StateId;this.JobContact_ddlCountry.selectedvalue=view.Address.CountryId;this.JobContact_txtEmail.value=view.Email;this.JobContact_txtByPhone.value=view.Phone;this.JobContact_txtByFax.value=view.Fax;this.JobContact_txtContactName.value=view.ContactPerson;this.JobContact_txtCompanyName.value=view.Company;},GetCompanyEmail:function(){return this.get_JobContact_hfCompanyEmail().value;},JobContact_SetVisibility:function(){if(window.JobContact_chkFilterCandidate){this.JobContact_ToggleDiv(this.JobContact_GetControlValue(this.get_JobContact_chkFilterCandidate(),"","checkbox"),"filterDetails");this.JobContact_ToggleDiv(this.JobContact_GetControlValue(this.JobContact_chkFilterCandidate(),"","checkbox"),"filtersDescription");this.JobContact_ToggleDiv(this.JobContact_GetControlValue(this.JobContact_chkDirectContact(),"","checkbox"),"offlineContactInner");this.JobContact_ToggleDiv(this.JobContact_GetControlValue(this.JobContact_chkDirectContact(),"","checkbox"),"contactDetails");this.JobContact_ToggleDiv(this.JobContact_GetControlValue(this.JobContact_chkByMail(),"","checkbox"),"mailContactSection");}},BuildJobContactView:function(){var view=new Presenters.JPW.DTO.ContactInformationView();view.AllowApplyOnline=this.JobContact_GetControlValue(this.get_JobContact_chkApplyOnline(),"","checkbox");view.AllowApplyByEMail=this.JobContact_GetControlValue(this.get_JobContact_chkDirectEmail(),"","checkbox");view.AllowDirectContact=this.JobContact_GetControlValue(this.get_JobContact_chkDirectContact(),"","checkbox");view.FilterCandidateResponse=this.JobContact_GetControlValue(this.get_JobContact_chkFilterCandidate(),"","checkbox");view.EnableJobCAOUrl=this.JobContact_EnableJobCAOUrl;if(this.JobContact_EnableJobCAOUrl=="true"){view.AllowJobCAOUrl=this.JobContact_GetControlValue(this.get_JobContact_chkCAOJob(),"","checkbox");}
var filter=new Presenters.JPW.DTO.FilterView();filter.FilterEducationLevel=view.FilterCandidateResponse;filter.FilterCareerLevel=view.FilterCandidateResponse;filter.FilterCitizenship=this.JobContact_GetControlValue(this.get_JobContact_chkByCitizenship(),"","checkbox");filter.EducationLevelId=this.JobContact_GetControlValue(this.get_JobContact_ddlEduLevel(),"","select-one");filter.CareerLevelId=this.JobContact_GetControlValue(this.get_JobContact_ddlCareerLevel(),"","select-one");filter.Radius=this.JobContact_GetControlValue(this.get_JobContact_ddlByRadius(),"","select-one");filter.ZipCode=this.JobContact_GetControlValue(this.get_JobContact_txtByZip(),"","text");filter.WorkAuthorizationId=this.JobContact_GetControlValue(this.get_JobContact_ddlByAuth(),"","select-one");filter.CitizenshipID=this.JobContact_GetControlValue(this.get_JobContact_hfCitizenshipID(),"","hidden");view.Filter=filter;var contact=this.GetContactData(view.AllowDirectContact);var contactDef=new Presenters.JPW.DTO.ContactDefinitionView();contactDef.ContactPerson=this.JobContact_GetControlValue(this.get_JobContact_txtContactName(),"","text");contactDef.Company=this.JobContact_GetControlValue(this.get_JobContact_txtCompanyName(),"","text");if(this.get_JobContact_txtEmailReq()&&this.get_JobContact_txtEmailReq().type)
contactDef.Email=this.JobContact_GetControlValue(this.get_JobContact_txtEmailReq(),"","text");else
contactDef.Email=this.JobContact_GetControlValue(this.get_JobContact_txtEmail(),"","text");contactDef.Fax=this.JobContact_GetControlValue(this.get_JobContact_txtByFax(),"","text");contactDef.Phone=this.JobContact_GetControlValue(this.get_JobContact_txtByPhone(),"","text");if(this.JobContact_EnableJobCAOUrl=="true"){contactDef.JobCAOUrl=this.JobContact_GetControlValue(this.get_JobContact_txtCAOUrl(),"","text");}
var address=new Presenters.JPW.DTO.ContactAddressView();address.City=this.JobContact_GetControlValue(this.get_JobContact_txtCity(),"","text");address.StreetAddress=this.JobContact_GetControlValue(this.get_JobContact_txtAddress(),"","text");address.ZipCode=this.JobContact_GetControlValue(this.get_JobContact_txtPostalCode(),"","text");address.StateId=this.JobContact_GetControlValue(this.get_JobContact_ddlState(),"","select-one");address.CountryId=this.JobContact_GetControlValue(this.get_JobContact_ddlCountry(),"","select-one");contactDef.Address=address;contact.Contact=contactDef;view.Contact=contact;return view;},GetContactData:function(allowDirectContact){var contact=new Presenters.JPW.DTO.ContactView();if(!allowDirectContact){if(this.get_JobContact_chkByPhone())this.get_JobContact_chkByPhone().checked=false;if(this.get_JobContact_chkByFax())this.get_JobContact_chkByFax().checked=false;if(this.get_JobContact_chkByMail())this.get_JobContact_chkByMail().checked=false;}
contact.AllowPhoneContact=this.JobContact_GetControlValue(this.get_JobContact_chkByPhone(),"","checkbox");contact.AllowFaxContact=this.JobContact_GetControlValue(this.get_JobContact_chkByFax(),"","checkbox");contact.AllowMailContact=this.JobContact_GetControlValue(this.get_JobContact_chkByMail(),"","checkbox");return contact;},JobContact_GetDropDownSelectedText:function(ctrl){if(ctrl==null)
{return"";}
if(ctrl.selectedIndex<=0)
{return"";}
return ctrl.options[ctrl.selectedIndex].text;},JobContact_SetSampleTextFocus:function(ctrl,sampleText){if(ctrl.value==sampleText){ctrl.value="";}
ctrl.style.color="#000000";},JobContact_SetSampleTextBlur:function(ctrl,sampleText){if(ctrl==null){return;}
if(ctrl.value==null||ctrl.value.trim()==""||ctrl.value.trim()==sampleText){if(ctrl.maxLength<sampleText.length){ctrl.maxLength=sampleText.length;}
ctrl.value=sampleText;ctrl.style.color='#C2C2C2';if(ctrl.Validators!=undefined){for(var i=0;i<ctrl.Validators.length;i++){ctrl.Validators[i].isvalid=true;ctrl.Validators[i].style.display="none";}}}
else{ctrl.style.color='#000000';}},JobContact_ToggleDiv:function(show,divID){if(document.getElementById(divID)){if(show){document.getElementById(divID).style.display="";}
else{document.getElementById(divID).style.display="none";}}},JobContact_ConfidentialAlert:function(show,alertmsg){if(window.CompanyNameAndLogo_getConfidentitialityState&&CompanyNameAndLogo_getConfidentitialityState()&&show){alert(alertmsg)}},JobContact_ToggleCheckbox:function(text,checkbox,sampleText){if(checkbox==null||checkbox==undefined){return;}
if(text==""||text==sampleText){checkbox.checked=false;}
else{checkbox.checked=true;}},JobContact_GetControlValue:function(ctrl,sampleText,type){if(ctrl==null){switch(type){case"checkbox":return false;break;case"select-one":case"hidden":return 0;break;case"text":return"";break;}
return"";}
switch(ctrl.type){case"checkbox":return ctrl.checked;break;case"select-one":case"hidden":if(ctrl.value==""){return 0;}
else{var parsedVal=parseInt(ctrl.value);if(isNaN(parsedVal))
{return 0;}
else
{return parseInt(ctrl.value);}}
break;case"text":if(ctrl.value.trim()==sampleText){return"";}
else{return ctrl.value;}
break;}},JobContact_SetValueToControl:function(ctrl,value,sampleText){if(ctrl==null){return;}
if(ctrl.type=="text"&&(value==undefined||value=="")){ctrl.value="";if(sampleText!=null&&sampleText!=""){this.JobContact_SetSampleTextBlur(ctrl,sampleText);}}
else{switch(ctrl.type){case"checkbox":ctrl.checked=value;break;case"select-one":if(value<=0){ctrl.value="";}
ctrl.value=value;break;case"text":ctrl.value=value;this.JobContact_SetSampleTextFocus(ctrl,sampleText);break;}}},JobContact_ResetDropdownList:function(ctrl,valueList,dispList){if(ctrl==null){return;}
for(var i=ctrl.options.length-1;i>0;i--){ctrl.remove(i);}
for(var j=valueList.length-1;j>0;j--){var newOption=document.createElement("OPTION");ctrl.options.add(newOption);newOption.text=dispList[j];newOption.value=valueList[j];}
this.JobContact_SetValueToControl(ctrl,"","");},JobContact_LookupEduLevelText:function(eduLevelId){for(var i=0;i<this.get_JobContact_arrEduLevelIds().length;i++){if(this.get_JobContact_arrEduLevelIds()[i]==eduLevelId){return this.get_JobContact_arrEduLevelTexts()[i];}}
return"";},JobContact_LookupCareerLevelText:function(careerLevelId){for(var i=0;i<this.get_JobContact_arrCareerLevelIds().length;i++){if(this.get_JobContact_arrCareerLevelIds()[i]==careerLevelId){return this.get_JobContact_arrCareerLevelTexts()[i];}}
return"";},JobContact_SetDisabled:function(ctrl,value){if(ctrl==null){return;}
ctrl.disabled=value;},JobContact_ValidatePhone:function(source,args){},JobContact_ValidateFax:function(source,args){},JobContact_ValidateOfflineZipCode:function(sender,args){},JobContact_ValidateFilterZipCode:function(sender,args){},toggleDisabled:function(checked){if(checked){this.JobContact_SetDisabled(this.get_JobContact_ddlCareerLevel(),false);this.JobContact_SetDisabled(this.get_JobContact_ddlEducationLevel(),false);this.JobContact_SetDisabled(this.get_JobContact_ddlRadius(),false);this.JobContact_SetDisabled(this.get_JobContact_ddlByAuth(),false);this.JobContact_SetDisabled(this.get_JobContact_txtByZip(),false);}
else{this.JobContact_SetDisabled(this.get_JobContact_ddlCareerLevel(),true);this.JobContact_SetDisabled(this.get_JobContact_ddlEducationLevel(),true);this.JobContact_SetDisabled(this.get_JobContact_ddlRadius(),true);this.JobContact_SetDisabled(this.get_JobContact_ddlByAuth(),true);this.JobContact_SetDisabled(this.get_JobContact_txtByZip(),true);}},bindPostalCodeFormatingMask:function(){var me=(typeof(this.instance)!=='undefined')?this.instance:this;zipCodeFormating.bindPostalCodeEvents(me.JobContact_ddlCountry.value,me.JobContact_txtPostalCode);},ShowError:function(element,isShow){var labelTag=null;var labelTag2=null;var iconTag=null;switch(element){case this.JobContact_txtEmail:labelTag="lblEmail";iconTag="errorEmail1";break;case this.JobContact_chkApplyOnline:labelTag="lblContactMethod";iconTag="errorApplyOnline";break;case this.JobContact_txtCAOUrl:labelTag="lblContactMethod";iconTag="errorCAOUrl";break;case this.JobContact_lblPhone:labelTag="lblPhone";iconTag="errorPhone";break;case this.JobContact_lblFax:labelTag="lblFax";iconTag="errorFax";break;case this.JobContact_txtByZip:labelTag="lblFilterZipCode";iconTag="errorZip1";break;case this.JobContact_txtPostalCode:labelTag="lblContactZipCode";labelTag2="lblContactZipCode2";iconTag="errorZip2";break;default:break;}
if($get(labelTag)!=null){isShow?$get(labelTag).style.color='#CC0000':$get(labelTag).style.color='#666666';}
if(labelTag2){if($get(labelTag2)!=null){isShow?$get(labelTag2).style.color='#CC0000':$get(labelTag2).style.color='#666666';}}
if($get(iconTag)!=null){isShow?$get(iconTag).style.display='inline':$get(iconTag).style.display='none';}}}
Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsContactAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.ComboBoxListAdapter=function(element){Monster.Client.Behavior.JobPosting.ComboBoxListAdapter.initializeBase(this,[element]);this.createProperty("initialItemCount");this.createProperty("maxItems");this.createProperty("wrapperClass");this.createProperty("itemsSelected");this._maxItems=3;this._current_length=1;this._masterSelector=".dropMainWrapper > ol > li > select";this._addButton=null;this._limitLabel=null;this._mainclass="dropMainWrapper";this._addSelector=".dropMainWrapper > ol > li > ";this._limitSelector=".dropMainWrapper > ol > li > ";}
Monster.Client.Behavior.JobPosting.ComboBoxListAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.ComboBoxListAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
if(this._element.id){this._masterSelector="#"+this._element.id+" > div > ol > li > select";this._addSelector="#"+this._element.id+" > div > ol > li > ";this._limitSelector="#"+this._element.id+" > div > ol > li > ";}
else{this._masterSelector="."+this._mainclass+" > ol > li > select";this._addSelector="."+this._mainclass+" > ol > li > ";this._limitSelector="."+this._mainclass+" > ol > li > ";}
if(this.itemsSelected!=""){var newList=this.itemsSelected.split(":");this.setBoxValues(newList);}},initOnDemand:function(){if(this.initialItemCount!=null)
this._current_length=this.initialItemCount*1;else
this.evaluateLength();if(this.maxItems!=null){this._MAXITEMS=this.maxItems*1;}
if(this.wrapperClass){this._mainclass=this.wrapperClass;}
this.registerDataProperty("GetIndustries");this.registerDataProperty("SetIndustries");this.registerDataProperty("IndustriesList");this.registerDataProperty("GetIndustriesIDForSalaryBenchmark");this.registerDataProperty("IndustriesID");},initHandlers:function(element,event,context){event.preventDefault();this.lazyInitAdd();switch(element.className){case"removeDrop":$addHandlers(element,{click:function(){this.removeItem(element);}},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.removeItem(element);}
break;case"addDrop":this._addButton=element;$addHandlers(element,{click:this.addItem},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.addItem();}
break;case"selectDrop":break;default:break;}},lazyInitAdd:function(){if(this._addButton==null){if(this._current_length==this._MAXITEMS){this._addSelector=this._addSelector+".addDropHidden";this._limitSelector=this._limitSelector+"span.limitDropHidden";}
else{this._addSelector=this._addSelector+".addDrop";this._limitSelector=this._limitSelector+"span.limitDrop";}
var temp=$(this._addSelector)[0];if(temp){this._addButton=temp;}
var lbl=$(this._limitSelector);if(lbl){this._limitLabel=lbl;}}},addItem:function(){this.evaluateLength();if(this._current_length<this._maxItems){var newItem=this.generateClone();newItem.selectedIndex=0;if(newItem!=null){var appendTarget=$(this._masterSelector)[this._current_length-1].parentNode;var item=this.buildItem(newItem);if(item!=null&&appendTarget!=null){$(item).insertAfter(appendTarget);this._current_length++;}}}
if(this._current_length==3){this._addButton.className="addDropHidden";this._limitLabel.css("display","none");}},buildItem:function(dropElement){var i,elemLI,elemA;elemLI=document.createElement("LI");elemA=document.createElement("A");elemA.className="removeDrop";$addHandlers(elemA,{click:function(){this.removeItem(elemA);}},this);elemLI.appendChild(dropElement);elemLI.appendChild(elemA);return elemLI;},removeItem:function(element){var elemRemove=element.parentNode;$(elemRemove).remove();this._current_length--;if(this._current_length<this._maxItems){this._addButton.className="addDrop";this._limitLabel.css("display","");}
else{this._addButton.className="addDropHidden";this._limitLabel.css("display","none");}},evaluateLength:function(){this._current_length=$(this._masterSelector).length;},generateClone:function(){var dropitem=$(this._masterSelector).clone();if(dropitem.length>0)
return dropitem[0];else
return null;},setBoxValues:function(newList){items=$(this._masterSelector);var i=0;for(i=0;i<newList.length;i++){if(newList[i]!=""){if(i>=items.length){this.addItem();items=$(this._masterSelector);items[i].value=newList[i];}
else{items[i].value=newList[i];}}}
if(i<items.length&&this._current_length>1){var count=items.length-i;for(var j=count;j>0;j--){this.removeItem(items[j]);}}
this.evaluateLength();},resetList:function(){var items=$(this._masterSelector);if(items!=null){for(var i=0;i<items.length;i++){items[i].selectedIndex=0;}}},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.ComboBoxListAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"GetIndustries":var selecteditems=[];var item_elements=$(this._masterSelector);for(var i=0;i<item_elements.length;i++){selecteditems.push(item_elements[i].value);}
this._dataStore.set_property("IndustriesList",selecteditems);break;case"SetIndustries":this.lazyInitAdd();var selecteditems=this._dataStore.get_property("SetIndustries");if(selecteditems==null){this.resetList();}
else{this.setBoxValues(selecteditems);}
break;case"GetIndustriesIDForSalaryBenchmark":this._dataStore.set_property("IndustriesID",$(this._masterSelector));break;default:break;}}}
Monster.Client.Behavior.JobPosting.ComboBoxListAdapter.registerClass('Monster.Client.Behavior.JobPosting.ComboBoxListAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter.initializeBase(this,[element]);this.createProperty("quickLocationList");this.createProperty("fullLocationList");this.createProperty("fullLocationListContainer");this.createProperty("mapSection");this.createProperty("spanReachAdditionalMessage");this.createProperty("encryptedPostingId");this.createProperty("DateActive");this.createProperty("MAX_LOCATION_CHECKS");this.createProperty("lblAreaWideLocationCount");this.createProperty("areaWideLocCountMsgFormat");this.createProperty("divJobSeekerData");this.createProperty("divChangeMapView");this.createProperty("divChangeMapViewLinks");this.msgNoJobSeekerActivity=null;this.msgSeeJobSeekerActivity=null;this.initDateActive=null;this._delegates=[];this._selectedLocationIds={};this._numLocationSelections=0;this._quickLocationCheckboxCache={};this._quickLocationListData={};this._quickLocationNumNodesChecked=0;this._quickLocationUnCheckedDisabled=false;this._fullLocationCheckboxCache={};this._fullLocationListLoadedMap={};this._fullLocationNumNodesChecked=0;this._fullLocationUnCheckedDisabled=false;this._mapInitialized=false;this._mapInitialAddress="";this._mapEnabled=false;this._preLoadMapLocation=null;this._preventQuickLocationClearing=false;this._mapDataCache=null;this._currentMapPoint=null;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter.callBaseMethod(this,'initialize');this.setupQuickLocationCheckboxCache();this.fullLocationList.control.JobPostingOptionsSearchLocationAdapter=this;this.fullLocationList.control.add_nodeExpanded(this.onFullLocationNodeExpanded);this.fullLocationList.control.add_nodeChecked(this.onFullLocationNodeChecked);if(this.DateActive){$.datepicker._attachDatepicker(this.DateActive,null);if(this.initDateActive){this.DateActive.value=this.initDateActive;this.dateActiveInitDelegate=Function.createDelegate(this,this.dateActiveInit);window.setTimeout(this.dateActiveInitDelegate,3000);}
this.activeDateChangeDelegate=Function.createDelegate(this,this.activeDateChange);$addHandlers(this.DateActive,{change:this.activeDateChangeDelegate},this);this._dataStore.set_property("OPTIONS_PostingActiveDate",this.initDateActive);}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this.divChangeMapView.style.display="none";this.registerDataProperty("currentPage");this.registerDataProperty("JobPostingOptionsSearchLocationAdapter_clickFullLocationListSave");this.registerDataProperty("OPTIONS_mapEnabled");this.registerDataProperty("OPTIONS_MapData");this.registerDataProperty("OPTIONS_defaultQuickLocations");this.registerDataProperty("SetValidationErrors");this.registerDataProperty("UpdatePostingActiveDate");},initHandlers:function(element,event,context){if(context&&context.action=="mapview"){$addHandlers(element,{click:this.selectCountryOnMap},{adapter:this,mapAddress:this._mapDataCache[context.id]});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.selectCountryOnMap(null,this._mapDataCache[context.id]);}}
else if(element.id.endsWith("selectMoreButton")){var delegate=Function.createDelegate(this,this.onSelectMorePressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onSelectMorePressed(event);}
else if(element.id.endsWith("btnFullLocationsListCancel")){var delegate=Function.createDelegate(this,this.onFullLocationsListCancelPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onFullLocationsListCancelPressed(event);}
else if(element.id.endsWith("btnFullLocationsListSave")){var delegate=Function.createDelegate(this,this.onFullLocationsListSavePressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onFullLocationsListSavePressed(event);}},initMap:function(){if(this._mapInitialized||!this._mapEnabled)
return;if(typeof(JobLocGenericMap_init)!="undefined"){var me=this;setTimeout(function(){if(typeof(JobLocGenericMap_init)!="undefined"){JobLocGenericMap_init();if(me._preLoadMapLocation!=null){if(me._preLoadMapLocation.Latitude===0||me._preLoadMapLocation.Longitude===0)
JobLocGenericMap.FindAddress(me._preLoadMapLocation.MapCountryName);else
JobLocGenericMap.FindAddress(String.format("{0}, {1}",me._preLoadMapLocation.Latitude,me._preLoadMapLocation.Longitude));}
JobLocGenericMap.AddPOIService(Services.POIServices.SeekerActivityHeatMap.POIService,null);JobLocGenericMap.AddEventHandler("markerclick",me,me.onMapMarkerClicked);me.setupQuickLocationCheckboxCachePostInit();}},500);}
this._mapInitialized=true;},dispose:function(){if(MonsPageManager.initState(this._id)){this.fullLocationList.control.remove_nodeExpanded(this.onFullLocationNodeExpanded);this.fullLocationList.control.remove_nodeExpanded(this.onFullLocationNodeChecked);for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
if(this.DateActive){this._dataStore.set_property("OPTIONS_PostingActiveDate",this.DateActive.value);if(this.DateActive){$(this.DateActive.id).datepicker({onClose:null});delete this.activeDateChangeDelegate;}
delete this.dateActiveInitDelegate;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"currentPage":if(this._dataStore.get_property("currentPage")=="OPTIONS"){}
break;case"JobPostingOptionsSearchLocationAdapter_clickFullLocationListSave":this.onFullLocationsListSavePressed();break;case"OPTIONS_mapEnabled":this._mapEnabled=this._dataStore.get_property("OPTIONS_mapEnabled");if(!this._mapEnabled){this.mapSection.style.display="none";this.divChangeMapView.style.display="none";$get("locationListSection").style.width="650px";}
else{this.initMap();this.mapSection.style.display="block";this.divChangeMapView.style.display="block";}
break;case"OPTIONS_MapData":if(this._mapEnabled){var mapDataList=this._dataStore.get_property("OPTIONS_MapData");var mapAddress=mapDataList[0];this._setUpMapAreaLinks(mapDataList);this._selectCountryOnMap(mapAddress);}
else{var mapDataList=[];this._setUpMapAreaLinks(mapDataList);}
break;case"OPTIONS_defaultQuickLocations":var locationData=this._dataStore.get_property("OPTIONS_defaultQuickLocations");if(!this._preventQuickLocationClearing){if(JobLocGenericMap!=null){JobLocGenericMap.SelectAll(false);}
this.clearQuickLocationsList();}
for(var i=0;i<locationData.length;i++)
this.addQuickLocationCheckbox(locationData[i],args.get_context()=="init");this._dataStore.set_property("selectedLocations",this._selectedLocationIds);break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement){case"JobSearchArea":this.ShowError(this.quickLocationList,temp.isShow);break;default:break;}
break;case"UpdatePostingActiveDate":this.activeDateChange();break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;if(result!=null&&result.ErrorDatas!=null&&result.ErrorDatas.length==1&&result.ErrorDatas[0].WSErrorType==Presenters.Base.Data.WSErrorType.ErrorJobWizardContext){userContext._dataStore.set_property("TriggerJobWizardContextError");return;}
switch(methodName){case"UpdateLocationSelection":userContext._preventQuickLocationClearing=true;userContext._dataStore.set_property("FillPostingOptionsData",result);userContext._preventQuickLocationClearing=true;if(result==null){var summaryBody=userContext._dataStore.get_property("summaryBody");summaryBody.style.display="block";}
break;case"GetLocationNodesByPostingIdAndCountryId":userContext.populateFullLocationCountryNode(result.CountryId,result.LocationNodes);break;}},onFailure:function(result,userContext,methodName){},onSelectMorePressed:function(event){event.stopPropagation();event.preventDefault();if(event.target.id.endsWith("selectMoreButton")||event.target.parentNode.id.endsWith("selectMoreButton")){this._fullLocationNumNodesChecked=0;var processedCheckboxes=[];for(var currentNodeId in this._fullLocationCheckboxCache){var currentNode=this._fullLocationCheckboxCache[currentNodeId];if(this._selectedLocationIds[currentNodeId]==true){this._fullLocationNumNodesChecked++;if(this._fullLocationNumNodesChecked==this.MAX_LOCATION_CHECKS){for(var i=0;i<processedCheckboxes.length;i++)
processedCheckboxes[i].set_enabled(false);}
currentNode.set_checked(true);}
else{if(this.MAX_LOCATION_CHECKS>=0&&this._fullLocationNumNodesChecked>=this.MAX_LOCATION_CHECKS)
currentNode.set_enabled(false);else
processedCheckboxes.push(currentNode);currentNode.set_checked(false);}}
var flist=$(this.fullLocationListContainer);var target=$(event.target);if(flist.parent().get(0).tagName!='BODY'){$('body').append(flist);var self=this;var resizeTimer=null;$(window).bind('resize',function(){if(resizeTimer)clearTimeout(resizeTimer);resizeTimer=setTimeout(function(){self.positionMoreAreas(target,flist)},100);});}
flist.css({"display":"block"});this.positionMoreAreas(target,flist);}},positionMoreAreas:function(target,flist){var ebtnOffset=target.offset();flist.css({"top":ebtnOffset.top-1+'px',"left":ebtnOffset.left-107+'px'})},onMapMarkerClicked:function(mapMarker){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var adapter=this.Object;if(mapMarker.IsSelected)
adapter.selectLocation(mapMarker.ID);else
adapter.deSelectLocation(mapMarker.ID);var selectedIdsList=[];for(var currentId in adapter._selectedLocationIds){if(adapter._selectedLocationIds[currentId])
selectedIdsList.push(currentId);}
adapter.callServer("UpdateLocationSelection",[adapter.encryptedPostingId,selectedIdsList]);adapter._dataStore.set_property("selectedLocations",adapter._selectedLocationIds);},clearQuickLocationsList:function(){this.quickLocationList.innerHTML="";this._quickLocationCheckboxCache={};this._quickLocationListData={};},deSelectLocation:function(locationId){var locationCacheEntry=this._quickLocationCheckboxCache[locationId];if(locationCacheEntry!=null)
locationCacheEntry.checkbox.checked=false;this.updateQuickLocationCheckboxEnablement(locationCacheEntry.checkbox);if(this._selectedLocationIds[locationId]){this._numLocationSelections--;if(this.areaWideLocCountMsgFormat){this.lblAreaWideLocationCount.innerHTML=String.format(this.areaWideLocCountMsgFormat,this._numLocationSelections);}
this._selectedLocationIds[locationId]=false;}
if(typeof(JobLocGenericMap)!="undefined"&&JobLocGenericMap!=null)
JobLocGenericMap.SelectMarker(locationId,false);},selectLocation:function(locationId){var locationCheckbox=null;if(typeof(this.quickLocationList)=="object"){var locationCacheEntry=this._quickLocationCheckboxCache[locationId];if(locationCacheEntry==null){var checkbox=$get("chk"+String(locationId),this.quickLocationList);if(checkbox!=null){var newCacheEntry={checkbox:checkbox};this._quickLocationCheckboxCache[locationId]=newCacheEntry;locationCacheEntry=newCacheEntry;}}
if(locationCacheEntry!=null){locationCacheEntry.checkbox.checked=true;locationCheckbox=locationCacheEntry.checkbox;}
if(typeof(JobLocGenericMap)!="undefined"&&JobLocGenericMap!=null)
JobLocGenericMap.SelectMarker(locationId,true);}
{this.updateQuickLocationCheckboxEnablement(locationCheckbox);if(!this._selectedLocationIds[locationId]){this._numLocationSelections++;if(this._numLocationSelections>0){if(this.areaWideLocCountMsgFormat){this.lblAreaWideLocationCount.innerHTML=String.format(this.areaWideLocCountMsgFormat,this._numLocationSelections);}}
this._selectedLocationIds[locationId]=true;}}},addQuickLocationCheckbox:function(quickCheckboxData,makeSelectionsBold){var cachedCheckbox=this._quickLocationCheckboxCache[quickCheckboxData.LocationId];if(cachedCheckbox==null){this._quickLocationListData[quickCheckboxData.LocationId]=quickCheckboxData;var newCheckboxElement=null;if(typeof(this.quickLocationList)=="object"){var newCheckboxElement=document.createElement("input");newCheckboxElement.setAttribute("id","chk"+String(quickCheckboxData.LocationId));newCheckboxElement.setAttribute("type","checkbox");newCheckboxElement.setAttribute("lastCheckValue","false");var newSpanElement=document.createElement("span");if(quickCheckboxData.IsSelected){newCheckboxElement.setAttribute("checked","checked");if(makeSelectionsBold){newSpanElement.setAttribute("class","input-label");if($isIE()){newSpanElement.style.fontWeight="bold";}}}
var spanContents=quickCheckboxData.Description;newSpanElement.innerHTML=spanContents;var newBrElement=document.createElement("br");this.quickLocationList.appendChild(newCheckboxElement);this.quickLocationList.appendChild(newSpanElement);this.quickLocationList.appendChild(newBrElement);var delegate=Function.createDelegate(this,this.onQuickLocationCheckboxClicked);$addHandler(newCheckboxElement,"click",delegate);this._delegates.push([newCheckboxElement,"click",delegate]);this._quickLocationCheckboxCache[quickCheckboxData.LocationId]={checkbox:newCheckboxElement};}}
if(quickCheckboxData.IsSelected)
this.selectLocation(quickCheckboxData.LocationId);else
this.deSelectLocation(quickCheckboxData.LocationId);},setupQuickLocationCheckboxCachePostInit:function(){for(var currentId in this._quickLocationListData){var checkboxId="chk"+String(currentId);var checkbox=$get(checkboxId,this.quickLocationList);if(checkbox.checked)
JobLocGenericMap.SelectMarker(currentId,true);}},setupQuickLocationCheckboxCache:function(){for(var currentId in this._quickLocationListData){var checkboxId="chk"+String(currentId);var checkbox=$get(checkboxId,this.quickLocationList);this._quickLocationCheckboxCache[currentId]={checkbox:checkbox};if(!this._selectedLocationIds[currentId]){this._numLocationSelections++;this._selectedLocationIds[currentId]=checkbox.checked;}
var delegate=Function.createDelegate(this,this.onQuickLocationCheckboxClicked);$addHandler(checkbox,"click",delegate);this._delegates.push([checkbox,"click",delegate]);}},onQuickLocationCheckboxClicked:function(event){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var checkboxId=event.target.id.substring(3);if(event.target.checked)
this.selectLocation(checkboxId);else
this.deSelectLocation(checkboxId);var selectedIdsList=[];for(var currentId in this._selectedLocationIds){if(this._selectedLocationIds[currentId])
selectedIdsList.push(currentId);}
this.callServer("UpdateLocationSelection",[this.encryptedPostingId,selectedIdsList]);this._dataStore.set_property("selectedLocations",this._selectedLocationIds);},updateQuickLocationCheckboxEnablement:function(checkbox){if(checkbox==null)
return;if(checkbox.checked){if(checkbox.getAttribute("lastCheckValue")=="false"){checkbox.setAttribute("lastCheckValue","true");this._quickLocationNumNodesChecked++;if(this.MAX_LOCATION_CHECKS>=0&&this._quickLocationNumNodesChecked>=this.MAX_LOCATION_CHECKS&&!this._quickLocationUnCheckedDisabled){this._quickLocationUnCheckedDisabled=true;for(var currentNodeId in this._quickLocationCheckboxCache){var currentNode=this._quickLocationCheckboxCache[currentNodeId];if(currentNode.checkbox.checked==false)
currentNode.checkbox.disabled=true;}}}}
else{if(checkbox.getAttribute("lastCheckValue")=="true"){checkbox.setAttribute("lastCheckValue","false");this._quickLocationNumNodesChecked--;if(this._quickLocationNumNodesChecked<this.MAX_LOCATION_CHECKS&&this._quickLocationUnCheckedDisabled){this._quickLocationUnCheckedDisabled=false;for(var currentNodeId in this._quickLocationCheckboxCache){var currentNode=this._quickLocationCheckboxCache[currentNodeId];currentNode.checkbox.disabled=false;}}}}},onFullLocationNodeExpanded:function(sender,args){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var node=args.get_node();var adapter=sender.JobPostingOptionsSearchLocationAdapter;adapter.expandFullLocationNode(node);},onFullLocationNodeChecked:function(sender,args){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var node=args.get_node();var adapter=sender.JobPostingOptionsSearchLocationAdapter;if(node.get_checked()){adapter._fullLocationNumNodesChecked++;if(adapter.MAX_LOCATION_CHECKS>=0&&adapter._fullLocationNumNodesChecked>=adapter.MAX_LOCATION_CHECKS&&!adapter._fullLocationUnCheckedDisabled){adapter._fullLocationUnCheckedDisabled=true;for(var currentNodeId in adapter._fullLocationCheckboxCache){var currentNode=adapter._fullLocationCheckboxCache[currentNodeId];if(currentNode.get_checked()==false)
currentNode.set_enabled(false);}}}
else{adapter._fullLocationNumNodesChecked--;if(adapter._fullLocationNumNodesChecked<adapter.MAX_LOCATION_CHECKS&&adapter._fullLocationUnCheckedDisabled){adapter._fullLocationUnCheckedDisabled=false;for(var currentNodeId in adapter._fullLocationCheckboxCache){var currentNode=adapter._fullLocationCheckboxCache[currentNodeId];if(currentNode.get_enabled()==false)
currentNode.set_enabled(true);}}}},expandFullLocationNode:function(node){var expandNodeCountryId=node.get_value();if(this._fullLocationListLoadedMap[expandNodeCountryId]==null){this._fullLocationListLoadedMap[expandNodeCountryId]=node;this.callServer("GetLocationNodesByPostingIdAndCountryId",[this.encryptedPostingId,expandNodeCountryId]);}},populateFullLocationCountryNode:function(countryId,nodes){var parentNode=this._fullLocationListLoadedMap[countryId];parentNode.get_nodes().clear();for(var i=0;i<nodes.length;i++){var currentData=nodes[i];var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(currentData.Description);childNode.set_postBack(false);childNode.set_value(currentData.LocationId);childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);this._fullLocationCheckboxCache[currentData.LocationId]=childNode;parentNode.get_nodes().add(childNode);if(this._selectedLocationIds[currentData.LocationId]==true){this._fullLocationNumNodesChecked++;childNode.set_checked(true);}
else if(this._fullLocationUnCheckedDisabled){childNode.set_enabled(false);}}},onFullLocationsListCancelPressed:function(event){event.stopPropagation();event.preventDefault();this.fullLocationListContainer.style.display="none";},onFullLocationsListSavePressed:function(event){if(event!=null){event.stopPropagation();event.preventDefault();}
var selectedIdsList=[];for(var currentId in this._selectedLocationIds){if(this._selectedLocationIds[currentId]&&this._fullLocationCheckboxCache[currentId]==null)
selectedIdsList.push(currentId);}
var notLoadedIds=[];for(var currentCheckboxId in this._fullLocationCheckboxCache){var currentCheckbox=this._fullLocationCheckboxCache[currentCheckboxId];if(currentCheckbox.get_checked())
notLoadedIds.push(currentCheckboxId);}
var combinedIdList=selectedIdsList.concat(notLoadedIds);this.callServer("UpdateLocationSelection",[this.encryptedPostingId,combinedIdList]);if(event!=null)
this.fullLocationListContainer.style.display="none";},activeDateChange:function(sender,args){if(this.DateActive!=null){this._dataStore.set_property("OPTIONS_PostingActiveDate",this.DateActive.value);}},_setUpMapAreaLinks:function(mapDataList){this._mapDataCache={};var mapCount=mapDataList.length;var strCountries=null;if(mapCount>1){this.divChangeMapViewLinks.innerHTML="";for(var i=0;i<mapCount;i++){var country=mapDataList[i];this._mapDataCache[country.MapCountryName]=country;if(!strCountries){if(this._currentMapPoint!=null){if(country.TranslatedCountryName==this._currentMapPoint){strCountries=String.format("<b>{0}</b>",country.TranslatedCountryName);}
else{strCountries=String.format("<a href='#' onclick=\"initClick(this, event, [{{adapterID:'{0}',context:{{action:'mapview', id:'{1}'}}}}]);\">{2}</a>",this.get_id(),country.MapCountryName,country.TranslatedCountryName);}}
else{strCountries=String.format("<b>{0}</b>",country.TranslatedCountryName);this._currentMapPoint=country.TranslatedCountryName;}}
else{if(country.TranslatedCountryName==this._currentMapPoint){strCountries=strCountries+String.format(", <b>{0}</b>",country.TranslatedCountryName);}
else{strCountries=strCountries+String.format(", <a href='#' onclick=\"initClick(this, event, [{{adapterID:'{0}',context:{{action:'mapview', id:'{1}'}}}}]);\">{2}</a>",this.get_id(),country.MapCountryName,country.TranslatedCountryName);}}}
this.divChangeMapViewLinks.innerHTML=strCountries;this.divChangeMapView.style.display="";}
else{this.divChangeMapView.style.display="none";}},selectCountryOnMap:function(adapter,mapAddress){if(adapter==null){this._selectCountryOnMap(mapAddress);}
else{this.adapter._selectCountryOnMap(this.mapAddress);}},_selectCountryOnMap:function(mapAddress){if(mapAddress.HasHeatMapData){this.divJobSeekerData.innerHTML=this.msgSeeJobSeekerActivity;}
else{this.divJobSeekerData.innerHTML=this.msgNoJobSeekerActivity;}
if(this._preLoadMapLocation===null){this._preLoadMapLocation=mapAddress;}
else if(this._preLoadMapLocation.MapCountryName===mapAddress.MapCountryName){return;}
this._preLoadMapLocation=mapAddress;if(JobLocGenericMap!=null){if(mapAddress.Latitude===0||mapAddress.Longitude===0)
JobLocGenericMap.FindAddress(mapAddress.MapCountryName);else
JobLocGenericMap.FindAddress(String.format("{0}, {1}",mapAddress.Latitude,mapAddress.Longitude));}
if(this._currentMapPoint!=null){this._currentMapPoint=mapAddress.TranslatedCountryName;var mapDataList=this._dataStore.get_property("OPTIONS_MapData");this._setUpMapAreaLinks(mapDataList);}},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.quickLocationList:labelTag="lblSearchArea";iconTag="errorSearchArea";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}},dateActiveInit:function(){this.DateActive.value=this.initDateActive;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter.initializeBase(this,[element]);this.createProperty("currentPostingsTable");this.createProperty("divSelectionArea");this.createProperty("btnAddEntries");this.createProperty("btnEditOkButton");this.createProperty("btnEditCancelButton");this.createProperty("btnAddOkButton");this.createProperty("btnAddCancelButton");this.createProperty("tvCategories");this.createProperty("divAddSelectionArea");this.createProperty("_tvCategoriesData");this.createProperty("editHeaderMsg");this.createProperty("addHeaderMsg");this.createProperty("fullLocationList");this.createProperty("fullLocationListContainer");this.createProperty("encryptedPostingId");this.createProperty("actionMessages");this.createProperty("loadingMessage");this.createProperty("DateActive");this.initDateActive=null;this.DateActiveTextControl=null;this.currentPostingsTableBody=null;this._delegates=[];this._fullLocationListLoadedMap={};this._maxPostingAdLimit=100;this._postingAdsCbxTracker={};this._lastSelectedLocationNode=null;this._currentEditRow=null;this._rowEditting=null;this._currentMaxOccupations=null;this._locationValid=true;this._occupationValid=true;this.msgLocationMissing=null;this.msgOccupationMissing=null;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter.callBaseMethod(this,'initialize');if(typeof(this._tvCategoriesData)=="undefined")
this._tvCategoriesData={};this.tvCategories.control.JobPostingOptionsSearchLocationEditAdapter=this;this.tvCategories.control.add_nodeExpanded(this.onCategoryNodeExpanded);this.tvCategories.control.add_nodeChecked(this.onCategoryNodeChecked);this.fullLocationList.control.JobPostingOptionsSearchLocationEditAdapter=this;this.fullLocationList.control.add_nodeExpanded(this.onFullLocationNodeExpanded);this.fullLocationList.control.add_nodeClicked(this.onFullLocationNodeChecked);var delegate=Function.createDelegate(this,this.onLinkClicked);$addHandler(this.currentPostingsTable,"click",delegate);this._delegates.push([this.currentPostingsTable,"click",delegate]);if(this.DateActive){this.activeDateChangeDelegate=Function.createDelegate(this,this.activeDateChange);$addHandlers(this.DateActive,{change:this.activeDateChangeDelegate},this);this.DateActiveTextControl=this.DateActive;this.DateActiveTextControl.value=this.initDateActive;}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this.registerDataProperty("OPTIONS_defaultPostingData");this.registerDataProperty("currentPage");this.registerDataProperty("ErrorSummaryDisplay_ClearErrors");this._dataStore.set_property("CONTROL_divAddSelectionArea",this.divAddSelectionArea.id);this.currentPostingsTableBody=this.currentPostingsTable.getElementsByTagName("tbody")[0];},initHandlers:function(element,event,context){if(element.id.endsWith("btnAddEntries")){var delegate=Function.createDelegate(this,this.onAddEntriesClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onAddEntriesClicked(event);}
else if(element.id.endsWith("btnAddOkButton")){var delegate=Function.createDelegate(this,this.onAddOkButtonClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onAddOkButtonClicked(event);}
else if(element.id.endsWith("btnEditOkButton")){var delegate=Function.createDelegate(this,this.onEditOkButtonClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onEditOkButtonClicked(event);}
else if(element.id.endsWith("btnEditCancelButton")){var delegate=Function.createDelegate(this,this.onEditCancelButtonClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onEditCancelButtonClicked(event);}
else if(element.id.endsWith("btnAddCancelButton")){var delegate=Function.createDelegate(this,this.onAddCancelButtonClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onAddCancelButtonClicked(event);}},dispose:function(){if(MonsPageManager.initState(this._id)){this.tvCategories.control.remove_nodeExpanded(this.onNodeExpanded);this.fullLocationList.control.remove_nodeExpanded(this.onFullLocationNodeExpanded);for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
if(this.DateActive){$(this.DateActive.id).datepicker({onClose:null});delete this.activeDateChangeDelegate;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultPostingData":var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");this.clearPostings();for(var i=0;i<postingDatas.length;i++){var currentPostingData=postingDatas[i];this.addPosting(currentPostingData);}
this._updateRowType();this._dataStore.set_property("OPTIONS_PostingAdQuantity",postingDatas.length);this._updateAddLink();break;case"currentPage":if(this._dataStore.get_property("currentPage")=="DETAILS"){if(this._rowEditting==0){this.onAddCancelButtonClicked();}
else if(typeof(this._rowEditting)=="string"){this.onEditCancelButtonClicked();}}
break;case"ErrorSummaryDisplay_ClearErrors":this._locationValid=true;this._occupationValid=true;break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;if(result.ErrorDatas!=null&&result.ErrorDatas.length===1&&result.ErrorDatas[0].WSErrorType==Presenters.Base.Data.WSErrorType.ErrorJobWizardContext){userContext._dataStore.set_property("TriggerJobWizardContextError");return;}
switch(methodName){case"GetOccupationsByCategoryId":userContext.storeCategory(result);var categoryNode=userContext.tvCategories.control.findNodeByValue(result.Id);userContext.expandCategory(categoryNode);break;case"GetLocationNodesByPostingIdAndCountryId":userContext.populateFullLocationCountryNode(result.CountryId,result.LocationNodes);break;case"GetLocationCategoryDataByLocationCategoryView":if(result.Countries){var selectedCountry=result.Countries[0];if(selectedCountry){var cachedCountryNode=userContext._fullLocationListLoadedMap[selectedCountry.CountryId];if(!cachedCountryNode){var countryNodes=userContext.fullLocationList.control.get_nodes();for(var i=0,l=countryNodes.get_count();i<l;i++){var countryNode=countryNodes.getNode(i);if(countryNode.get_text()==selectedCountry.CountryName){cachedCountryNode=countryNode;break;}}
userContext._fullLocationListLoadedMap[selectedCountry.CountryId]=cachedCountryNode;}
if(selectedCountry.LocationNodes&&selectedCountry.LocationNodes.length>0){userContext.populateFullLocationCountryNode(selectedCountry.CountryId,selectedCountry.LocationNodes);}
else{cachedCountryNode.set_selected(true);cachedCountryNode.scrollIntoView();}}}
userContext._processCategoryResultData(result.CategoryResultData);break;case"GetLocationCategoryData":userContext._processCategoryResultData(result.CategoryResultData);break;case"SavePositionAd":if(result.EnhancementDatas!=null)
userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);userContext.addPosting(result.PostingData);userContext._updateRowType();userContext._clearUserChanges();userContext._updateAddLink();userContext.callServer("GetRefreshedPostingSummaryDataForEdit",[userContext.encryptedPostingId]);break;case"RemoveLastPositionAd":userContext._dataStore.set_property("FillPostingOptionsData",result);break;case"UpdateAdState":case"UpdatePositionAd":if(result.EnhancementDatas!=null)
userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);if(result.PostingData!=null)
userContext.editPosting(result.PostingData);var hasAd=userContext._dataStore.get_property("OPTIONS_PostingAdQuantity")!=0;if(!hasAd)
userContext._dataStore.set_property("RemoveOptionsEditControls",1);userContext._clearUserChanges();userContext.callServer("GetRefreshedPostingSummaryDataForEdit",[userContext.encryptedPostingId]);break;case"GetRefreshedPostingSummaryDataForEdit":userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result);break;case"GetCategoryDatasByLocationId":userContext._processCategoryResultData(result);break;}},_updateAddLink:function(){if(parseInt(this._dataStore.get_property("OPTIONS_PostingAdQuantity"))>=this._maxPostingAdLimit){this.btnAddEntries.style.display="none";}
else{this.btnAddEntries.style.display="block";}},_processCategoryResultData:function(newData){var postingData=null;if(this._rowEditting){var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");for(var i=0,l=postingDatas.length;i<l;i++){if(postingDatas[i].PrePostPositionAdId==this._rowEditting){postingData=postingDatas[i];break;}}}
if(newData.GlobalMaxOccsAllowed>0)
this._currentMaxOccupations=newData.GlobalMaxOccsAllowed;if(newData.CategoriesRemoved)
this.removeCategory(newData.CategoriesRemoved);if(postingData){var categoryNode=this.tvCategories.control.findNodeByValue(postingData.CategoryOccupations.Id);if(categoryNode!=null){this.preSelectOccupations(postingData,categoryNode);}}
var categoryList=newData.CategoriesUpdated;if(categoryList){for(var i=0,l=categoryList.length;i<l;i++){this.addCategory(categoryList[i],postingData);}}},onFailure:function(result,userContext,methodName){},onAddEntriesClicked:function(event){this._clearUserChanges();this.hideEditView(true);this._rowEditting=0;if(!this._postingAdsCbxTracker[this._rowEditting]){this._postingAdsCbxTracker[this._rowEditting]={};this._postingAdsCbxTracker[this._rowEditting].count=0;}
this.divSelectionArea.style.display="block";this.btnAddEntries.parentNode.style.display="none";this.btnEditOkButton.style.display="none";this.btnEditCancelButton.style.display="none";this.btnAddOkButton.style.display="inline";this.btnAddCancelButton.style.display="inline";this.editHeaderMsg.style.display="none";this.addHeaderMsg.style.display="block";this.callServer("GetLocationCategoryData",[this.encryptedPostingId]);event.stopPropagation();event.preventDefault();},onAddOkButtonClicked:function(event){var userSelections=this._collectUserSelections();if(userSelections){this.divSelectionArea.style.display="none";this.btnAddEntries.parentNode.style.display="block";var postingDate="";if(this.DateActiveTextControl){postingDate=this.DateActiveTextControl.value;}
this.callServer("SavePositionAd",[this.encryptedPostingId,userSelections.locationId,userSelections.category,postingDate]);}
event.stopPropagation();event.preventDefault();},_collectUserSelections:function(){var selectedLocation=this.fullLocationList.control.get_selectedNode();var selectedOccupations=this.tvCategories.control.get_checkedNodes();if(selectedLocation){this._locationValid=true;}
else{if(this._locationValid){this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgLocationMissing);this._locationValid=false;}}
if(selectedOccupations.length>0){this._occupationValid=true;}
else{if(this._occupationValid){this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgOccupationMissing);this._occupationValid=false;}}
if(this._locationValid&&this._occupationValid){this._dataStore.set_property("validateOptionsPage_results",true);this._dataStore.set_property("ErrorSummaryDisplay_ClearErrors",1);}
else{this._dataStore.set_property("validateOptionsPage_results",false);return null;}
var selectedCategory=selectedOccupations[0].get_parent();var category={};category.CategoryId=selectedCategory.get_value();category.Occupations=[];for(var i=0;i<selectedOccupations.length;i++)
category.Occupations.push(selectedOccupations[i].get_value());return{locationId:selectedLocation.get_value(),category:category};},addPosting:function(postingData){var lookupId;if(postingData.EncryptedAdId==null||postingData.EncryptedAdId.length==0)
lookupId=String.format("{0}",postingData.PrePostPositionAdId);else
lookupId=postingData.EncryptedAdId;var localDocument=document;var trEl=localDocument.createElement("tr");trEl.setAttribute("encryptedId",lookupId);var tdEl=localDocument.createElement("td");var linksHtml="";for(var i=0;i<postingData.AvailableActions.length;i++){var currentAction=postingData.AvailableActions[i];if(linksHtml.length!=0)
linksHtml+="<br />";linksHtml+=String.format("<a href=\"#\" action=\"{0}\" encryptedId=\"{1}\">{2}</a>",currentAction,postingData.EncryptedAdId,this.actionMessages[currentAction]);}
tdEl.innerHTML=linksHtml;trEl.appendChild(tdEl);tdEl=localDocument.createElement("td");tdEl.innerHTML=postingData.SearchArea;trEl.appendChild(tdEl);tdEl=localDocument.createElement("td");tdEl.innerHTML=postingData.Category;trEl.appendChild(tdEl);tdEl=localDocument.createElement("td");tdEl.innerHTML=postingData.DateExpires;trEl.appendChild(tdEl);tdEl=localDocument.createElement("td");tdEl.innerHTML=postingData.Status;trEl.appendChild(tdEl);this.currentPostingsTableBody.appendChild(trEl);var trDivider=localDocument.createElement("tr");var tdDivider=localDocument.createElement("td");tdDivider.setAttribute("colSpan","5");trDivider.className="divider-row";trDivider.appendChild(tdDivider);this.currentPostingsTableBody.appendChild(trDivider);this._updatePostingsCache(postingData);},_updateRowType:function(){var rows=this.currentPostingsTableBody.getElementsByTagName("tr");var rowType="odd-row";for(var i=0;i<rows.length;i++){if(rows[i].className!="divider-row"){rows[i].className="";if(rowType=="even-row"){Sys.UI.DomElement.addCssClass(rows[i],"odd-row");rowType="odd-row";}
else{Sys.UI.DomElement.addCssClass(rows[i],"even-row");rowType="even-row";}}}},editPosting:function(postingData){var localDocument=document;var adId;if(postingData.EncryptedAdId==null||postingData.EncryptedAdId.length==0)
adId=postingData.PrePostPositionAdId;else
adId=postingData.EncryptedAdId;var tableRows=this.currentPostingsTableBody.getElementsByTagName("tr");for(var i=0;i<tableRows.length;i++){var currentRow=tableRows[i];if(currentRow.getAttribute("encryptedId")==adId){var columns=currentRow.getElementsByTagName("td");var linksHtml="";for(var j=0;j<postingData.AvailableActions.length;j++){var currentAction=postingData.AvailableActions[j];if(linksHtml.length!=0)
linksHtml+="<br />";linksHtml+=String.format("<a href=\"#\" action=\"{0}\" encryptedId=\"{1}\">{2}</a>",currentAction,adId,this.actionMessages[currentAction]);}
columns[0].innerHTML=linksHtml;columns[1].innerHTML=postingData.SearchArea;columns[2].innerHTML=postingData.Category;columns[3].innerHTML=postingData.DateExpires;columns[4].innerHTML=postingData.Status;currentRow.style.display="";break;}}
this._updatePostingsCache(postingData);this._updateAddLink();},deletePosting:function(lookupId){var rows=this.currentPostingsTableBody.getElementsByTagName("tr");for(var i=0;i<rows.length;i++){var currentRow=rows[i];if(currentRow.getAttribute("encryptedId")==lookupId){this.currentPostingsTableBody.removeChild(rows[i+1]);this.currentPostingsTableBody.removeChild(currentRow);break;}}
var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");for(var i=0,l=postingDatas.length;i<l;i++){if(postingDatas[i].PrePostPositionAdId==lookupId){postingDatas.splice(i,1);break;}}
this._updateRowType();this._dataStore.set_property("OPTIONS_PostingAdQuantity",postingDatas.length);this._updateAddLink();},clearPostings:function(){while(this.currentPostingsTableBody.rows.length>1)
this.currentPostingsTableBody.deleteRow(1);this._dataStore.set_property("OPTIONS_PostingAdQuantity",0);},_updatePostingsCache:function(postingData){var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");var existingData=false;for(var i=0,l=postingDatas.length;i<l;i++){if(postingDatas[i].PrePostPositionAdId==postingData.PrePostPositionAdId){postingDatas[i]=postingData;existingData=true;break;}}
if(!existingData)
postingDatas.push(postingData);this._dataStore.set_property("OPTIONS_PostingAdQuantity",postingDatas.length);},onCategoryNodeExpanded:function(sender,args){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var node=args.get_node();var adapter=sender.JobPostingOptionsSearchLocationEditAdapter;adapter.expandCategory(node);},expandCategory:function(node){var expandNodeCategoryId=node.get_value();var parentNode;var cachedCategoryData=this._tvCategoriesData[expandNodeCategoryId];if(cachedCategoryData.Occupations==null){this.callServer("GetOccupationsByCategoryId",[this.encryptedPostingId,expandNodeCategoryId]);return false;}
else{if(!node.isLoaded){node.get_nodes().clear();var cbxTracker=this._postingAdsCbxTracker[this._rowEditting];var isCurrentlySelectedCategory=false;if(!cbxTracker.currentCategory||cbxTracker.currentCategory==cachedCategoryData.Id){isCurrentlySelectedCategory=true;cbxTracker.count=0;}
for(var i=0;i<cachedCategoryData.Occupations.length;i++){var currentOccupation=cachedCategoryData.Occupations[i];var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(currentOccupation.OccupationName);childNode.set_postBack(false);childNode.set_value(currentOccupation.Id);childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);node.get_nodes().add(childNode);if(!isCurrentlySelectedCategory&&cbxTracker.count>0)
childNode.set_enabled(false);}
node.isLoaded=true;var postingData=null;if(this._rowEditting){var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");for(var i=0,l=postingDatas.length;i<l;i++){if(postingDatas[i].PrePostPositionAdId==this._rowEditting){postingData=postingDatas[i];break;}}}
if(postingData)
this.preSelectOccupations(postingData,node);}
return true;}},storeCategory:function(newCategoryData){var occupations=new Array();var cbxTracker=this._postingAdsCbxTracker[this._rowEditting];for(var i=0,l=newCategoryData.Occupations.length;i<l;i++){occupations.push(newCategoryData.Occupations[i]);}
this._tvCategoriesData[newCategoryData.Id].Occupations=occupations;},addCategory:function(newCategoryData,postingData){this._tvCategoriesData[newCategoryData.Id]=newCategoryData;var preSelectAndExpand=false;var categoryNode=null;var isNewCategory=true;var categoryTree=this.tvCategories.control;if(newCategoryData.Index>=0){categoryNode=categoryTree.findNodeByValue(newCategoryData.Id);}
if(categoryNode===null){var categoryNode=new Telerik.Web.UI.RadTreeNode();categoryNode.set_allowDrag(false);categoryNode.set_allowDrop(false);categoryNode.set_allowEdit(false);categoryNode.set_text(newCategoryData.CategoryName);categoryNode.set_postBack(false);categoryNode.set_value(newCategoryData.Id);categoryNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);}else{isNewCategory=false;categoryNode.get_nodes().clear();categoryNode.isLoaded=false;}
if(postingData&&postingData.CategoryOccupations.Id===newCategoryData.Id&&newCategoryData.Occupations!==null&&newCategoryData.Occupations.length>0){for(var i=0;i<newCategoryData.Occupations.length;i++){var currentOccupation=newCategoryData.Occupations[i];var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(currentOccupation.OccupationName);childNode.set_postBack(false);childNode.set_value(currentOccupation.Id);childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);categoryNode.get_nodes().add(childNode);}
preSelectAndExpand=true;}
else{var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(this.loadingMessage);childNode.set_postBack(false);childNode.set_value(0);categoryNode.get_nodes().add(childNode);}
if(newCategoryData.Index>=0){if(isNewCategory){categoryTree.get_nodes().insert(newCategoryData.Index,categoryNode);}}else{categoryTree.get_nodes().add(categoryNode);}
var foundNode=categoryTree.findNodeByText(newCategoryData.CategoryName);if(foundNode){$(foundNode.get_checkBoxElement()).css("display","none");}
if(preSelectAndExpand)
this.preSelectOccupations(postingData,categoryNode);},preSelectOccupations:function(postingData,categoryNode){var cachedSelectedOccupations=postingData.CategoryOccupations.Occupations;var hashSelectedOccupations={};for(var i=0,l=cachedSelectedOccupations.length;i<l;i++){if(cachedSelectedOccupations[i].IsSelected){hashSelectedOccupations[cachedSelectedOccupations[i].Id]=true;}}
var occupationNodes=categoryNode.get_nodes();for(i=0,l=occupationNodes.get_count();i<l;i++){var node=occupationNodes.getItem(i);if(hashSelectedOccupations[node.get_value()]){node.set_checked(true);this._onCategoryNodeChecked(node);}}
categoryNode.select();var expandNodeCategoryId=categoryNode.get_value();var parentNode;var cachedCategoryData=this._tvCategoriesData[expandNodeCategoryId];if(cachedCategoryData.Occupations==null){this.callServer("GetOccupationsByCategoryId",[this.encryptedPostingId,expandNodeCategoryId]);return false;}
categoryNode.expand();},removeCategory:function(categoryIds){var categoryTree=this.tvCategories.control;for(var i=0,l=categoryIds.length;i<l;i++){var catID=categoryIds[i];var categoryNode=categoryTree.findNodeByValue(catID);if(categoryNode!==null){categoryTree.get_nodes().remove(categoryNode);delete this._tvCategoriesData[catID];}}},onFullLocationNodeExpanded:function(sender,args){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var node=args.get_node();var adapter=sender.JobPostingOptionsSearchLocationEditAdapter;adapter.expandFullLocationNode(node);},expandFullLocationNode:function(node){var expandNodeCountryId=node.get_value();if(this._fullLocationListLoadedMap[expandNodeCountryId]==null){this._fullLocationListLoadedMap[expandNodeCountryId]=node;this.callServer("GetLocationNodesByPostingIdAndCountryId",[this.encryptedPostingId,expandNodeCountryId]);}},populateFullLocationCountryNode:function(countryId,nodes){var parentNode=this._fullLocationListLoadedMap[countryId];var expandCountry=false;var selectedChildNode=null;parentNode.get_nodes().clear();for(var i=0;i<nodes.length;i++){var currentData=nodes[i];var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(currentData.Description);childNode.set_postBack(false);childNode.set_value(currentData.LocationId);childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);parentNode.get_nodes().add(childNode);if(currentData.IsSelected){childNode.set_selected(true);expandCountry=true;if(selectedChildNode==null)
selectedChildNode=childNode;}}
if(expandCountry){parentNode.expand();if(selectedChildNode!=null)
selectedChildNode.scrollIntoView();}},onCategoryNodeChecked:function(sender,node){sender.JobPostingOptionsSearchLocationEditAdapter._onCategoryNodeChecked(node.get_node());},_onCategoryNodeChecked:function(node){var cbxTracker=this._postingAdsCbxTracker[this._rowEditting];var nodeParent=node.get_parent();if(!cbxTracker){this._postingAdsCbxTracker[this._rowEditting]={};this._postingAdsCbxTracker[this._rowEditting].count=0;cbxTracker=this._postingAdsCbxTracker;}
if(cbxTracker.currentCategory&&cbxTracker.currentCategory!=nodeParent.get_value())
return;var siblingNodes=nodeParent.get_nodes();var numSiblings=siblingNodes.get_count();if(!node.get_checked()){cbxTracker.count--;if(cbxTracker.count<=0){this._set_enabled_tree(true,this.tvCategories.control);delete cbxTracker.currentCategory;}
else{this._set_enabled_siblings(true,siblingNodes,numSiblings);}}
else{if(!cbxTracker.currentCategory)
cbxTracker.currentCategory=nodeParent.get_value();cbxTracker.count++;if(cbxTracker.count==1){this._set_enabled_tree(false,this.tvCategories.control,cbxTracker.currentCategory);}
if(cbxTracker.count>=this._currentMaxOccupations){this._set_enabled_siblings(false,siblingNodes,numSiblings);}}},_set_enabled_siblings:function(enable,siblings,count){for(var i=0;i<count;i++){if(enable){siblings.getNode(i).enable();}
else if(!siblings.getNode(i).get_checked()){siblings.getNode(i).disable();}}},_set_enabled_tree:function(enable,tree,excludedCategoryID){var nodes=tree.get_nodes();for(var i=0,l=nodes.get_count();i<l;i++){var node=nodes.getItem(i);if(excludedCategoryID==node.get_value())
continue;var childNodes=node.get_nodes();for(var j=0,k=childNodes.get_count();j<k;j++){childNodes.getItem(j).set_enabled(enable);}}},onFullLocationNodeChecked:function(sender,event){var node=event.get_node();var adapter=sender.JobPostingOptionsSearchLocationEditAdapter;if(node.get_parent().get_parent()==null&&node.get_nodes().get_count()!=0){if(adapter._lastSelectedLocationNode!=null)
adapter._lastSelectedLocationNode.select();}
else{adapter._lastSelectedLocationNode=node;adapter._onFullLocationNodeChecked(node);}},_onFullLocationNodeChecked:function(node){var nodeId=node.get_value();if(node.get_selected()){this.callServer("GetCategoryDatasByLocationId",[this.encryptedPostingId,nodeId]);}},onLinkClicked:function(event){if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var link=event.target;if(link.nodeName=="A"){var currentNode=link.parentNode;var hasAttribute=(currentNode.getAttribute("encryptedId")==null)?false:true;while(currentNode!=null&&currentNode.nodeName!="TR"&&!hasAttribute)
currentNode=currentNode.parentNode;if(currentNode!=null){var postingId=currentNode.getAttribute("encryptedId");var action=link.getAttribute("action");this.hideEditView(true);switch(parseInt(action)){case Presenters.JPW.DTO.AdActionTypes.Change:this.onEditClicked(postingId,currentNode);if(this.DateActive)
$.datepicker._attachDatepicker(this.DateActive,null);break;case Presenters.JPW.DTO.AdActionTypes.Delete:this.deletePosting(postingId);if(this.currentPostingsTableBody.getElementsByTagName("tr").length==1){this.callServer("RemoveLastPositionAd",[this.encryptedPostingId,postingId]);break;}
case Presenters.JPW.DTO.AdActionTypes.Expire:case Presenters.JPW.DTO.AdActionTypes.Refresh:case Presenters.JPW.DTO.AdActionTypes.Renew:case Presenters.JPW.DTO.AdActionTypes.Reset:this.callServer("UpdateAdState",[this.encryptedPostingId,postingId,action]);break;default:break;}}}
event.stopPropagation();event.preventDefault();},onEditClicked:function(encryptedId,rowNode){var numColumns=rowNode.getElementsByTagName("td").length;this._currentEditRow=rowNode;var editScreenRow=this.currentPostingsTableBody.insertRow(rowNode.rowIndex+1);var editScreenRowCell=document.createElement("td");editScreenRowCell.setAttribute("colSpan",numColumns);editScreenRow.appendChild(editScreenRowCell);editScreenRowCell.appendChild(this.divSelectionArea);rowNode.style.display="none";this.divSelectionArea.style.display="block";this.btnAddEntries.parentNode.style.display="block";this.btnEditOkButton.style.display="inline";this.btnEditCancelButton.style.display="inline";this.btnAddOkButton.style.display="none";this.btnAddCancelButton.style.display="none";this.editHeaderMsg.style.display="block";this.addHeaderMsg.style.display="none";this._rowEditting=encryptedId;if(!this._postingAdsCbxTracker[this._rowEditting]){this._postingAdsCbxTracker[this._rowEditting]={};this._postingAdsCbxTracker[this._rowEditting].count=0;}
var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");var currentPostingData;for(var i=0;i<postingDatas.length;i++){if(encryptedId==postingDatas[i].PrePostPositionAdId){var currentPostingData=postingDatas[i];break;}}
var view=new Presenters.JPW.DTO.LocationCategoryView();view.LocationId=currentPostingData.LocationId;view.LoadCountryLocations=true;view.CategoryId=currentPostingData.CategoryOccupations.Id;this.callServer("GetLocationCategoryDataByLocationCategoryView",[this.encryptedPostingId,view]);},onEditOkButtonClicked:function(event){var userSelections=this._collectUserSelections();if(userSelections){var postingDate="";if(this.DateActiveTextControl){postingDate=this.DateActiveTextControl.value;}
this.callServer("UpdatePositionAd",[this.encryptedPostingId,this._rowEditting,userSelections.locationId,userSelections.category,postingDate]);this._rowEditting=null;this.hideEditView(false);}
event.stopPropagation();event.preventDefault();},onEditCancelButtonClicked:function(event){this._clearUserChanges();this.hideEditView(true);if(event){event.stopPropagation();event.preventDefault();}},onAddCancelButtonClicked:function(event){this._clearUserChanges();this.divSelectionArea.style.display="none";this.btnAddEntries.parentNode.style.display="block";if(event){event.stopPropagation();event.preventDefault();}},_clearUserChanges:function(){this.fullLocationList.control.unselectAllNodes();var nodes=this.fullLocationList.control.get_nodes();for(var i=0,l=nodes.get_count();i<l;i++){nodes.getItem(i).collapse();}
delete this._postingAdsCbxTracker[this._rowEditting];this._rowEditting=null;this.tvCategories.control.unselectAllNodes();nodes=this.tvCategories.control.get_nodes();for(var i=0,l=nodes.get_count();i<l;i++){var node=nodes.getItem(i);node.collapse();node.enable();node.uncheck();var childNodes=node.get_nodes();for(var j=0,k=childNodes.get_count();j<k;j++){var childNode=childNodes.getItem(j);childNode.enable();childNode.uncheck();}}
this._dataStore.set_property("validateOptionsPage_results",true);this._dataStore.set_property("ErrorSummaryDisplay_ClearErrors",1);},hideEditView:function(displayEditRow){this.divSelectionArea.style.display="none";this.btnAddEntries.parentNode.style.display="block";if(this._currentEditRow!=null){var editScreenRow=this._currentEditRow.nextSibling;var editScreenRowCell=editScreenRow.getElementsByTagName("td")[0];this.divSelectionArea.style.display="none";this.divAddSelectionArea.appendChild(this.divSelectionArea);this.currentPostingsTableBody.removeChild(editScreenRow);if(displayEditRow)
this._currentEditRow.style.display="";this._currentEditRow=null;}},deletePostingsRow:function(postingId){},activeDateChange:function(){this._dataStore.set_property("OPTIONS_PostingActiveDate",this.DateActive.value);}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchLocationEditAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter.initializeBase(this,[element]);this.createProperty("tvCategories");this.createProperty("qfInputTextbox");this.createProperty("qfInputTextboxSelectionBox");this.createProperty("msgQFInputTextboxSelectionBoxNoMatches");this.createProperty("encryptedPostingId");this.createProperty("loadingMessage");this.createProperty("lblMaxOccupationsLimit");this.createProperty("lblOccupationsRemoved");this.createProperty("areaWideCatCountMsgFormat");this.createProperty("lblTotalCatCount");this.createProperty("lblCategoriesWarning");this.createProperty("IsAreaWideJob");this._delegates=[];this._qfDelegates=[];this._qfSelectedElementIndex=0;this._qfElementArray=[];this._occupationIdToCheck=null;this._selectionCache=[];this._selectedNodeCache={};this._tvCategoriesData=[];this._maxOccupationSelections=0;this.msgMaxOccupationsLimit=null;this.maxCategoryAllowed=null;this.maxCategorySelected=0;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter.prototype={initialize:function()
{Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter.callBaseMethod(this,'initialize');this.tvCategories.control.add_nodeExpanded(this.onNodeExpanded);this.tvCategories.control.add_nodeChecked(this.onNodeChecked);this.tvCategories.control.JobPostingOptionsSearchCategoryAdapter=this;if(!MonsPageManager.enableInitOnDemand)
{this.initOnDemand();}
else
{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function()
{this._webService=EBiz.Services.JPW.JobPostingOptionsService;if(this.qfInputTextboxSelectionBox!=null)
{var delegate=Function.createDelegate(this,this.onQuickFindMouseOut);$addHandler(this.qfInputTextboxSelectionBox,"mouseout",delegate);this._delegates.push([this.qfInputTextboxSelectionBox,"mouseout",delegate]);}
if(this.qfInputTextbox!=null)
{$addHandler(this.qfInputTextbox,'keypress',this.onEnterPress);var delegate=Function.createDelegate(this,this.onQuickFindBlur);$addHandler(this.qfInputTextbox,"blur",delegate);this._delegates.push([this.qfInputTextbox,"blur",delegate]);this.qfInputTextboxDefaultValue=this.qfInputTextbox.value;}
this.registerDataProperty("OPTIONS_defaultCategoryGlobalData");this.registerDataProperty("SetValidationErrors");},initHandlers:function(element,event,context)
{if(context=="qfInputTextbox_keyup")
{var delegate=Function.createDelegate(this,this.quickFindTextBoxUpdated);$addHandler(element,"keyup",delegate);this._delegates.push([element,"keyup",delegate]);if(!$isIE())
this.quickFindTextBoxUpdated(event);}
else if(context=="qfInputTextbox_focus")
{var delegate=Function.createDelegate(this,this.quickFindTextBoxClearContents);$addHandler(element,"focus",delegate);this._delegates.push([element,"focus",delegate]);if(!$isIE())
this.quickFindTextBoxClearContents(event);}},dispose:function()
{if(MonsPageManager.initState(this._id))
{this.tvCategories.control.remove_nodeExpanded(this.onNodeExpanded);for(var i=0;i<this._delegates.length;i++)
{var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];this.clearQuickFindDelegates();}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args)
{switch(args.get_propertyName())
{case"OPTIONS_defaultCategoryGlobalData":var globalData=this._dataStore.get_property("OPTIONS_defaultCategoryGlobalData");if(globalData.GlobalMaxOccsAllowed>0)
{if(globalData.GlobalMaxOccsAllowed<this._maxOccupationSelections)
{this.lblOccupationsRemoved.style.display="";}
else
{this.lblOccupationsRemoved.style.display="none";}
this._maxOccupationSelections=globalData.GlobalMaxOccsAllowed;this.lblMaxOccupationsLimit.innerHTML=String.format(this.msgMaxOccupationsLimit,globalData.MaxOccuptionMessage);}
for(var j=0;j<globalData.CategoriesRemoved.length;j++)
{var currentCategoryId=globalData.CategoriesRemoved[j];this.removeCategory(currentCategoryId);}
var focusNode=null;for(var j=0;j<globalData.CategoriesUpdated.length;j++)
{var currentCategory=globalData.CategoriesUpdated[j];var cachedCategory=null;for(var i=0,l=this._tvCategoriesData.length;i<l;i++)
{if(this._tvCategoriesData[i].Id==currentCategory.Id)
{cachedCategory=this._tvCategoriesData[i];break;}}
if(cachedCategory)
{this.updateCategory(currentCategory);}
else
{this.addCategory(currentCategory);if(currentCategory.Occupations&&currentCategory.Occupations.length)
{var recommendedOccupations=null;for(var i=0,l=currentCategory.Occupations.length;i<l;i++)
{var occupation=currentCategory.Occupations[i];if(occupation.IsSelected)
{if(!recommendedOccupations)
recommendedOccupations={};recommendedOccupations[occupation.Id]=true;}}
if(recommendedOccupations)
{var categoryNode=this.tvCategories.control.findNodeByValue(currentCategory.Id);this.expandCategory(categoryNode);var occupationNodes=categoryNode.get_nodes();var occupationCount=occupationNodes.get_count();for(var i=0;i<occupationCount;i++)
{var occupationNode=occupationNodes.getItem(i);if(recommendedOccupations[occupationNode.get_value()])
{this._checkOccupationCheckbox(occupationNode);if(!focusNode)
focusNode=occupationNode;}}
categoryNode.expand();}}}}
if(focusNode!=null)
{focusNode.scrollIntoView();}
break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement)
{case"JobSearchCategory":this.ShowError(this.tvCategories,temp.isShow);break;default:break;}
break;default:break;}},onSuccess:function(result,userContext,methodName)
{if(userContext.processWebServiceErrorList(result))
return;switch(methodName)
{case"GetOccupationByName":userContext.setQuickFindContent(result);break;case"GetOccupationsByCategoryId":userContext.storeCategory(result);var categoryNode=userContext.tvCategories.control.findNodeByValue(result.Id);userContext.expandCategory(categoryNode);if(userContext._occupationIdToCheck!=null)
{var occupationNode=userContext.tvCategories.control.findNodeByValue(userContext._occupationIdToCheck);if(occupationNode!=null)
userContext._checkOccupationCheckbox(occupationNode);userContext._occupationIdToCheck=null;}
break;case"UpdateCategorySelection":userContext._dataStore.set_property("selectedCategories",userContext._selectionCache);userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result);break;}},onFailure:function(result,userContext,methodName)
{},onEnterPress:function(e){var code;if(!e)e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;else if(e.charCode)code=e.charCode;if(code==13){if(typeof window.event=='undefined'){e.stopPropagation();e.preventDefault();}
e.returnValue=false;e.cancelBubble=true;}},quickFindTextBoxClearContents:function(event)
{if(this.qfInputTextbox.value==this.qfInputTextboxDefaultValue)
this.qfInputTextbox.value="";},quickFindTextBoxUpdated:function(event)
{if(event.keyCode==40)
{event.preventDefault();event.stopPropagation();if(this._qfElementArray.length>0)
{if(this._qfSelectedElementIndex>=0)
this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOff";this._qfSelectedElementIndex++;if(this._qfSelectedElementIndex>=this._qfElementArray.length)
this._qfSelectedElementIndex=0;this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOn";this.qfInputTextbox.value=this._qfElementArray[this._qfSelectedElementIndex].getAttribute("value");}}
else if(event.keyCode==38)
{event.preventDefault();event.stopPropagation();if(this._qfElementArray.length>0)
{if(this._qfSelectedElementIndex>=0)
this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOff";this._qfSelectedElementIndex--;if(this._qfSelectedElementIndex<0)
this._qfSelectedElementIndex=this._qfElementArray.length-1;this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOn";this.qfInputTextbox.value=this._qfElementArray[this._qfSelectedElementIndex].getAttribute("value");}}
else if(event.keyCode==13)
{event.preventDefault();event.stopPropagation();var index;if(this._qfSelectedElementIndex<=0)
{if(this._qfElementArray.length==0)
return;index=0;}
else
{index=this._qfSelectedElementIndex;}
var categoryId=this._qfElementArray[index].getAttribute("valueCategoryId");var itemId=this._qfElementArray[index].getAttribute("valueId");this._runCategorySearch(categoryId,itemId);this.qfInputTextbox.blur();}
else
{var searchString=this.qfInputTextbox.value;if(searchString!=null&&searchString!="")
{this.callServer("GetOccupationByName",[this.encryptedPostingId,searchString]);}
else
{this.setQuickFindContent(null);}}},clearQuickFindDelegates:function()
{for(var i=0;i<this._qfDelegates.length;i++)
{var del=this._qfDelegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._qfDelegates=[];},setQuickFindContent:function(newContent)
{this.clearQuickFindDelegates();this._qfElementArray=[];if(newContent==null)
{this.qfInputTextboxSelectionBox.style.display="none";this._qfSelectedElementIndex=-1;}
else if(newContent.length==0)
{this.qfInputTextboxSelectionBox.innerHTML=this.msgQFInputTextboxSelectionBoxNoMatches;this._qfSelectedElementIndex=-1;this.qfInputTextboxSelectionBox.style.display="block";}
else
{this.qfInputTextboxSelectionBox.innerHTML="";for(var i=0;i<newContent.length;i++)
{var currentContent=newContent[i].OccupationName;var newInnerDiv=document.createElement("div");currentContent=currentContent.replace(new RegExp(this.escapeRegExp(this.qfInputTextbox.value),"i"),String.format("<span class=\"JobCategoryOccs_QF_BoldedKeyword\">{0}</span>",this.qfInputTextbox.value));newInnerDiv.innerHTML=currentContent;newInnerDiv.className="JobCategoryOccs_QF_ItemFocusOff";newInnerDiv.setAttribute("value",newContent[i].OccupationName);newInnerDiv.setAttribute("valueCategoryId",newContent[i].CategoryId);newInnerDiv.setAttribute("valueId",newContent[i].Id);var delegate=Function.createDelegate({userContext:this,occupation:newContent[i].OccupationName,categoryId:newContent[i].CategoryId,id:newContent[i].Id},this.onQuickFindClicked);$addHandler(newInnerDiv,"mousedown",delegate);this._qfDelegates.push([newInnerDiv,"mousedown",delegate]);delegate=Function.createDelegate({userContext:this,index:i},this.onQuickFindMouseOver);$addHandler(newInnerDiv,"mouseover",delegate);this._qfDelegates.push([newInnerDiv,"mouseover",delegate]);this.qfInputTextboxSelectionBox.appendChild(newInnerDiv);this._qfElementArray.push(newInnerDiv);}
this._qfSelectedElementIndex=-1;this.qfInputTextboxSelectionBox.style.display="block";}},escapeRegExp:function(str)
{return(str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1");},onQuickFindClicked:function(event)
{event.stopPropagation();this.userContext.qfInputTextbox.value=this.occupation;this.userContext._runCategorySearch(this.categoryId,this.id);},_runCategorySearch:function(categoryId,id)
{var nodeToExpand=this.tvCategories.control.findNodeByValue(categoryId);if(nodeToExpand==null)
return;nodeToExpand.expand();this._occupationIdToCheck=id;if(this.expandCategory(nodeToExpand))
{this._occupationIdToCheck=null;var occupationNode=this.tvCategories.control.findNodeByValue(id);if(occupationNode)
this._checkOccupationCheckbox(occupationNode);}},_checkOccupationCheckbox:function(occupationNode)
{if(occupationNode.get_enabled()&&!occupationNode.get_checked())
{occupationNode.check();this._onNodeChecked(occupationNode);}
occupationNode.scrollIntoView();},onQuickFindMouseOver:function(event)
{event.preventDefault();event.stopPropagation();if(this.userContext._qfSelectedElementIndex>=0)
this.userContext._qfElementArray[this.userContext._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOff";this.userContext._qfElementArray[this.index].className="JobCategoryOccs_QF_ItemFocusOn";this.userContext._qfSelectedElementIndex=this.index;},onQuickFindMouseOut:function(event)
{event.preventDefault();event.stopPropagation();if(this._qfSelectedElementIndex>=0)
{this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOff";this._qfSelectedElementIndex=-1;}},onQuickFindBlur:function(event)
{if(this._qfSelectedElementIndex>=0)
{if(this._qfElementArray[this._qfSelectedElementIndex]!=null)
{this._qfElementArray[this._qfSelectedElementIndex].className="JobCategoryOccs_QF_ItemFocusOff";this._qfSelectedElementIndex=-1;}}
this.qfInputTextboxSelectionBox.style.display="none";},onNodeExpanded:function(sender,args)
{if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.initAllOnDemand();var node=args.get_node();var adapter=sender.JobPostingOptionsSearchCategoryAdapter;adapter.expandCategory(node);},addCategory:function(newCategoryData)
{this._tvCategoriesData.push(newCategoryData);var categoryNode=new Telerik.Web.UI.RadTreeNode();categoryNode.set_allowDrag(false);categoryNode.set_allowDrop(false);categoryNode.set_allowEdit(false);categoryNode.set_text(newCategoryData.CategoryName);categoryNode.set_postBack(false);categoryNode.set_value(newCategoryData.Id);categoryNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(this.loadingMessage);childNode.set_postBack(false);childNode.set_value(0);var categoryNodes=this.tvCategories.control.get_nodes();var categoryNodesLength=categoryNodes.get_count();var insertIndex=0;while(insertIndex<categoryNodesLength)
{var currentCompareNode=categoryNodes.getItem(insertIndex);var currentName=currentCompareNode.get_text();if(currentName.localeCompare(newCategoryData.CategoryName)>0)
break;insertIndex++;}
categoryNode.get_nodes().add(childNode);this.tvCategories.control.get_nodes().insert(insertIndex,categoryNode);categoryNode.set_checkable(false);childNode.set_checkable(false);},removeCategory:function(currentCategoryId)
{for(var i=0;i<this._selectionCache.length;i++)
{var currentCategory=this._selectionCache[i];if(currentCategory.CategoryId==currentCategoryId)
{this._selectionCache.splice(i,1);break;}}
var nodeCacheKeyBeginning=String.format("{0}|",currentCategoryId);for(var currentNodeCacheKey in this._selectedNodeCache)
{if(currentNodeCacheKey.startsWith(nodeCacheKeyBeginning))
this._selectedNodeCache[currentNodeCacheKey]=null;}
var categoryNodes=this.tvCategories.control.get_nodes();var categoryNodesCount=categoryNodes.get_count();for(var i=0;i<categoryNodesCount;i++)
{var currentCategoryNode=categoryNodes.getNode(i);if(currentCategoryNode.get_value()==currentCategoryId)
{categoryNodes.remove(currentCategoryNode);break;}}
for(var i=0;i<this._tvCategoriesData.length;i++)
{if(this._tvCategoriesData[i].Id==currentCategoryId)
{this._tvCategoriesData.splice(i,1);break;}}},updateCategory:function(currentCategory)
{if(currentCategory.Occupations&&currentCategory.Occupations.length)
{var categoryNode=this.tvCategories.control.findNodeByValue(currentCategory.Id);categoryNode.get_nodes().clear();categoryNode.isLoaded=false;this.storeCategory(currentCategory);this.expandCategory(categoryNode);var prevOccSelections=null;if(this._selectionCache)
{for(var i=0,l=this._selectionCache.length;i<l;i++)
{if(currentCategory.Id==this._selectionCache[i].CategoryId)
{var categorySelectionCache=this._selectionCache[i].Occupations;if(categorySelectionCache)
{prevOccSelections=categorySelectionCache.join(",").split(",");this._selectionCache[i].Occupations=[];break;}}}}
if(prevOccSelections)
{for(var i=0,l=prevOccSelections.length;i<l;i++)
{var occupationNode=this.tvCategories.control.findNodeByValue(prevOccSelections[i]);if(occupationNode)
{this._checkOccupationCheckbox(occupationNode);}}}}},storeCategory:function(newCategoryData)
{for(var i=0;i<this._tvCategoriesData.length;i++)
{if(this._tvCategoriesData[i].Id==newCategoryData.Id)
{this._tvCategoriesData[i].Occupations=new Array();for(var j=0;j<newCategoryData.Occupations.length;j++)
this._tvCategoriesData[i].Occupations.push(newCategoryData.Occupations[j]);break;}}},expandCategory:function(node)
{var expandNodeCategoryId=node.get_value();var parentNode;var dataCacheParentNode=null;for(var i=0;i<this._tvCategoriesData.length;i++)
{if(this._tvCategoriesData[i].Id==expandNodeCategoryId)
{dataCacheParentNode=this._tvCategoriesData[i];break;}}
if(dataCacheParentNode.Occupations==null)
{this.callServer("GetOccupationsByCategoryId",[this.encryptedPostingId,expandNodeCategoryId]);return false;}
else
{if(node.isLoaded==undefined||node.isLoaded==false)
{node.get_nodes().clear();for(var i=0;i<dataCacheParentNode.Occupations.length;i++)
{var childNode=new Telerik.Web.UI.RadTreeNode();childNode.set_allowDrag(false);childNode.set_allowDrop(false);childNode.set_allowEdit(false);childNode.set_text(dataCacheParentNode.Occupations[i].OccupationName);childNode.set_postBack(false);childNode.set_value(dataCacheParentNode.Occupations[i].Id);childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ClientSide);node.get_nodes().add(childNode);}
node.isLoaded=true;}
return true;}},onNodeChecked:function(sender,args)
{sender.JobPostingOptionsSearchCategoryAdapter._onNodeChecked(args.get_node());},_onNodeChecked:function(node)
{var isCategoryQtyChanged=false;var nodeParent=node.get_parent();var siblingNodes=nodeParent.get_nodes();var numSiblings=siblingNodes.get_count();if(!node.get_checked())
{for(var i=0;i<numSiblings;i++)
siblingNodes.getNode(i).enable();}
else
{var numNodesChecked=0;for(var i=0;i<numSiblings;i++)
{if(siblingNodes.getNode(i).get_checked())
numNodesChecked++;}
if(numNodesChecked>=this._maxOccupationSelections)
{for(var i=0;i<numSiblings;i++)
{if(!siblingNodes.getNode(i).get_checked())
siblingNodes.getNode(i).disable();}}}
var parentNodeId=nodeParent.get_value();var nodeId=node.get_value();if(!node.get_checked())
{node.unselect()
for(var i=0;i<this._selectionCache.length;i++)
{var currentCategoryData=this._selectionCache[i];if(currentCategoryData.CategoryId==parentNodeId)
{for(var j=0;j<currentCategoryData.Occupations.length;j++)
{var currentOccupationData=currentCategoryData.Occupations[j];if(currentOccupationData==nodeId)
{currentCategoryData.Occupations.splice(j,1);break;}}
if(currentCategoryData.Occupations.length==0){this._selectionCache.splice(i,1);if(this.maxCategoryAllowed){this.maxCategorySelected--;if(this.maxCategorySelected==(this.maxCategoryAllowed-1)){this._toggleMaxCategoryLock(false);}}
isCategoryQtyChanged=true;}
break;}}
var nodeCacheKey=String.format("{0}|{1}",parentNodeId,nodeId);if(this._selectedNodeCache[nodeCacheKey]!=null)
this._selectedNodeCache[nodeCacheKey]=null;}
else
{node.select();var selectionCacheEntry=null;for(var i=0;i<this._selectionCache.length;i++)
{var currentCategoryData=this._selectionCache[i];if(currentCategoryData.CategoryId==parentNodeId)
{selectionCacheEntry=currentCategoryData;break;}}
if(selectionCacheEntry==null)
{selectionCacheEntry={};selectionCacheEntry.CategoryId=parentNodeId;selectionCacheEntry.Occupations=[];this._selectionCache.push(selectionCacheEntry);if(this.maxCategoryAllowed){this.maxCategorySelected++;if(this.maxCategorySelected>=this.maxCategoryAllowed){this._toggleMaxCategoryLock(true);}}
isCategoryQtyChanged=true;}
var occupationEntry=null;for(var i=0;i<selectionCacheEntry.Occupations.length;i++)
{var currentOccupationEntry=selectionCacheEntry.Occupations[i];if(currentOccupationEntry==nodeId)
{occupationEntry=currentOccupationEntry;break;}}
if(occupationEntry==null)
{occupationEntry=nodeId;selectionCacheEntry.Occupations.push(occupationEntry);}
var nodeCacheKey=String.format("{0}|{1}",parentNodeId,nodeId);if(this._selectedNodeCache[nodeCacheKey]==null)
this._selectedNodeCache[nodeCacheKey]=node;}
if(isCategoryQtyChanged){if(this.lblCategoriesWarning){if(this._selectionCache.length>1){this.lblCategoriesWarning.style.display="block";}
else{this.lblCategoriesWarning.style.display="none";}}}
if(this.areaWideCatCountMsgFormat)
{this.lblTotalCatCount.innerHTML=String.format(this.areaWideCatCountMsgFormat,this._selectionCache.length);}
this.callServer("UpdateCategorySelection",[this.encryptedPostingId,this._selectionCache]);this._dataStore.set_property("selectedCategories",this._selectionCache);},_toggleMaxCategoryLock:function(onOff){var categoryNodes=this.tvCategories.control.get_nodes();for(var i=0,l1=categoryNodes.get_count();i<l1;i++){var currentCategoryNode=categoryNodes.getItem(i);if(this._isCategoryInCache(currentCategoryNode.get_value()))continue;var occupationNodes=currentCategoryNode.get_nodes();var l2=occupationNodes.get_count();if(l2<2){currentCategoryNode.set_enabled(!onOff);}
else{for(var j=0;j<l2;j++){var occupation=occupationNodes.getItem(j);if(!occupation.get_checked())
occupation.set_enabled(!onOff);}}}},_isCategoryInCache:function(categoryId){for(var i=0,l=this._selectionCache.length;i<l;i++)
{if(this._selectionCache[i].CategoryId==categoryId)
{return true;}}
return false;},clearControl:function()
{for(var currentNodeKey in this._selectedNodeCache)
{var node=this._selectedNodeCache[currentNodeKey];node.set_checked(false);this._onNodeChecked(node);}},ShowError:function(element,isShow)
{var labelTag=null;var iconTag=null;switch(element){case this.tvCategories:labelTag="lblSearchCategory";iconTag="errorSearchCategory";break;default:break;}
if($get(labelTag)!=null)
{isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null)
{isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchCategoryAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter.initializeBase(this,[element]);this.createProperty("searchCreateControl");this.createProperty("searchEditControl");this.createProperty("msgNoLocationsSelected");this.createProperty("msgNoCategoriesSelected");this.createProperty("msgTooManyCategoriesAndLocationsSelected");this.createProperty("msgNoOkOrCancelSelected");this.createProperty("numMaxCategoriesTimesLocations");this.createProperty("isInEditMode");this._isCatLocationDisplayed=false;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("validateOptionsPage_request");this.registerDataProperty("FillPostingOptionsData");this.registerDataProperty("RemoveOptionsEditControls");this.registerDataProperty("selectedLocations");this.registerDataProperty("selectedCategories");this.registerDataProperty("CONTROL_divAddSelectionArea");},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"FillPostingOptionsData":var result=this._dataStore.get_property("FillPostingOptionsData");if(result!=null){if(result.PostingDatas!=null&&result.PostingDatas.length>0){this.searchCreateControl.style.display="none";this.searchEditControl.style.display="block";}
else{this.searchCreateControl.style.display="block";this.searchEditControl.style.display="none";}}
break;case"RemoveOptionsEditControls":this.searchCreateControl.style.display="block";this.searchEditControl.style.display="none";break;case"validateOptionsPage_request":break;case"selectedLocations":this._dataStore.set_property("ErrorSummaryDisplay_ClearErrors",1);if(!this.validateMaxLocationCategorySelections(false))
window.scrollTo(0,0);break;case"selectedCategories":this._dataStore.set_property("ErrorSummaryDisplay_ClearErrors",1);if(!this.validateMaxLocationCategorySelections(false))
window.scrollTo(0,0);break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;},onFailure:function(result,userContext,methodName){},CheckCurrentFlow:function(parameter){var flow=null;parameter=parameter.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];},validateMaxLocationCategorySelections:function(checkMin){var selectedLocations=this._dataStore.get_property("selectedLocations");var selectedCategories=this._dataStore.get_property("selectedCategories");var numLocations=0;var numCategories=selectedCategories==null?0:selectedCategories.length;var postingHaveFolderID=this.CheckCurrentFlow("folderId");if(this.isInEditMode==="false"&&!this._isCatLocationDisplayed&&postingHaveFolderID!=""){for(var currentLocation in selectedLocations){if(selectedLocations[currentLocation])
numLocations++;}
var locXCatIsBig=this.numMaxCategoriesTimesLocations>0&&numLocations*numCategories>this.numMaxCategoriesTimesLocations;if((checkMin&&(numLocations==0||numCategories==0))||locXCatIsBig){this._dataStore.set_property("validateOptionsPage_results",false);if(checkMin&&numLocations==0)
this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgNoLocationsSelected);if(checkMin&&numCategories==0)
this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgNoCategoriesSelected);if(locXCatIsBig)
this._dataStore.set_property("ErrorSummaryDisplay_AddError",String.format(this.msgTooManyCategoriesAndLocationsSelected,this.numMaxCategoriesTimesLocations));return false;}}
else if(this._isCatLocationDisplayed){this._dataStore.set_property("validateOptionsPage_results",false);this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgNoOkOrCancelSelected);return false;}
this._dataStore.set_property("validateOptionsPage_results",true);return true;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsSearchAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter.initializeBase(this,[element]);this.createProperty("enhancementsBody");this.createProperty("upsellSection1Msg");this.createProperty("upsellSection2Msg");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("OPTIONS_defaultEnhancementData");},initHandlers:function(element,event,context){},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultEnhancementData":var result=this._dataStore.get_property("OPTIONS_defaultEnhancementData");var isEnhancementBodyVisible=false;if(result!=null){for(var k=0;k<result.length;k++){if(!isEnhancementBodyVisible){for(var j=0;j<result[k].EnhancementFields.length;j++){if(result[k].EnhancementFields[j].EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsVisible&&result[k].EnhancementFields[j].Value=="True")
isEnhancementBodyVisible=true;}}}
if(!isEnhancementBodyVisible){this.enhancementsBody.style.display="none";}
else{var visible=false;for(var i=0;i<result.length;++i){var currentEnhancement=result[i];if(currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.ApplyScoring){continue;}
for(var j=0;j<currentEnhancement.EnhancementFields.length;++j){var currentField=currentEnhancement.EnhancementFields[j];if(currentField.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsVisible&&currentField.Value=="True"){visible=true;break;}}}
this.enhancementsBody.style.display=visible?"block":"none";var containsUpsellSection1=false;for(var i=0;i<result.length;i++){var currentEnhancement=result[i];if(currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.Bolding){containsUpsellSection1=true;break;}}
if(!containsUpsellSection1)
this.upsellSection1Msg.style.display="none";else
this.upsellSection1Msg.style.display="block";var containsUpsellSection2=false;for(var i=0;i<result.length;i++){var currentEnhancement=result[i];if(currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.ResumeSearch||currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.BostonGlobe||currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.NewYorkTimes||currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.MonsterOnDemand||currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.AreaWideRenew||currentEnhancement.EnhancementType==Presenters.JPW.DTO.EnhancementType.AreaWideRefresh){containsUpsellSection2=true;break;}}
if(!containsUpsellSection2)
this.upsellSection2Msg.style.display="none";else
this.upsellSection2Msg.style.display="block";}}
break;default:break;}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.initializeBase(this,[element]);this.createProperty("checkbox");this.createProperty("containingDiv");this.createProperty("enhancementId");this.createProperty("encryptedPostingId");this.createProperty("innerDiv");this.createProperty("restrictionLbl");this.createProperty("boldingPriceNotice");this._delegates=[];this._checked=false;this._visible=false;this._folder=null;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this.registerDataProperty("OPTIONS_defaultEnhancementData");this.registerDataProperty("OPTIONS_FolderId");},initHandlers:function(element,event,context){if(context=="checkbox"){var delegate=Function.createDelegate(this,this.onCheckboxClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onCheckboxClicked(event);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultEnhancementData":var enhancementsList=this._dataStore.get_property("OPTIONS_defaultEnhancementData");var enhancementVisible=false;var enhancementData=null;if(enhancementsList!=null){for(var i=0;i<enhancementsList.length;i++){var currentEnhancement=enhancementsList[i];if(currentEnhancement.EnhancementType==this.enhancementId){enhancementData=currentEnhancement;break;}}
if(enhancementData!==null&&enhancementData.EnhancementFields!==null){for(var j=0;j<enhancementData.EnhancementFields.length;j++){var currentFieldData=enhancementData.EnhancementFields[j];if(currentFieldData.EnhancementFieldType===Presenters.JPW.DTO.EnhancementFieldTypes.IsVisible){enhancementVisible=currentFieldData.Value.toLowerCase()==='true';this._visible=enhancementVisible;}
else if(currentFieldData.EnhancementFieldType===Presenters.JPW.DTO.EnhancementFieldTypes.IsCheckboxDisabled){this.checkbox.disabled=currentFieldData.Value.toLowerCase()==='true';}
else if(currentFieldData.EnhancementFieldType===Presenters.JPW.DTO.EnhancementFieldTypes.IsControlDisabled){var rightColumn=$(this._element).find(".right-column");if(rightColumn){if(currentFieldData.Value.toLowerCase()==='true')
rightColumn.addClass("disabled");else
rightColumn.removeClass("disabled");}}
else if(currentFieldData.EnhancementFieldType===Presenters.JPW.DTO.EnhancementFieldTypes.IsSelected){this.checkbox.checked=currentFieldData.Value.toLowerCase()==='true';}
else if(currentFieldData.EnhancementFieldType===Presenters.JPW.DTO.EnhancementFieldTypes.CountryRestrictionMessage){this.restrictionLbl.innerHTML=currentFieldData.Value;}}}}
if(enhancementVisible){switch(enhancementData.EnhancementType){case 4:case 5:case 10:case 14:this.updateEnhancementSimpleFields(enhancementData);break;case 6:case 9:case 11:case 15:case 16:case 17:case 20:if(enhancementData.EnhancementFields){this.updateEnhancementSpecificData(enhancementData.EnhancementFields);}
break;default:break;}}
if(enhancementData!=null&&!enhancementVisible&&(enhancementData.EnhancementType==20||enhancementData.EnhancementType==6)){this.updateEnhancementSpecificData(enhancementData.EnhancementFields);}
this.containingDiv.style.display=this._visible?"block":"none";this.updateEnhancementValue(this._visible&&this.checkbox.checked,true);break;case"OPTIONS_FolderId":this._folder=this._dataStore.get_property("OPTIONS_FolderId")*1;break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;if(methodName=="addons"){userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result);}},onFailure:function(result,userContext,methodName){},updateEnhancementSimpleFields:function(newData){switch(newData.EnhancementType){case 5:if(newData.EnhancementFields){for(var i=0;i<newData.EnhancementFields.length;i++){if(newData.EnhancementFields[i].EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Rate){this.boldingPriceNotice.innerHTML=newData.EnhancementFields[i].Value;break;}}}
break;case 14:var chkboxstat=$('#MODCheckbox > input');if((chkboxstat)&&(chkboxstat[0])){if(chkboxstat[0].checked==true)
this.innerDiv.style.display="block";else
this.innerDiv.style.display="none";}
break;default:break;}},updateEnhancementSpecificData:function(newData){},onCheckboxClicked:function(event){this.onCheckboxClickedNotification(event);this.updateEnhancementValue(event.target.checked);if(this.innerDiv){this.innerDiv.style.display=event.target.checked?"":"none";}
var canTest=jQuery.data(event.target,"chkType");if(canTest=="CAN"&&event.target.checked==true){this._dataStore.set_property("pickCANDuration",{Id:this.enhancementId,State:true});}
event.stopPropagation();},onCheckboxClickedNotification:function(event){},getEnhancementData:function(){return[];},updateEnhancementValue:function(checked,skipServerUpdate){var selectedEnhancements=this._dataStore.get_property("selectedEnhancements");if(typeof(selectedEnhancements)=="undefined"||selectedEnhancements==null)
selectedEnhancements=[];if(checked==null)
checked=this._checked;if(checked){var selectionExists=false;for(var i=0;i<selectedEnhancements.length;i++){var currentEnhancement=selectedEnhancements[i];if(currentEnhancement.EnhancementType==this.enhancementId){selectionExists=true;break;}}
if(!selectionExists){var newSelectionEntry={EnhancementType:this.enhancementId,IsSelected:true,EnhancementFields:this.getEnhancementData()};selectedEnhancements.push(newSelectionEntry);}
else{for(var i=0;i<selectedEnhancements.length;i++){if(selectedEnhancements[i].EnhancementType==this.enhancementId){selectedEnhancements[i].EnhancementFields=this.getEnhancementData();selectedEnhancements[i].IsSelected=true;break;}}}}
else{for(var i=0;i<selectedEnhancements.length;i++){var currentEnhancement=selectedEnhancements[i];if(currentEnhancement.EnhancementType==this.enhancementId){currentEnhancement.IsSelected=false;break;}}}
this._checked=checked;if(skipServerUpdate==null||skipServerUpdate==false)
this.callServer("addons",[this.encryptedPostingId,this._folder,selectedEnhancements]);this._dataStore.set_property("selectedEnhancements",selectedEnhancements);}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.initializeBase(this,[element]);this.createProperty("CANChk");this.createProperty("CANRestrictNotice");this.createProperty("rb14Day");this.createProperty("rb30Day");this.createProperty("rbCANDurationSelection");this.createProperty("divCANInnerContent");this.createProperty("containingDiv14DayCAN");this.createProperty("containingDiv30DayCAN");this.createProperty("containingDivSelectedDuration");this.createProperty("lblCANDurationSelection");this.createProperty("lbl14DayWarning");this.createProperty("lbl30DayWarning");this.createProperty("MESSAGE_CAN_14_DAY");this.createProperty("MESSAGE_CAN_30_DAY");this.createProperty("reduxDialogAdapter");this.createProperty("rb14Wrapper");this.createProperty("rb30Wrapper");this._delegates=[];this.previewAddress="";this._isVisible=false;this._inv=null;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'initOnDemand');this.registerDataProperty("pickCANDuration");this.registerDataProperty("canType");this.registerDataProperty("activeCAN");this.registerDataProperty("modifyCANBoard");jQuery.data(this.CANChk,"chkType","CAN");},initHandlers:function(element,event,context){if(context=="rb14Day"||context=="rb30Day"||context=="rbCANDurationSelection"){var delegate=Function.createDelegate(this,this.onDurationChanged);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onDurationChanged(event);}
else if(context=="previewAd"){var delegate=Function.createDelegate(this,this.onPreviewAd);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onPreviewAd(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"pickCANDuration":var isChk=this._dataStore.get_property("pickCANDuration");if(isChk.State&&(isChk.Id==this.enhancementId)){if(this._inv==14)
this.rb14Day.click();else if(this._inv==30)
this.rb30Day.click();}
break;case"canType":var item=this._dataStore.get_property("canType");if(item.source!=this.enhancementId&&this.CANChk.checked==true&&this.CANChk.disabled==false){var selectedEnhancements=this._dataStore.get_property("selectedEnhancements");for(var i=0;i<selectedEnhancements.length;i++){if(selectedEnhancements[i].EnhancementType==this.enhancementId){selectedEnhancements[i].EnhancementFields=this.getEnhancementData();selectedEnhancements[i].IsSelected=true;break;}}
this._dataStore.set_property("selectedEnhancements",selectedEnhancements)}
break;case"modifyCANBoard":var jbSelections=this._dataStore.get_property("modifyCANBoard");if(this.enhancementId==jbSelections.Id){var isShown=jbSelections.Value;if(isShown&&this._isVisible){this.containingDiv.style.display="block";}
else{if(this.CANChk.checked)
this.CANChk.click();this.containingDiv.style.display="none";}}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);var durationCAN=this.getSelectedDuration();var available14dayCANInventory=false;var available30dayCANInventory=false;var showExpirationWarning14DayCAN=false;var showExpirationWarning30DayCAN=false;var is14Visible=false;var is30Visible=false;if(newData!==null){for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.CANDuration)
durationCAN=currentData.Value*1;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.EnhancementPreviewLink)
this.previewAddress=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.VisibleOptions){var canOptions=currentData.Value.split(",");for(var k=0;k<canOptions.length;k++){if(parseInt(canOptions[k])==30){is30Visible=true;}
else if(parseInt(canOptions[k])==14){is14Visible=true;}}}
else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Durations){var duration=currentData.Value.split(",");for(var k=0;k<duration.length;k++){if(parseInt(duration[k])==30){available30dayCANInventory=true;}
else if(parseInt(duration[k])==14){available14dayCANInventory=true;}}}
else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.AlertMessages){if(currentData.Value!=""){var alerts=currentData.Value.split(",");for(var j=0;j<alerts.length;j++){if(alerts[j]=="14")
showExpirationWarning14DayCAN=true;if(alerts[j]=="30")
showExpirationWarning30DayCAN=true;}}}}}
if(durationCAN==14)
this.rb14Day.checked=true;else if(durationCAN==30)
this.rb30Day.checked=true;else
this.rbCANDurationSelection.checked=true;if(!showExpirationWarning14DayCAN){this.lbl14DayWarning.style.display="none";}
else{this.lbl14DayWarning.parentNode.style.marginTop="-15px";}
if(!showExpirationWarning30DayCAN){this.lbl30DayWarning.style.display="none";}
else{this.lbl30DayWarning.parentNode.style.marginTop="-15px";}
if(this.CANChk.checked)
this.divCANInnerContent.style.display="block";if(this.CANChk.disabled){this.containingDiv14DayCAN.style.display="none";this.containingDiv30DayCAN.style.display="none";this.rb14Wrapper.style.display="none";this.rb30Wrapper.style.display="none";this.containingDivSelectedDuration.style.display="block";this.rb14Day.disabled=true;this.rb30Day.disabled=true;this.rbCANDurationSelection.disabled=true;this.rbCANDurationSelection.checked=true;if(durationCAN==14)
this.lblCANDurationSelection.innerHTML=this.MESSAGE_CAN_14_DAY;else{durationCAN=30;this.lblCANDurationSelection.innerHTML=this.MESSAGE_CAN_30_DAY;}
this._dataStore.set_property("activeCAN",{Id:this.enhancementId,Value:durationCAN})}
else{this.rb14Day.disabled=false;this.rb30Day.disabled=false;this.containingDivSelectedDuration.style.display="none";this.containingDiv14DayCAN.style.display=(available14dayCANInventory==true)?"inline":"none";this.containingDiv30DayCAN.style.display=(available30dayCANInventory==true)?"inline":"none";this.rb14Day.checked=(durationCAN==14)?true:false;this.rb30Day.checked=(durationCAN==30)?true:false;if(!is30Visible)
this.rb30Wrapper.style.display="none";if(!is14Visible)
this.rb14Wrapper.style.display="none";}
var adjustCAN=this._dataStore.get_property("activeCAN");if(adjustCAN!=null&&adjustCAN.Id!=null&&this.enhacementId!=adjustCAN.Id){var t=adjustCAN.Value;if(t==14){this.rb30Day.disabled=true;this.rb30Wrapper.style.display="none";}
if(t==30){this.rb14Day.disabled=true;this.rb14Wrapper.style.display="none";}}
if(available14dayCANInventory==true||available30dayCANInventory==true)
this._isVisible=true;if(available30dayCANInventory)
this._inv=30;else if(available14dayCANInventory)
this._inv=14;},onDurationChanged:function(event){var is14=false;if(this.rb14Day.checked)
is14=true;this._dataStore.set_property("canType",{source:this.enhancementId,value:is14});this.updateEnhancementValue();},onPreviewAd:function(event){var ad=null;if(this.previewAddress!=""){ad=this.reduxDialogAdapter._behaviors[0];var enhId=parseInt(this.enhancementId);if(enhId==Presenters.JPW.DTO.EnhancementType.CareerAdNetwork){document.getElementById("citiesListIFrame").src=this.previewAddress;}
else{document.getElementById("VeteranCANIFrame").src=this.previewAddress;}
ad.showDialog(event);}},getEnhancementData:function(){var value=this.getSelectedDuration();var retList=[];retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.CANDuration,Value:value});return retList;},getSelectedDuration:function(){if(this.rb14Day.checked)
return 14;if(this.rb30Day.checked)
return 30;if(this.rbCANDurationSelection.checked){if(this.lblCANDurationSelection.innerHTML==this.MESSAGE_CAN_14_DAY)
return 14;else if(this.lblCANDurationSelection.innerHTML==this.MESSAGE_CAN_30_DAY)
return 30;}
return 0;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsCANAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.initializeBase(this,[element]);this.createProperty("imgLogo");this.msgNoLogo=null;this.createProperty("imgSrc");this.createProperty("ifrUpload");this._isLogoUploaded=null;this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.prototype={initialize:function()
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'initialize');this.registerDataProperty("validateOptionsPage_request");if(!MonsPageManager.enableInitOnDemand)
{this.initOnDemand();}
else
{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function()
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);},dispose:function()
{if(MonsPageManager.initState(this._id))
{for(var i=0;i<this._delegates.length;i++)
{var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args)
{switch(args.get_propertyName())
{case"validateOptionsPage_request":if(this._checked&&!this._isLogoUploaded)
{this._dataStore.set_property("validateOptionsPage_results",false);this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.msgNoLogo);}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName)
{if(userContext.processWebServiceErrorList(result))
return;switch(methodName)
{default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateEnhancementSpecificData:function(newData)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);},getEnhancementData:function()
{var retList=[];retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.LogoUploaded,Value:this._isLogoUploaded});return retList;},logoUploadCallBack:function(message,hasError){if(hasError){$(this.ifrUpload).removeAttr("errorFlyout");new Monster.Client.Component.Validator().showError(this.ifrUpload,message);}
else{new Monster.Client.Component.Validator().hideError(this.ifrUpload);this.imgLogo.src=this.imgSrc;this.imgLogo.style.display="";this._isLogoUploaded=true;this.updateEnhancementValue(true,true);}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsJobSearchLogoAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.initializeBase(this,[element]);this.createProperty("resumeZIP");this.createProperty("resumeSearchPriceNotice");this.createProperty("resumeSearchUpsellMessage");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'initOnDemand');this.registerDataProperty("SetValidationErrors");},initHandlers:function(element,event,context){if(context=="resumeZIP"){var delegate=Function.createDelegate(this,this.onResumeZipChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onResumeZipChanged(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement){case"ResumeUpsell":this.ShowError(this.resumeZIP,temp.isShow);break;default:break;}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},onResumeZipChanged:function(event){this.updateEnhancementValue();},updateEnhancementValue:function(checked,skipServerUpdate){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'updateEnhancementValue',[checked,skipServerUpdate]);if(this.resumeSearchUpsellMessage){if(!this._visible)
this.resumeSearchUpsellMessage.style.display="none";else
this.resumeSearchUpsellMessage.style.display="block";}},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.PostalCode){this.resumeZIP.value=currentData.Value;break;}
if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Rate){this.resumeSearchPriceNotice.innerHTML=currentData.Value;break;}}},getEnhancementData:function(){var retList=[];if(this.resumeZIP!=null){retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.PostalCode,Value:this.resumeZIP.value});}
return retList;},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.resumeZIP:labelTag="lblResumeSearch";iconTag="errorResumeSearch";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.initializeBase(this,[element]);this.createProperty("cbRevPubBGlobe");this.createProperty("reversePublishingDisplayDescriptionBGlobe");this.createProperty("ddlCTPIndustryBGlobe");this.createProperty("ddlCTPJobTitleBGlobe");this.createProperty("txtCTPJobHeadingBGlobe");this.createProperty("txtCTPContactBGlobe");this.createProperty("txtCTPPrintTextBGlobe");this.createProperty("msgrevPubBostonGBQty");this.createProperty("msgRemainingCharBostonGBLbl");this.createProperty("MAX_NUM_CHARACTERS");this.createProperty("msgTooManyCharacters");this.createProperty("jobIndustryToTitleMap");this.createProperty("previewGlobeAdapter");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'initOnDemand');this.remainingCharsCount=this.MAX_NUM_CHARACTERS;this.registerDataProperty("validateOptionsPage_request");this.registerDataProperty("SetValidationErrors");},initHandlers:function(element,event,context){if(context=="ddlCTPIndustryBGlobe"){var delegate=Function.createDelegate(this,this.onIndustryChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onIndustryChanged(event);}
else if(context=="ddlCTPJobTitleBGlobe"){var delegate=Function.createDelegate(this,this.onJobTitleChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onJobTitleChanged(event);}
else if(context=="txtCTPJobHeadingBGlobe"){var delegate=Function.createDelegate(this,this.onJobHeadingChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onJobHeadingChanged(event);}
else if(context=="txtCTPContactBGlobe"){var delegate=Function.createDelegate(this,this.onContactInfoChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onContactInfoChanged(event);}
else if(context=="txtCTPPrintTextBGlobe"){var delegate=Function.createDelegate(this,this.onPrintAdChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onPrintAdChanged(event);}
else if(context=="txtCTPPrintTextBGlobe_keyup"){var delegate=Function.createDelegate(this,this.onPrintAdKeyPress);$addHandler(element,"keyup",delegate);this._delegates.push([element,"keyup",delegate]);if(!$isIE())
this.onPrintAdKeyPress(event);}
else if(context=="BostonGB"){event.preventDefault();var delegate=Function.createDelegate(this,this.onPrintAdPopupClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onPrintAdPopupClicked(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsResumeSearchAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"validateOptionsPage_request":if(this._checked&&this.remainingCharsCount<0){this._dataStore.set_property("validateOptionsPage_results",false);this._dataStore.set_property("ErrorSummaryDisplay_AddError",String.format(this.msgTooManyCharacters,this.MAX_NUM_CHARACTERS));}
break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors");switch(temp.validateElement){case"BG_Industry":this.ShowError(this.ddlCTPIndustryBGlobe,temp.isShow);break;case"BG_JobTitle":this.ShowError(this.ddlCTPJobTitleBGlobe,temp.isShow);break;case"BG_JobHeading":this.ShowError(this.txtCTPJobHeadingBGlobe,temp.isShow);break;case"BG_ContactInfo":this.ShowError(this.txtCTPContactBGlobe,temp.isShow);break;case"BG_PrintAd":this.ShowError(this.txtCTPPrintTextBGlobe,temp.isShow);break;default:break;}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);var selectedIndustry=0;var selectedJobTitle=0;var enteredJobHeading;var enteredContactInfo;var enteredPrintAdText;var rateOrQuantityText;if(newData!=null){for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Industry)
selectedIndustry=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Title)
selectedJobTitle=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.JobHeading)
enteredJobHeading=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.ContactInformation)
enteredContactInfo=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText)
enteredPrintAdText=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Rate)
rateOrQuantityText=currentData.Value}}
this.setDropDownValue(this.ddlCTPIndustryBGlobe,selectedIndustry);this.updateJobTitleContents();this.setDropDownValue(this.ddlCTPJobTitleBGlobe,selectedJobTitle);this.txtCTPJobHeadingBGlobe.value=enteredJobHeading;this.txtCTPContactBGlobe.value=enteredContactInfo;this.txtCTPPrintTextBGlobe.value=enteredPrintAdText;this.onPrintAdKeyPress();this.msgrevPubBostonGBQty.innerHTML=rateOrQuantityText;if(this.cbRevPubBGlobe.checked)
this.reversePublishingDisplayDescriptionBGlobe.style.display="block";if(this.cbRevPubBGlobe.disabled){this.ddlCTPIndustryBGlobe.disabled=true;this.ddlCTPJobTitleBGlobe.disabled=true;this.txtCTPJobHeadingBGlobe.disabled=true;this.txtCTPContactBGlobe.disabled=true;this.txtCTPPrintTextBGlobe.disabled=true;}},setDropDownValue:function(selectNode,selectedType){var selectedAdTypeIndex=-1;for(var i=0;i<selectNode.options.length;i++){if(selectNode.options[i].value==selectedType){selectedAdTypeIndex=i;break;}}
if(selectedAdTypeIndex>=0)
selectNode.options[selectedAdTypeIndex].selected=true;},onIndustryChanged:function(event){this.updateJobTitleContents();this.updateEnhancementValue(true,true);},onJobTitleChanged:function(event){this.updateEnhancementValue(true,true);},onJobHeadingChanged:function(event){this.updateEnhancementValue(true,true);},onContactInfoChanged:function(event){this.updateEnhancementValue(true,true);},onPrintAdChanged:function(event){this.updateEnhancementValue(true,true);},onPrintAdKeyPress:function(event){var ammendedText=this.txtCTPPrintTextBGlobe.value.replace(/(\r\n|[\r\n])/g,"");var charCount=ammendedText.length;var allowedCharCount=this.MAX_NUM_CHARACTERS;if(ammendedText.length>allowedCharCount){this.txtCTPPrintTextBGlobe.value=this.txtCTPPrintTextBGlobe.value.substring(0,allowedCharCount);charCount=this.txtCTPPrintTextBGlobe.value.length;}
this.remainingCharsCount=allowedCharCount-charCount;this.msgRemainingCharBostonGBLbl.innerHTML=String.format("{0}",this.remainingCharsCount);},onPrintAdPopupClicked:function(event){this.invokeModalDialogShowPrintAd('modalPrintAdPreview',"BostonGB");},updateJobTitleContents:function(){var titleList=this.jobIndustryToTitleMap[this.ddlCTPIndustryBGlobe.options[this.ddlCTPIndustryBGlobe.selectedIndex].value];while(this.ddlCTPJobTitleBGlobe.options.length>1)
this.ddlCTPJobTitleBGlobe.remove(1);if(titleList!=null){for(var i=0;i<titleList.length;i++){var currentEntry=titleList[i];var newOptionNode=document.createElement("option");newOptionNode.value=currentEntry.key;newOptionNode.text=currentEntry.value;try{this.ddlCTPJobTitleBGlobe.add(newOptionNode,null);}
catch(e){this.ddlCTPJobTitleBGlobe.add(newOptionNode);}}}
this.ddlCTPJobTitleBGlobe.selectedIndex=0;},getControlValue:function(ctrl,sampleText,type){if(ctrl==null){switch(type){case"checkbox":return false;break;case"select-one":return 0;break;case"text":return"";break;}
return"";}
switch(ctrl.type){case"checkbox":return ctrl.checked;break;case"select-one":if(ctrl.value==""){return 0;}
else{return parseInt(ctrl.value);}
break;case"text":if(ctrl.value.trim()==sampleText){return"";}
else{return ctrl.value;}
break;}},getEnhancementData:function(){var industryValue=this.getControlValue(this.ddlCTPIndustryBGlobe,"","select-one");var jobTitleValue=this.getControlValue(this.ddlCTPJobTitleBGlobe,"","select-one");var jobHeadingValue=this.getControlValue(this.txtCTPJobHeadingBGlobe,"","text");var contactInfoValue=this.getControlValue(this.txtCTPContactBGlobe,"","text");var printAdTextValue=this.txtCTPPrintTextBGlobe.value;var retList=[];if(industryValue!=0)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.Industry,Value:industryValue});if(jobTitleValue!=0)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.Title,Value:jobTitleValue});retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.JobHeading,Value:jobHeadingValue});retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.ContactInformation,Value:contactInfoValue});retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText,Value:printAdTextValue});return retList;},invokeModalDialogShowPrintAd:function(modalDialogName,newspaper){var previewbox=this.previewGlobeAdapter;var printAdIndustry=this.ddlCTPJobTitleBGlobe.options[this.ddlCTPJobTitleBGlobe.options.selectedIndex].text;var printAdJobTitle=this.txtCTPJobHeadingBGlobe.value;var printAdText=this.txtCTPPrintTextBGlobe.value;var printAdContact=this.txtCTPContactBGlobe.value;var printAdUrl='/jobs/previewPrintAd.aspx?news='+newspaper+'&industry='+printAdIndustry+'&jobtitle='+printAdJobTitle+'&adtext='+printAdText+'&contact='+printAdContact;if(previewbox){$('.previewglobe-iframe')[0].src=printAdUrl;globeprevdialog=this.previewGlobeAdapter;previewbox.showDialog();}},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.ddlCTPIndustryBGlobe:labelTag="lblBGIndustry";iconTag="errorBGIndustry";break;case this.ddlCTPJobTitleBGlobe:labelTag="lblBGJobTitle";iconTag="errorBGJobTitle";break;case this.txtCTPJobHeadingBGlobe:labelTag="lblBGJobHeading";iconTag="errorBGJobHeading";break;case this.txtCTPContactBGlobe:labelTag="LblPrintContactBGlobe";iconTag="errorBGContact";break;case this.txtCTPPrintTextBGlobe:labelTag="LblPrintAdTextBGlobe";iconTag="errorBGPrintAdText";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBostonGlobeAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.initializeBase(this,[element]);this.createProperty("cbRevPubNYTimes");this.createProperty("reversePublishingDisplayDescriptionNYTimes");this.createProperty("ddlCTPAdTypeNYTimes");this.createProperty("ddlCTPIndustryNYTimes");this.createProperty("ddlCTPJobTitleNYTimes");this.createProperty("txtCTPPrintTextNYTimes");this.createProperty("txtCTPContactNYTimes");this.createProperty("msgrevPubNYTimesQty");this.createProperty("msgRemainingCharNYTimesLbl");this.createProperty("MAX_NUM_CHARACTERS");this.createProperty("msgTooManyCharacters");this.createProperty("jobIndustryToTitleMap");this.createProperty("previewNYTAdapter");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'initOnDemand');this.remainingCharsCount=this.MAX_NUM_CHARACTERS;this.registerDataProperty("validateOptionsPage_request");this.registerDataProperty("SetValidationErrors");},initHandlers:function(element,event,context){if(context=="ddlCTPAdTypeNYTimes"){var delegate=Function.createDelegate(this,this.onAdTypeChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onAdTypeChanged(event);}
else if(context=="ddlCTPIndustryNYTimes"){var delegate=Function.createDelegate(this,this.onIndustryChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onIndustryChanged(event);}
else if(context=="ddlCTPJobTitleNYTimes"){var delegate=Function.createDelegate(this,this.onJobTitleChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onJobTitleChanged(event);}
else if(context=="txtCTPPrintTextNYTimes"){var delegate=Function.createDelegate(this,this.onPrintTextChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onPrintTextChanged(event);}
else if(context=="txtCTPPrintTextNYTimes_keyup"){var delegate=Function.createDelegate(this,this.onPrintAdKeyPress);$addHandler(element,"keyup",delegate);this._delegates.push([element,"keyup",delegate]);if(!$isIE())
this.onPrintAdKeyPress(event);}
else if(context=="txtCTPContactNYTimes"){var delegate=Function.createDelegate(this,this.onContactInfoChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onContactInfoChanged(event);}
else if(context=="NYTimes"){event.preventDefault();var delegate=Function.createDelegate(this,this.onPrintAdPopupClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onPrintAdPopupClicked(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"validateOptionsPage_request":if(this._checked&&this.remainingCharsCount<0){this._dataStore.set_property("validateOptionsPage_results",false);this._dataStore.set_property("ErrorSummaryDisplay_AddError",String.format(this.msgTooManyCharacters,this.MAX_NUM_CHARACTERS));}
break;case"SetValidationErrors":var temp=this._dataStore.get_property("SetValidationErrors")
switch(temp.validateElement){case"NYT_AdType":this.ShowError(this.ddlCTPAdTypeNYTimes,temp.isShow);break;case"NYT_Industry":this.ShowError(this.ddlCTPIndustryNYTimes,temp.isShow);break;case"NYT_JobTitle":this.ShowError(this.ddlCTPJobTitleNYTimes,temp.isShow);break;case"NYT_PrintAd":this.ShowError(this.txtCTPPrintTextNYTimes,temp.isShow);break;case"NYT_ContactInfo":this.ShowError(this.txtCTPContactNYTimes,temp.isShow);break;default:break;}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);var selectedAdType=0;var selectedIndustry=0;var selectedJobTitle=0;var enteredPrintAdText;var enteredContactInfo;if(newData!=null){for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.AdType)
selectedAdType=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Industry)
selectedIndustry=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Title)
selectedJobTitle=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText)
enteredPrintAdText=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.ContactInformation)
enteredContactInfo=currentData.Value;else if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.Rate)
rateOrQuantityText=currentData.Value}}
this.setDropDownValue(this.ddlCTPAdTypeNYTimes,selectedAdType);this.setDropDownValue(this.ddlCTPIndustryNYTimes,selectedIndustry);this.updateJobTitleContents();this.setDropDownValue(this.ddlCTPJobTitleNYTimes,selectedJobTitle);this.txtCTPPrintTextNYTimes.value=enteredPrintAdText;this.onPrintAdKeyPress();this.txtCTPContactNYTimes.value=enteredContactInfo;this.msgrevPubNYTimesQty.innerHTML=rateOrQuantityText;if(this.cbRevPubNYTimes.checked)
this.reversePublishingDisplayDescriptionNYTimes.style.display="block";if(this.cbRevPubNYTimes.disabled){this.ddlCTPAdTypeNYTimes.disabled=true;this.ddlCTPIndustryNYTimes.disabled=true;this.ddlCTPJobTitleNYTimes.disabled=true;this.txtCTPPrintTextNYTimes.disabled=true;this.txtCTPContactNYTimes.disabled=true;}},setDropDownValue:function(selectNode,selectedType){var selectedAdTypeIndex=-1;for(var i=0;i<selectNode.options.length;i++){if(selectNode.options[i].value==selectedType){selectedAdTypeIndex=i;break;}}
if(selectedAdTypeIndex>=0)
selectNode.options[selectedAdTypeIndex].selected=true;},onAdTypeChanged:function(event){this.updateEnhancementValue(true,true);},onIndustryChanged:function(event){this.updateJobTitleContents();this.updateEnhancementValue(true,true);},onJobTitleChanged:function(event){this.updateEnhancementValue(true,true);},onPrintTextChanged:function(event){this.updateEnhancementValue(true,true);},onContactInfoChanged:function(event){this.updateEnhancementValue(true,true);},onPrintAdKeyPress:function(event){var ammendedText=this.txtCTPPrintTextNYTimes.value.replace(/(\r\n|[\r\n])/g,"");var charCount=ammendedText.length;var allowedCharCount=this.MAX_NUM_CHARACTERS;if(ammendedText.length>allowedCharCount){this.txtCTPPrintTextNYTimes.value=this.txtCTPPrintTextNYTimes.value.substring(0,allowedCharCount);charCount=this.txtCTPPrintTextNYTimes.value.length;}
this.remainingCharsCount=allowedCharCount-charCount;this.msgRemainingCharNYTimesLbl.innerHTML=String.format("{0}",this.remainingCharsCount);},onPrintAdPopupClicked:function(event){this.invokeModalDialogShowPrintAd('modalPrintAdPreview',"NYTimes");},updateJobTitleContents:function(){var titleList=this.jobIndustryToTitleMap[this.ddlCTPIndustryNYTimes.options[this.ddlCTPIndustryNYTimes.selectedIndex].value];while(this.ddlCTPJobTitleNYTimes.options.length>1)
this.ddlCTPJobTitleNYTimes.remove(1);if(titleList!=null){for(var i=0;i<titleList.length;i++){var currentEntry=titleList[i];var newOptionNode=document.createElement("option");newOptionNode.value=currentEntry.key;newOptionNode.text=currentEntry.value;try{this.ddlCTPJobTitleNYTimes.add(newOptionNode,null);}
catch(e){this.ddlCTPJobTitleNYTimes.add(newOptionNode);}}}
this.ddlCTPJobTitleNYTimes.selectedIndex=0;},getControlValue:function(ctrl,sampleText,type){if(ctrl==null){switch(type){case"checkbox":return false;break;case"select-one":return 0;break;case"text":return"";break;}
return"";}
switch(ctrl.type){case"checkbox":return ctrl.checked;break;case"select-one":if(ctrl.value==""){return 0;}
else{return parseInt(ctrl.value);}
break;case"text":if(ctrl.value.trim()==sampleText){return"";}
else{return ctrl.value;}
break;}},getEnhancementData:function(){var adTypeValue=this.getControlValue(this.ddlCTPAdTypeNYTimes,"","select-one");var industryValue=this.getControlValue(this.ddlCTPIndustryNYTimes,"","select-one");var jobTitleValue=this.getControlValue(this.ddlCTPJobTitleNYTimes,"","select-one");var printAdTextValue=this.txtCTPPrintTextNYTimes.value;var contactInfoValue=this.getControlValue(this.txtCTPContactNYTimes,"","text");var retList=[];if(adTypeValue!=0)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.AdType,Value:adTypeValue});if(industryValue!=0)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.Industry,Value:industryValue});if(jobTitleValue!=0)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.Title,Value:jobTitleValue});retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText,Value:printAdTextValue});retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.ContactInformation,Value:contactInfoValue});return retList;},invokeModalDialogShowPrintAd:function(modalDialogName,newspaper){var previewbox=this.previewNYTAdapter;var printAdIndustry=this.ddlCTPIndustryNYTimes.options[this.ddlCTPIndustryNYTimes.options.selectedIndex].text;var printAdJobTitle=this.ddlCTPJobTitleNYTimes.options[this.ddlCTPJobTitleNYTimes.options.selectedIndex].text;var printAdText=this.txtCTPPrintTextNYTimes.value;var printAdUrl='/jobs/previewPrintAd.aspx?news='+newspaper+'&industry='+printAdIndustry+'&jobtitle='+printAdJobTitle+'&adtext='+printAdText;if(previewbox){$('.previewnyt-iframe')[0].src=printAdUrl;nytprevdialog=this.previewNYTAdapter;previewbox.showDialog();}},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.ddlCTPAdTypeNYTimes:labelTag="LblPrintAdTypeNYTimes";iconTag="errorNYAdType";break;case this.ddlCTPIndustryNYTimes:labelTag="LblPrintIndustryNYTimes";iconTag="errorNYIndustry";break;case this.ddlCTPJobTitleNYTimes:labelTag="LblPrintJobTitleNYTimes";iconTag="errorNYJobTitle";break;case this.txtCTPPrintTextNYTimes:labelTag="LblPrintAdTextNYTimes";iconTag="errorNYPrintText";break;case this.txtCTPContactNYTimes:labelTag="LblPrintContactNYTimes";iconTag="errorNYContact";break;default:break;}
if($get(labelTag)!=null){isShow!=true?$get(labelTag).style.color='#666666':$get(labelTag).style.color='#CC0000';}
if($get(iconTag)!=null){isShow!=true?$get(iconTag).style.display='none':$get(iconTag).style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsNewYorkTimesAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.initializeBase(this,[element]);this.createProperty("lblJobHeading");this.createProperty("txtMODPrintText");this.createProperty("divCharsRemaining");this.createProperty("charLimit");this.createProperty("folderID");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'initOnDemand');this.registerDataProperty("GetInformationView");this.registerDataProperty("GetDescriptionView");this.updateTitle();this.updateDescription();},initHandlers:function(element,event,context){if(context=="txtMODPrintText_blur"){var delegate=Function.createDelegate(this,this.onDescriptionChanged);$addHandler(element,"blur",delegate);this._delegates.push([element,"blur",delegate]);if(!$isIE())
this.onDescriptionChanged(event);}
else if(context=="txtMODPrintText_pressed"){var delegate=Function.createDelegate(this,this.onDescriptionUpdated);$addHandler(element,"keypress",delegate);this._delegates.push([element,"keypress",delegate]);if(!$isIE())
this.onDescriptionUpdated(event);}
else if(context=="PreviewPressed"){var delegate=Function.createDelegate(this,this.showPreview);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.showPreview(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"GetInformationView":this.updateTitle();break;case"GetDescriptionView":this.updateDescription();break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateTitle:function(){var informationView=this._dataStore.get_property("GetInformationView");if(informationView!=null)
this.lblJobHeading.innerHTML=informationView.JobTitle;},updateDescription:function(){var descriptionView=this._dataStore.get_property("GetDescriptionView");if(descriptionView!=null){var htmlFreeJobDescription=descriptionView.JobDescription;htmlFreeJobDescription=htmlFreeJobDescription.replace(/(<([^>]+)>)/ig,"");htmlFreeJobDescription=htmlFreeJobDescription.substr(0,parseInt(this.charLimit));this.txtMODPrintText.value=htmlFreeJobDescription;}
this.updateDescriptionLimit()},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText)
this.txtMODPrintText.value=currentData.Value;}},onDescriptionChanged:function(event){var addChar=this.updateEnhancementValue();if(!addChar)
return false;},onDescriptionUpdated:function(event){this.updateDescriptionLimit();},showPreview:function(event){var modPreviewHost=window.location.host;var modLocation="http://"+modPreviewHost+"/jobs/MODPreview.aspx?folderID="+this.get_folderID()+"&PreviewDescription="+this.txtMODPrintText.value;var winPop;winPop=window.open(modLocation,null,"width=835,height=520,scrollbars=1,resizable=yes");winPop.focus();},updateDescriptionLimit:function(){var charLeft=parseInt(this.charLimit)-this.txtMODPrintText.value.length;$(this.divCharsRemaining).text(charLeft);if(charLeft>0)
return true;else
return false;},getEnhancementData:function(){var retList=[];retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.PrintAdText,Value:this.txtMODPrintText.value});return retList;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsMODAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.initializeBase(this,[element]);this.RenewCheckBox=null;this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.prototype={initialize:function()
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand)
{this.initOnDemand();}
else
{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function()
{this.RenewCheckBox=$(this._element).find("input[type=checkbox]");if(this.RenewCheckBox)
this.RenewCheckBox=this.RenewCheckBox[0];this.registerDataProperty("AWIRefresh");Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context)
{if(context=="Renew")
{var delegate=Function.createDelegate(this,this.onRenewClick);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onRenewClick(event);}
else
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function()
{if(MonsPageManager.initState(this._id))
{for(var i=0;i<this._delegates.length;i++)
{var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args)
{switch(args.get_propertyName())
{case"AWIRefresh":var AwiRenew=this._dataStore.get_property("AWIRefresh");if(AwiRenew&&this.RenewCheckBox)
{this.RenewCheckBox.checked=false;}
this.updateEnhancementValue(this.RenewCheckBox.checked,true);default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onRenewClick:function(event)
{if(this.RenewCheckBox)
{this._dataStore.set_property("AWIRenew",this.RenewCheckBox.checked);}
this.updateEnhancementValue(event.target.checked);}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRenewAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.initializeBase(this,[element]);this.RefreshCheckBox=null;this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.prototype={initialize:function()
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand)
{this.initOnDemand();}
else
{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function()
{this.registerDataProperty("AWIRenew");this.RefreshCheckBox=$(this._element).find("input[type=checkbox]");if(this.RefreshCheckBox)
this.RefreshCheckBox=this.RefreshCheckBox[0];Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context)
{if(context=="Refresh")
{var delegate=Function.createDelegate(this,this.onRefreshClick);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onRefreshClick(event);}
else
{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function()
{if(MonsPageManager.initState(this._id))
{for(var i=0;i<this._delegates.length;i++)
{var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args)
{switch(args.get_propertyName())
{case"AWIRenew":var AwiRenew=this._dataStore.get_property("AWIRenew");if(AwiRenew&&this.RefreshCheckBox)
{this.RefreshCheckBox.checked=false;}
this.updateEnhancementValue(this.RefreshCheckBox.checked,true);default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onRefreshClick:function(event)
{if(this.RefreshCheckBox)
{this._dataStore.set_property("AWIRefresh",this.RefreshCheckBox.checked);}
this.updateEnhancementValue(event.target.checked);}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsAreaWideRefreshAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter.initializeBase(this,[element]);this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this.registerDataProperty("FillPostingOptionsData");},initHandlers:function(element,event,context){},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"FillPostingOptionsData":var result=this._dataStore.get_property("FillPostingOptionsData");if(result.Folder){this._dataStore.set_property("OPTIONS_FolderId",result.Folder);}
if(result!=null){if(result.PostingSummaryData!=null){this._dataStore.set_property("OPTIONS_defaultSummaryData",result.PostingSummaryData,[],args.get_context());if(result.PostingSummaryData.Constraints!=null){this._dataStore.set_property("OPTIONS_updateOcpnLimit",result.PostingSummaryData.Constraints);}}
this._dataStore.set_property("OPTIONS_defaultQuickLocations",result.Locations,[],args.get_context());this._dataStore.set_property("OPTIONS_defaultCategoryGlobalData",result.CountryOccupations,[],args.get_context());if(result.EnhancementDatas!=null)
this._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas,[],args.get_context());if(result.MonsterInfoData!=null)
this._dataStore.set_property("OPTIONS_MonsterInfoData",result.MonsterInfoData,[],args.get_context());if(result.JobBoardGroupData!=null){this._dataStore.set_property("OPTIONS_JobBoardGroupData",result.JobBoardGroupData,[],args.get_context());this._dataStore.set_property("OPTIONS_ErroDatas",result.ErrorDatas,[],args.get_context());}
if(result.CustomExpiry!=null)
this._dataStore.set_property("OPTIONS_defaultCustomExpiry",result.CustomExpiry,[],args.get_context());if(result.PostingDatas!=null)
this._dataStore.set_property("OPTIONS_defaultPostingData",result.PostingDatas,[],args.get_context());if(result.ActiveDate!=null)
this._dataStore.set_property("OPTIONS_defaultActiveDate",result.ActiveDate,[],args.get_context());if(result.Expiry!=null)
this._dataStore.set_property("OPTIONS_defaultExpiryDate",result.Expiry,[],args.get_context());if(result.FreeToolsData!=null)
this._dataStore.set_property("OPTIONS_FreeToolsData",result.FreeToolsData,[],args.get_context());if(result.IsFlagged!=null)
this._dataStore.set_property("OPTIONS_isFrFlagged",result.IsFlagged,[],args.get_context());this._dataStore.set_property("showSummaryLayer",true);}
window.status="Finished";break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:break;}},onFailure:function(result,userContext,methodName){}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter=function(element){this._createStart=new Date();Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter.initializeBase(this,[element]);this.adapter=this;this._createEnd=new Date();this._errorlist=[];this._previewType;this._actionDelegates=[];this.createProperty("jobDetailsPreview_previewJobPostingIcon");this.createProperty("jobDetailsPreview_previewJobPostingLink");this.createProperty("jobDetailsPreview_previewSearchResultsIcon");this.createProperty("jobDetailsPreview_previewSearchResultsLink");this.createProperty("jobDetailsPreview_dialogUrl");this.createProperty("jobDetailsPreview_dialogName");this.createProperty("jobDetailsPreview_dialogParameter");this.createProperty("jobDetailsPreview_modalDialogName");this.createProperty("jobDetailsPreview_modalDialogName");this.createProperty("jobDetailsPreview_modalDialogUrl");this.createProperty("jobDetailsPreview_jobSearchLogoPreviewAdapter");this.createProperty("jobHasBolding");this.createProperty("previewWarning");}
Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter.prototype={initialize:function(){this._initStart=new Date();Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._initEnd=new Date();this.registerDataProperty("PopulateDetailsView");this.registerDataProperty("GetDetailsView");this.registerDataProperty("ErrorList");this.registerDataProperty("JPW_JOB_DESCRIPTION_PREVIEW_REQUEST");this._webService=EBiz.Services.JPW.JobDetailsService;this._dataStore.set_property("CajaWarning",this.previewWarning);},initHandlers:function(element,event,context){switch(element){case this.jobDetailsPreview_previewJobPostingIcon:case this.jobDetailsPreview_previewJobPostingLink:var delegate=Function.createDelegate(this,this.showPopupWindow);this._wireHandler(element,event,delegate);break;case this.jobDetailsPreview_previewSearchResultsIcon:case this.jobDetailsPreview_previewSearchResultsLink:var delegate=Function.createDelegate(this,this.showModalWindow);this._wireHandler(element,event,delegate);break;default:break;}
if(element.id=="prevfloat"){var me=this;var delegate=Function.createDelegate(this,this.showPopupWindow);this._wireHandler(element,event,delegate);}},_wireHandler:function(element,event,delegate){this._actionDelegates.push([element,event.type,delegate]);$addHandler(element,event.type,delegate);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){delegate(event);}},dispose:function(){if(MonsPageManager.initState(this._id)){}
for(var i=0,l=this._actionDelegates.length;i<l;i++){var del=this._actionDelegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
delete this._actionDelegates;Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"ErrorList":break;case"JPW_JOB_DESCRIPTION_PREVIEW_REQUEST":this.showPopupWindow(null);break;default:break;}},onShowValidate:function(){this._dataStore.set_property('JobPreviewRequest',this._previewType);if(this._previewType==Presenters.JPW.DTO.PreviewTypes.JobSearchResultsPreview){this.showModal(mode=this.adapter.ePopupMode.Spinner);}
var isCJDPage=(this._dataStore.get_property("currentPage")=="CJD");if(isCJDPage){var pid=this._dataStore.get_property("CommonPostingID");var templateID=this._dataStore.get_property("selectedTemplateId");this._webService=EBiz.Services.JPW.CustomJobDescriptionService;this.callServer("SaveCustomJobDescriptionPreview",[pid,templateID,createJobBuilderAnswersView(),this._previewType]);}
else{var _currentPage=this._dataStore.get_property("currentPage");if(_currentPage=="JobPostingOptions"){this._dataStore.set_property("GetOptionsView");var view=this._dataStore.get_property("PopulateOptionsView");this._webService=EBiz.Services.JPW.JobPostingOptionsService;}
else{this._dataStore.set_property("GetDetailsView");var view=this._dataStore.get_property("PopulateDetailsView");this._webService=EBiz.Services.JPW.JobDetailsService;if(this._previewType==Presenters.JPW.DTO.PreviewTypes.JobSearchResultsPreview){view.JobDescription.JobDescription=jQuery.data(document.body,"PreviewDescription");}}
this.callServer("SaveJobPostingPreview",[view,this._previewType]);}},showPopupWindow:function(event){this._previewType=Presenters.JPW.DTO.PreviewTypes.JobPostingPreview;if(event!=null){if(parent.location.hash=='#options'){dcsMultiTrack('DCS.dcsuri','/jobs/PreviewJobOptions.evt','DCSext.en','JobPreviewOptions','WT.z_jpw_step',encodeURI('Job+Posting+Options'),'WT.z_jpw_substep',encodeURI('Posting+Options:Preview+Your+Post'),'WT.z_jpw_ssc','1');}
else{dcsMultiTrack('DCS.dcsuri','/jobs/PreviewJobDetails.evt','DCSext.en','JobPreviewDetails','WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Preview+Your+Post'),'WT.z_jpw_ssc','1');}}
this.onShowValidate();},showModalWindow:function(event){this._previewType=Presenters.JPW.DTO.PreviewTypes.JobSearchResultsPreview;this.onShowValidate();},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"SaveJobPostingPreview":case"SaveCustomJobDescriptionPreview":var _errorlist;var isValid=false;this._webService=EBiz.Services.JPW.JobDetailsService;userContext._dataStore.set_property("ErrorList",result);_errorlist=userContext._dataStore.get_property("ErrorList");if(_errorlist==null)
isValid=true;else if(_errorlist.length<1)
isValid=true;else
isValid=false;if(isValid){switch(userContext._previewType){case Presenters.JPW.DTO.PreviewTypes.JobPostingPreview:var navigateUrl=userContext.jobDetailsPreview_dialogUrl;var templateId=userContext._dataStore.get_property("selectedTemplateId");if(templateId){navigateUrl+="&templateId="+templateId;}
MONSPREVHANDLER.location.href=navigateUrl;break;case Presenters.JPW.DTO.PreviewTypes.JobSearchResultsPreview:userContext.hideModal(mode=userContext.ePopupMode.Spinner);var popup=userContext.jobDetailsPreview_jobSearchLogoPreviewAdapter;var enh=userContext._dataStore.get_property("selectedEnhancements");var isBold=false,j=0;if(enh){for(j=0;j<enh.length;j++){if(enh[j].EnhancementType=="5"&&enh[j].IsSelected==true){isBold=true;}}}
if((userContext.jobHasBolding!=null)&&(userContext.jobHasBolding=="True"||userContext.jobHasBolding=="true")){isBold=true;}
userContext._dataStore.set_property("UberDetailsObject");var previewData={t:null,cname:null,exp:null,l:null,d:null,a:popup};previewData.t=jQuery.data(document.body,"PreviewJobTitle");previewData.exp=jQuery.data(document.body,"PreviewExperience");var addressLoc=jQuery.data(document.body,"PreviewAddress");if(addressLoc){if(addressLoc.City!=null){previewData.l=addressLoc.City;}
if(addressLoc.State!=null){previewData.l=previewData.l+" , "+addressLoc.State;}
if(addressLoc.Zip!=null){previewData.l=previewData.l+" ,"+addressLoc.Zip;}}
else{previewData.l="";}
previewData.cname=jQuery.data(document.body,"PreviewCompanyName");previewData.d=jQuery.data(document.body,"PreviewDescription");self.PreviewCallback=function(){return previewData;};var tempstr=userContext.jobDetailsPreview_modalDialogUrl+"&Bolding="+isBold;MONSPREVRESULTSHANDLER.location.href=tempstr;dcsMultiTrack('DCS.dcsuri','/jobdetails_temp.evt','A.jdl_p','101');break;default:break;}}
break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"SaveJobPostingPreview":case"SaveCustomJobDescriptionPreview":if(userContext._previewType==Presenters.JPW.DTO.PreviewTypes.JobSearchResultsPreview){userContext.hideModal(mode=userContext.ePopupMode.Spinner);}
this._webService=EBiz.Services.JPW.JobDetailsService;break;default:break;}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsPreviewAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter=function(element){Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter.initializeBase(this,[element]);this.createProperty("saveTemplateChk");this.createProperty("saveTemplateDiv");this.createProperty("txtNewLibItemName");this.createProperty("chkMarkJobPrivate");this.createProperty("UniqueTitleError");this.createProperty("isORJP");this.reqErrors=[];}
Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;$addHandlers(this.saveTemplateChk,{click:this.ShowSaveScreen},this);this.registerDataProperty("CommonPostingID");this.registerDataProperty("CommonJobTitle");this.registerDataProperty("GetCommonData");this.registerDataProperty("UberDetailsObject");this.registerDataProperty("GetHiringLibView");this.registerDataProperty("UniqueTitle");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("LibItemID");},initHandlers:function(element,event,context){event.preventDefault();switch(element.id){default:break;}},ShowSaveScreen:function(){if(this.saveTemplateChk.checked){this._dataStore.set_property("GetCommonData");var pid=this._dataStore.get_property("CommonPostingID");var jtitle=this._dataStore.get_property("CommonJobTitle");var isUnique=false;this._dataStore.set_property("IsJobTitleUniqueAsJobLibraryName",jtitle);if(this._dataStore.get_property("UniqueTitle")!=null){isUnique=this._dataStore.get_property("UniqueTitle");if(isUnique!=null){if(isUnique==true)
$('#existLayer').hide();else
$('#existLayer').show();}
if(this.isORJP=="true"){$('#existLayer').hide();}
$('#librarylayer').show();}
else{$('#existLayer').show();$('#librarylayer').show();}}
else{$('#librarylayer').hide();}},BuildHiringLibraryView:function(){var temp=new Presenters.JPW.DTO.JobAddToLibraryView();temp.isAddToLibrary=this.saveTemplateChk.checked;temp.JobLibraryName=this.txtNewLibItemName.value;if(this.chkMarkJobPrivate){temp.isMarkAsPrivate=this.chkMarkJobPrivate.checked;}
else{temp.isMarkAsPrivate=false;}
temp.Folder=this._dataStore.get_property("LibItemID");return temp;},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"IsJobTitleUniqueAsJobLibraryName":if(result!=null){if(result==true)
$('#existLayer').hide();else
$('#existLayer').show();}
$('#librarylayer').show();break;default:break;}},OnFailure:function(result,userContext,methodName){switch(methodName){case"IsJobTitleUniqueAsJobLibraryName":break;default:break;}},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter.callBaseMethod(this,'dispose');},CheckValid:function(){var isValid=true;this.reqErrors=[];this._dataStore.set_property("GetCommonData");var jtitle=this._dataStore.get_property("CommonJobTitle");if(this.saveTemplateChk.checked){var isVisible=$('#existLayer').is(":visible");if(isVisible){var jtitle=this.txtNewLibItemName.value;if(jtitle==""){this.reqErrors.push(this.UniqueTitleError);isValid=false;}
else{this._dataStore.set_property("IsJobTitleUniqueAsJobLibraryName",jtitle);var isUnique=this._dataStore.get_property("UniqueTitle");if(!isUnique){this.reqErrors.push(this.UniqueTitleError);isValid=false;}}}
else{isValid=true;}}
return isValid;},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":this._dataStore.set_property("GetHiringLibView",this.BuildHiringLibraryView());break;case"validateDetailsPage_request":var valPass=this.CheckValid();this._dataStore.set_property("ValidateLibrary",valPass);if(!valPass){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);}
break;default:break;}}}
Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobAddToLibraryAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter.initializeBase(this,[element]);this.createProperty("inventoryList");this.createProperty("subtotal");this.createProperty("standardBody");this.createProperty("loadingBody");this.createProperty("jobPostingSummary");this.createProperty("tblCartJobParentUp");this.createProperty("tblCartJobParentDown");this.createProperty("tblCartJobParent");this.createProperty("quickTipsContent");this.createProperty("msgQuickTipsJobDetails");this.createProperty("msgQuickTipsJobPostings");this.createProperty("msgPostOn");this.createProperty("msgExpires");this.createProperty("msgEnhancements");this.createProperty("lblDateActive");this.createProperty("lblDateExpire");this.createProperty("lblSite");this.createProperty("_encryptedPostingId");this._delegates=[];this._summaryFloats=false;this._summaryMinY=0;this._scrollIncrement=20;this._initialMSTime=500;this._cartScrollInitialTimer=null;this._repeatMSTime=100;this._selectionUpdatesEnabled=true;this._dateFormat=null;this._duration=null;}
Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter.callBaseMethod(this,'initialize');this.updateScrollBarsVisible();this._summaryMinY=this.jobPostingSummary.offsetTop;if(this._summaryMinY!=0){var delegate=Function.createDelegate(this,this.onScrollWindow);$addHandler(window,"scroll",delegate);this._delegates.push([window,"scroll",delegate]);}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("selectedLocations");this.registerDataProperty("selectedCategories");this.registerDataProperty("OPTIONS_defaultSummaryData");this.registerDataProperty("OPTIONS_MonsterInfoData");this.registerDataProperty("currentPage");this.registerDataProperty("OPTIONS_PostingActiveDate");this.registerDataProperty("OPTIONS_PostingAdQuantity");this.registerDataProperty("showSummaryLayer");this.registerDataProperty("hideExpiryLabel");this._dataStore.set_property("summaryBody",this.standardBody);Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern=this._dateFormat;},initHandlers:function(element,event,context){if(element.id.endsWith("divQuestionsChat")){var delegate=Function.createDelegate(this,this.onQuestionChatPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onQuestionChatPressed(event);}
else if(element.id.endsWith("tblCartJobParentUp")){var delegate=Function.createDelegate(this,this.onScrollUpMouseDown);$addHandler(element,"mousedown",delegate);this._delegates.push([element,"mousedown",delegate]);delegate=Function.createDelegate(this,this.onScrollUpMouseUp);$addHandler(element,"mouseup",delegate);this._delegates.push([element,"mouseup",delegate]);delegate=Function.createDelegate(this,this.onScrollCartJobClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onScrollUpMouseDown(event);}
else if(element.id.endsWith("tblCartJobParentDown")){var delegate=Function.createDelegate(this,this.onScrollDownMouseDown);$addHandler(element,"mousedown",delegate);this._delegates.push([element,"mousedown",delegate]);delegate=Function.createDelegate(this,this.onScrollDownMouseUp);$addHandler(element,"mouseup",delegate);this._delegates.push([element,"mouseup",delegate]);delegate=Function.createDelegate(this,this.onScrollCartJobClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onScrollDownMouseDown(event);}},dispose:function(){if(MonsPageManager.initState(this._id)){this._dataStore.remove_propChangeEventHandler("selectedLocations",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("selectedCategories",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("selectedEnhancements",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("OPTIONS_defaultSummaryData",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("currentPage",this._dataChangeDelegate);this._dataStore.remove_propChangeEventHandler("OPTIONS_PostingActiveDate",this._dataChangeDelegate);for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"selectedLocations":case"selectedCategories":case"selectedEnhancements":this.standardBody.style.display="none";this.loadingBody.style.display="block";break;case"OPTIONS_defaultSummaryData":var summaryData=this._dataStore.get_property("OPTIONS_defaultSummaryData");if(summaryData!==null){this.updateLocationSummaryDetails(summaryData.LocationSummaryDetails,summaryData.EnhancementSummary);this.subtotal.innerHTML=summaryData.FormattedTotalPrice;}
this.loadingBody.style.display="none";this.standardBody.style.display="block";if(summaryData!==null&&summaryData.JobBoardDescription!==null){this.lblSite.innerHTML=summaryData.JobBoardDescription;}
this.updateScrollBarsVisible();if(summaryData.Constraints!=null){this._dataStore.set_property("OPTIONS_updateOcpnLimit",summaryData.Constraints);}
break;case"OPTIONS_MonsterInfoData":var hint=this._dataStore.get_property("OPTIONS_MonsterInfoData");if(this.quickTipsContent&&hint.HelpfulHint!=null){this.quickTipsContent.innerHTML=hint.HelpfulHint;}
break;case"currentPage":var page=this._dataStore.get_property("currentPage");if(page=="DETAILS"||page=="CJD"){this._summaryFloats=true;this._summaryMinY=190;this.onScrollWindow();}
else{this._summaryFloats=true;this._summaryMinY=190;this.onScrollWindow();}
break;case"OPTIONS_PostingAdQuantity":if(this.lblDateActive){var postingAdQuantity=this._dataStore.get_property("OPTIONS_PostingAdQuantity");if(postingAdQuantity==1){this.msgPostOn.style.display="";this.msgExpires.style.display="";this.lblDateActive.style.display="";this.lblDateExpire.style.display="";}
else{this.msgPostOn.style.display="none";this.msgExpires.style.display="none";this.lblDateActive.style.display="none";this.lblDateExpire.style.display="none";}}
break;case"showSummaryLayer":this.standardBody.style.display="block";this.loadingBody.style.display="none";break;case"hideExpiryLabel":var isHidden=this._dataStore.get_property("hideExpiryLabel");if(isHidden){if(this.msgExpires){this.msgExpires.parentNode.parentNode.style.display="none";}}
else{if(this.msgExpires){this.msgExpires.parentNode.parentNode.style.display="";}}
break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"UpdateLocationCategory":case"UpdateLocationInformation":case"UpdateEnhancementInformation":break;}},onFailure:function(result,userContext,methodName){},updateScrollBarsVisible:function(){var showArrow=(this.tblCartJobParent.scrollHeight>this.tblCartJobParent.offsetHeight);this.tblCartJobParentUp.style.display=showArrow?"block":"none";this.tblCartJobParentDown.style.display=showArrow?"block":"none";this.tblCartJobParent.className=showArrow?"with-scroll":"no-scroll";},onQuestionChatPressed:function(event){event.stopPropogation();event.preventDefault();var winChelp=window.open('http://chat.monster.com/Employer/Employerchat.htm','Chat','scrollbars=1,resizable=yes');winChelp.focus();},updateLocationSummaryDetails:function(locationSummaryList,enhancementSummaryList){var newHtml="<table class=\"tblCartJob\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";for(var i=0;i<locationSummaryList.length;i++){var currentLocationSummary=locationSummaryList[i];if(currentLocationSummary.LocationSummary.MessageText!==null&&currentLocationSummary.LocationSummary.FormattedPrice!==null){newHtml+="<tr><td style=\"width:140px\">"+currentLocationSummary.LocationSummary.MessageText+"</td><td style=\"width:64px;text-align:right \">"+
currentLocationSummary.LocationSummary.FormattedPrice+"</td></tr>";}
newHtml=this.updateEnhancementSummaryDetails(newHtml,currentLocationSummary.EnhancementSummary);}
if(enhancementSummaryList!=null&&enhancementSummaryList.length!=0){var enhancementHeader=[{MessageText:"<br /><div class=\"input-label\">"+this.msgEnhancements+"</div>",FormattedPrice:""}];newHtml=this.updateEnhancementSummaryDetails(newHtml,enhancementHeader);newHtml=this.updateEnhancementSummaryDetails(newHtml,enhancementSummaryList);}
newHtml+="</table>";this.inventoryList.innerHTML=newHtml;},updateEnhancementSummaryDetails:function(newHtml,enahancementSummaryList){for(var j=0;j<enahancementSummaryList.length;j++){var currentAddOn=enahancementSummaryList[j];newHtml+="<tr><td style=\"width:140px\">"+currentAddOn.MessageText+"</td><td style=\"width:64px;text-align:right \">"+
currentAddOn.FormattedPrice+"</td></tr>";}
return newHtml;},onScrollWindow:function(event){if(this._summaryFloats){var currentOffset;if(typeof(window.scrollY)=="undefined")
currentOffset=document.documentElement.scrollTop+10;else
currentOffset=window.scrollY+10;if(currentOffset<this._summaryMinY){this.jobPostingSummary.style.position="absolute";this.jobPostingSummary.style.top="191px";}
else{footerHeight=334;footer=$(".footer-region");if(footer.length>0){footerHeight=footer[0].offsetHeight+135;}
this._summaryMaxY=document.body.scrollHeight-
footerHeight-
this.jobPostingSummary.scrollHeight;if((currentOffset-137)>this._summaryMaxY){this.jobPostingSummary.style.position="absolute";this.jobPostingSummary.style.top=this._summaryMaxY+"px";}
else{if($isIE6()){this.jobPostingSummary.style.position="absolute";this.jobPostingSummary.style.top=String.format("{0}px",currentOffset);}
else{this.jobPostingSummary.style.position="fixed";this.jobPostingSummary.style.top="10px";}}}}
else{this.jobPostingSummary.style.position="absolute";this.jobPostingSummary.style.top=this._summaryMinY+"px";}},onScrollCartJobClicked:function(event){event.stopPropagation();event.preventDefault();},onScrollUpMouseUp:function(event){this._scrollCartJobReleased(this.tblCartJobParentUp,-1);event.stopPropagation();event.preventDefault();},onScrollDownMouseUp:function(event){this._scrollCartJobReleased(this.tblCartJobParentDown,1);event.stopPropagation();event.preventDefault();},_scrollCartJobReleased:function(obj,adjustment){if(this._cartScrollInitialTimer!=null)
clearTimeout(this._cartScrollInitialTimer);if(this._cartScrollRepeatTimer!=null)
clearTimeout(this._cartScrollRepeatTimer);this._cartScrollInitialTimer=null;this._cartScrollRepeatTimer=null;return true;},onScrollUpMouseDown:function(event){this._scrollCartJobPressed(this.tblCartJobParentUp,-1);event.stopPropagation();event.preventDefault();},onScrollDownMouseDown:function(event){this._scrollCartJobPressed(this.tblCartJobParentDown,1);event.stopPropagation();event.preventDefault();},_scrollCartJobPressed:function(obj,adjustment){var scrollableObject=this.tblCartJobParent;this._scrollCartJob(scrollableObject,this._scrollIncrement*adjustment);this._cartScrollRepeatTimer=null;var me=this;this._cartScrollInitialTimer=setTimeout(function(){me._scrollCartJobInitialTimeout(scrollableObject,me._scrollIncrement*adjustment);},this._initialMSTime);return true;},_scrollCartJob:function(scrollableObject,increment){var direction=(increment>0)?"down":"up";var oldTop=scrollableObject.scrollTop;scrollableObject.scrollTop=scrollableObject.scrollTop+increment;var disableTop=false;var disableBottom=false;if(scrollableObject.scrollTop==0)
disableTop=true;if(scrollableObject.scrollTop==oldTop){if(direction=="down")
disableBottom=true;else
disableTop=true;}
if(disableBottom)
this.tblCartJobParentDown.className="tblCartJobParentDown_disabled";else
this.tblCartJobParentDown.className="tblCartJobParentDown";if(disableTop)
this.tblCartJobParentUp.className="tblCartJobParentUp_disabled";else
this.tblCartJobParentUp.className="tblCartJobParentUp";},_scrollCartJobInitialTimeout:function(scrollableObject,increment){this._cartScrollInitialTimer=null;var me=this;this._cartScrollRepeatTimer=setTimeout(function(){me._scrollCartJobRepeatTimeout(scrollableObject,increment);},this._repeatMSTime);},_scrollCartJobRepeatTimeout:function(scrollableObject,increment){this._scrollCartJob(scrollableObject,increment);var me=this;this._cartScrollRepeatTimer=setTimeout(function(){me._scrollCartJobRepeatTimeout(scrollableObject,increment);},this._repeatMSTime);}}
Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingSummaryAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter.initializeBase(this,[element]);this.createProperty("goBackLink");this.createProperty("saveForLaterLink");this.createProperty("continueLink");this.createProperty("postingDetailsParent");this.createProperty("postingOptionsParent");this.createProperty("_currentPage");this.createProperty("PostingID");this.createProperty("_pageMode");this.createProperty("DNASkillsPanel");this.createProperty("QuickHirePreviousLocation");this.createProperty("QuickHireSkills");this.createProperty("btnLogIn");this.createProperty("btnLogIn2");this.createProperty("viewtype");this.createProperty("jobWizardContextErrorPopup");this.createProperty("BrowseListModal");this.createProperty("RegionsHelpModal");this.createProperty("folderId");this.createProperty("jobLibId");this.createProperty("awiStatus");this.createProperty("hideCompanyInformation");this.msgNavigationWarning=null;this._delegates=[];this._pendingNavigationType=null;this._redirectURL=null;this._skillsinputs=null;this._JobTitle=null;this.skipDetails=false;this._folderID=null;this.msgContinue=null;this.msgApplyChanges=null;this.isActivePosting=false;this.companyID=null;this._hiringLibraryView=null;this._wTrendObj=null;}
Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter.callBaseMethod(this,'initialize');if(this._currentPage=="JobPostingOptions"){this.skipDetails=true;if(!MonsPageManager.isAllInit&&MonsPageManager.enableInitOnDemand)
MonsPageManager.onClick();this._pendingNavigationType=null;this.initSkills();this._currentPage="JobPostingOptions";if(!parent.location.hash){parent.location.hash='options';}
this._dataStore.set_property("currentPage",this._currentPage);this.postingDetailsParent.style.display="none";this.postingOptionsParent.style.display="block";$('#HiringLibScreen').hide();$('#DidyouKnowScreen').hide();$('#job-posting-temp-wrapper').hide();this.goBackLink.style.display="inline";window.scrollTo(0,0);}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("GetInformationView");this.registerDataProperty("GetDescriptionView");this.registerDataProperty("GetContactView");this.registerDataProperty("GetCompanyView");this.registerDataProperty("UberDetailsObject");this.registerDataProperty("UberOptionsObject");this.registerDataProperty("GetHiringLibView");this.registerDataProperty("FillPostingOptionsData");this.registerDataProperty("SetSkills");this.registerDataProperty("CommonPostingID");this.registerDataProperty("CommonJobTitle");this.registerDataProperty("GetCommonData");this.registerDataProperty("PopulateDetailsView");this.registerDataProperty("PopulateOptionsView");this.registerDataProperty("GetDetailsView");this.registerDataProperty("GetOptionsView");this.registerDataProperty("OPTIONS_defaultSummaryData");this.registerDataProperty("InitiateGoBackClick");this.registerDataProperty("InitiateContinueClick");this.registerDataProperty("HasDataTransformationImpact");this.registerDataProperty("GetOfccpInformationView");this.registerDataProperty("TriggerJobWizardContextError");this.registerDataProperty("OPTIONS_PostingActiveDate");this.registerDataProperty("OPTIONS_PostingExpiryDate");this.registerDataProperty("OPTIONS_IsCustomExpiry");this.registerDataProperty("ValidateInformation");this.registerDataProperty("ValidateDescription");this.registerDataProperty("ValidateContact");this.registerDataProperty("ValidateCompany");this.registerDataProperty("ValidateLibrary");this.registerDataProperty("ChannelIDInfo");this.registerDataProperty("OPTIONS_FolderId");this.registerDataProperty("ApplyScoringData");this.registerDataProperty("JobPreviewRequest");this.registerDataProperty("JobDescriptionFileRetrievedForPreviewRequest");this.registerDataProperty("JobDescriptionFileBrowseRequest");this.registerDataProperty("JobDescriptionFileUploadRequest");this.registerDataProperty("JobDescriptionClearRequest");if(this.folderId!=null){this._folderID=this.folderId*1;}
if(this.awiStatus){jQuery.data(document.body,"AWIjobStatus",this.awiStatus*1);}
if(this.skipDetails){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this.callServer("get",[this.PostingID,this._folderID]);}
this._webService=EBiz.Services.JPW.JobDetailsService;if(this.BrowseListModal!=null){jQuery.data(document.body,"BrowseListModal",this.BrowseListModal);}
else{var browse_modal=$find(bListAdapter);if(browse_modal){jQuery.data(document.body,"BrowseListModal",browse_modal);}}
if(this.RegionsHelpModal!=null){jQuery.data(document.body,"RegionsHelpModal",this.RegionsHelpModal);}
else{var regions_modal=$find(rhModal);if(regions_modal){jQuery.data(document.body,"RegionsHelpModal",regions_modal);}}},initHandlers:function(element,event,context){if(element.id.endsWith("goBackLink")){var delegateObject={adapter:this,navigation:Presenters.JPW.DTO.NavigationActionType.GoBack};var delegate=Function.createDelegate(delegateObject,this.onNavigationPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onNavigationPressed.call(delegateObject,event);}
else if(element.id.endsWith("saveForLaterLink")){var delegateObject={adapter:this,navigation:Presenters.JPW.DTO.NavigationActionType.SaveForLater};var delegate=Function.createDelegate(delegateObject,this.onNavigationPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onNavigationPressed.call(delegateObject,event);}
else if(element.id.endsWith("continueLink")){var delegateObject={adapter:this,navigation:Presenters.JPW.DTO.NavigationActionType.Continue};var delegate=Function.createDelegate(delegateObject,this.onNavigationPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onNavigationPressed.call(delegateObject,event);}
else if(element.id.endsWith("btnLogIn")){var delegateObject={adapter:this,navigation:Presenters.JPW.DTO.NavigationActionType.LogIn};var delegate=Function.createDelegate(delegateObject,this.onNavigationPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onNavigationPressed.call(delegateObject,event);}
else if(element.id.endsWith("btnLogIn2")){var delegateObject={adapter:this,navigation:Presenters.JPW.DTO.NavigationActionType.LogIn};var delegate=Function.createDelegate(delegateObject,this.onNavigationPressed);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onNavigationPressed.call(delegateObject,event);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"SetSkills":var result=this._dataStore.get_property("SetSkills");if(result!=null){if(result.QuickHireSkillsData!=null){var skillobj=result.QuickHireSkillsData;var inputs=this._skillsinput;$get(this.QuickHireSkills.id).style.display=(skillobj.QuickHireSkillsVisible==true)?"block":"none";$get(this.QuickHirePreviousLocation.id).style.display="none";if(skillobj.QuickHireSkillsVisible==true&&inputs!=null){var i=0,m=skillobj.SkillsCollection;for(i=0;i<m.length&&i<5;i++){if(m[i]!=null&&m[i]!=undefined&&m[i]!=""){inputs[i].value=decodeURIComponent(m[i]);}}}
else if(skillobj.QuickHireSkillsVisible==false&&skillobj.QuickHirePreviousEligible==true){$get(this.QuickHirePreviousLocation.id).style.display="block";}
else{$get(this.DNASkillsPanel.id).style.display="none";}}}
else{$get(this.DNASkillsPanel.id).style.display="none";}
break;case"GetCommonData":this._dataStore.set_property("CommonPostingID",this.get_PostingID());break;case"GetDetailsView":this._dataStore.set_property("PopulateDetailsView",this.GenerateUberDetailsObject());break;case"GetOptionsView":this._dataStore.set_property("PopulateOptionsView",this.GenerateUberOptionsObject());break;case"InitiateGoBackClick":this.goBackLink.click();parent.location.hash='details';break;case"InitiateContinueClick":this.continueLink.click();parent.location.hash='options';break;case"HasDataTransformationImpact":break;case"TriggerJobWizardContextError":this.triggerJobWizardContextError();break;case"OPTIONS_FolderId":this._folderID=this._dataStore.get_property("OPTIONS_FolderId")*1;break;case'JobPreviewRequest':var previewType=this._dataStore.get_property('JobPreviewRequest');if(previewType===1&&this._currentPage==='JobDetail'){this._dataStore.set_property('GetJobDescriptionFileForPreviewRequest');}
break;case'JobDescriptionFileRetrievedForPreviewRequest':var file=this._dataStore.get_property('JobDescriptionFileRetrievedForPreviewRequest');if(file&&file.fileName){if(dcsMultiTrack){dcsMultiTrack('WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Preview+Word+Doc'),'WT.z_jpw_ssc','1');}}
break;case'JobDescriptionFileBrowseRequest':if(dcsMultiTrack){dcsMultiTrack('WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Browse+For+Word+Doc'),'WT.z_jpw_ssc','1');}
break;case'JobDescriptionFileUploadRequest':if(dcsMultiTrack){dcsMultiTrack('WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Upload+Word+Doc'),'WT.z_jpw_ssc','1');}
break;case'JobDescriptionClearRequest':if(dcsMultiTrack){dcsMultiTrack('WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Description:Clear+Word+Doc'),'WT.z_jpw_ssc','1');}
break;default:break;}},onSuccess:function(result,userContext,methodName){userContext.ClearAllValidationErrors();if(userContext.processWebServiceErrorList(result)){for(var i=0;i<result.ErrorDatas.length;i++){switch(result.ErrorDatas[i].ErrorFieldId){case Presenters.JPW.DTO.ValidationFields.IONumber:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"IONumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.JobLocation:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"JobLocation",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.Salary:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"Salary",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.JobDescription:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"JobDescription",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.EmailAddress:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"EmailAddress",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.PhoneNumber:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"PhoneNumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.FaxNumber:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"FaxNumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.FilterZipCode:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"FilterZipCode",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.ContactZipCode:userContext._dataStore.set_property("SetValidationErrors",{validateElement:"ContactZipCode",isShow:true});break;default:break;}}
userContext._pendingNavigationType=null;userContext.hideModal(mode=userContext.ePopupMode.Spinner);window.scrollTo(0,0);return;}
switch(methodName){case"SavePostingOptionsData":if(result!=null){if(result.length===1&&result[0].WSErrorType==Presenters.Base.Data.WSErrorType.RedirectUrl){userContext._redirectURL=result[0].ErrorMessageText;userContext.updateCurrentPage();}
else if(result.length===1&&result[0].WSErrorType==Presenters.Base.Data.WSErrorType.ErrorJobWizardContext){userContext._dataStore.set_property("TriggerJobWizardContextError");}
else{userContext.HandleServerErrors(result);}}
userContext._pendingNavigationType=null;break;case"SaveJobDetailsData":if(result.ErrorDatas!=null&&result.ErrorDatas.length===1&&result.ErrorDatas[0].WSErrorType==Presenters.Base.Data.WSErrorType.ErrorJobWizardContext){userContext._dataStore.set_property("TriggerJobWizardContextError");}
else{userContext.updateCurrentPage();if(result.PostingOptionsData!=null){userContext._folderID=result.Folder;userContext._JobTitle=result.PostingOptionsData.JobTitle;userContext._dataStore.set_property("SetSkills",result.PostingOptionsData);userContext._dataStore.set_property("FillPostingOptionsData",result.PostingOptionsData,[],"init");$('#HiringLibScreen').hide();$('#DidyouKnowScreen').hide();$('#job-posting-temp-wrapper').hide();}
else{userContext.HandleServerErrors(result);}}
dcsMultiTrack('DCS.dcsuri','/jobs/JobWizard_LoadOptionsWizard.evt','DCSext.en','Load','WT.z_jpw_step',encodeURI('Job+Posting+Options'),'WT.z_jpw_substep',encodeURI('Posting+Options:+Load'),'WT.z_jpw_ssc','1');userContext._pendingNavigationType=null;userContext.hideModal(mode=userContext.ePopupMode.Spinner);break;case"IsJobTitleUniqueAsJobLibraryName":if(result!=null){if(result==true)
$('#existLayer').hide();else
$('#existLayer').show();}
$('#librarylayer').show();break;case"GetPostingDetailsData":if(result!=null){userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result.PostingSummaryData);userContext._dataStore.set_property("OPTIONS_MonsterInfoData",result.MonsterInfoData);userContext._dataStore.set_property("ResetJobLogoEnhancement");}
break;case"get":userContext.updateCurrentPage();userContext._JobTitle=result.JobTitle;userContext._dataStore.set_property("SetSkills",result);userContext._dataStore.set_property("FillPostingOptionsData",result,[],"init");$('#HiringLibScreen').hide();$('#DidyouKnowScreen').hide();$('#job-posting-temp-wrapper').hide();userContext._pendingNavigationType=null;break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"SaveJobDetailsData":userContext._pendingNavigationType=null;userContext.hideModal(mode=userContext.ePopupMode.Spinner);break;case"SavePostingOptionsData":userContext._pendingNavigationType=null;break;case"IsJobTitleUniqueAsJobLibraryName":break;case"GetPostingDetailsData":break;case"get":break;}},HandleServerErrors:function(result){for(var i=0;i<result.length;i++){switch(result[i].ErrorFieldId){case Presenters.JPW.DTO.ValidationFields.JobSearchArea:this._dataStore.set_property("SetValidationErrors",{validateElement:"JobSearchArea",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.JobSearchCategory:this._dataStore.set_property("SetValidationErrors",{validateElement:"JobSearchCategory",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.ResumeUpsell:this._dataStore.set_property("SetValidationErrors",{validateElement:"ResumeUpsell",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.BG_Industry:this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_Industry",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.BG_JobTitle:this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_JobTitle",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.BG_JobHeading:this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_JobHeading",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.BG_ContactInfo:this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_ContactInfo",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.BG_PrintAd:this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_PrintAd",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.NYT_AdType:this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_AdType",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.NYT_Industry:this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_Industry",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.NYT_JobTitle:this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_JobTitle",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.NYT_PrintAd:this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_PrintAd",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.NYT_ContactInfo:this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_ContactInfo",isShow:true});break;default:break;}}
this._dataStore.set_property("ErrorStore","");var err="";for(var i=0;i<result.length;i++){err=err+result[i].ErrorMessageText+"<br \>";}
this._dataStore.set_property("ErrorStore",err);this._dataStore.set_property("TriggerRequiredErrorDisplay","");window.scrollTo(0,0);},initSkills:function(){this._skillsinput=$('.candidate-skills').find(':input');var inputs=this._skillsinput;if(inputs!=null&&$.fn.mautocomplete){for(var i=0;i<inputs.length;i++){if(inputs[i]!=null){$.fn.mautocomplete.lazyLoadById(inputs[i].id);}}}},updateCurrentPage:function(){if(this._pendingNavigationType==Presenters.JPW.DTO.NavigationActionType.Continue){if(this._currentPage=="JobDetail"){this._pendingNavigationType=null;this._pageManager.initHtmlLazyLoadControl("OptionsPage");this.initSkills();this._currentPage="JobPostingOptions";parent.location.hash='options';this._dataStore.set_property("currentPage",this._currentPage);this.postingDetailsParent.style.display="none";this.postingOptionsParent.style.display="block";$('#HiringLibScreen').hide();$('#DidyouKnowScreen').hide();$('#job-posting-temp-wrapper').hide();this.goBackLink.style.display="inline";$.fn.mtip.lazyLoad();window.scrollTo(0,0);}
else if(this._currentPage=="JobPostingOptions"){this._pendingNavigationType=null;document.location=this._redirectURL;}}
else if(this._pendingNavigationType==Presenters.JPW.DTO.NavigationActionType.SaveForLater){if(this._currentPage=="JobDetail"){this._pendingNavigationType=null;}
else if(this._currentPage=="JobPostingOptions"){this._pendingNavigationType=null;document.location=this._redirectURL;dcsMultiTrack('DCS.dcsuri','/jobs/SaveForLaterOptions.evt','DCSext.en','SaveLaterOptions','WT.z_jpw_step',encodeURI('Job+Posting+Options'),'WT.z_jpw_substep',encodeURI('Posting+Options:Save+for+Later'),'WT.z_jpw_ssc','1');}}
else if(this._pendingNavigationType==Presenters.JPW.DTO.NavigationActionType.GoBack){if(this._currentPage=="JobPostingOptions"){this._pendingNavigationType=null;this._currentPage="JobDetail";parent.location.hash='details';this._dataStore.set_property("currentPage",this._currentPage);this.postingDetailsParent.style.display="block";this.postingOptionsParent.style.display="none";$('#HiringLibScreen').show();$('#DidyouKnowScreen').show();$('#job-posting-temp-wrapper').show();this.goBackLink.style.display="none";window.scrollTo(0,0);}}
if(this._pendingNavigationType==Presenters.JPW.DTO.NavigationActionType.LogIn){if(this._currentPage=="JobDetail"){this._pendingNavigationType=null;this._pageManager.initHtmlLazyLoadControl("OptionsPage");this.initSkills();this._currentPage="JobPostingOptions";this._dataStore.set_property("currentPage",this._currentPage);this.postingDetailsParent.style.display="none";this.postingOptionsParent.style.display="block";$('#HiringLibScreen').hide();$('#DidyouKnowScreen').hide();$('#job-posting-temp-wrapper').hide();this.goBackLink.style.display="inline";window.scrollTo(0,0);}
else if(this._currentPage=="JobPostingOptions"){this._pendingNavigationType=null;document.location=this._redirectURL;}}
if(this.isActivePosting){if(this._currentPage=="JobPostingOptions"){$(this.continueLink).children().children().children()[0].innerHTML=this.msgApplyChanges;}
else{$(this.continueLink).children().children().children()[0].innerHTML=this.msgContinue;}}},onNavigationPressed:function(event){if(this.adapter._pendingNavigationType!=null)
return;this.adapter._pendingNavigationType=this.navigation;this.adapter._dataStore.set_property("ErrorSummaryDisplay_ClearErrors","");if(this.navigation!=Presenters.JPW.DTO.NavigationActionType.GoBack){if(this.adapter._currentPage=="JobDetail"){var isValid=false;var isValidDesc=false;var isCJD=false;if(this.adapter._dataStore.get_property("originalDescriptionID")!=null||this.adapter._dataStore.get_property("originalDescriptionID")!=undefined){isCJD=(this.adapter._dataStore.get_property("originalDescriptionID")>0);}
else{if(JobDescVisible=="False"||JobDescVisible=='false'){isCJD=true;this.adapter._dataStore.set_property("selectedTemplateId",(InititalTemplateID*1));}
else{isCJD=false;}}
if(this.navigation==Presenters.JPW.DTO.NavigationActionType.SaveForLater){this.adapter._dataStore.set_property("ValidateJobSave",true);dcsMultiTrack('DCS.dcsuri','/jobs/SaveForLaterDetails.evt','DCSext.en','SaveLaterDetails','WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI('Details:Save+for+Later'),'WT.z_jpw_ssc','1');}
else{this.adapter._dataStore.set_property("ValidateJobSave",false);}
this.adapter._dataStore.set_property("validateDetailsPage_request","1");var CJFValid=this.adapter._dataStore.get_property("ValidateCustomFields")==false?false:true;var islibValid=this.adapter._dataStore.get_property("ValidateLibrary");if(islibValid==null){islibValid=true;}
if(isCJD){if(this.adapter._dataStore.get_property("ValidateInformation")&&this.adapter._dataStore.get_property("ValidateCompany")&&this.adapter._dataStore.get_property("ValidateContact")&&CJFValid&&islibValid){isValid=true;}}
else if(this.adapter.hideCompanyInformation=="True"){if(this.adapter._dataStore.get_property("ValidateInformation")&&this.adapter._dataStore.get_property("ValidateDescription")&&this.adapter._dataStore.get_property("ValidateContact")&&CJFValid&&islibValid){isValid=true;}}
else if(this.adapter._dataStore.get_property("ValidateInformation")&&this.adapter._dataStore.get_property("ValidateDescription")&&this.adapter._dataStore.get_property("ValidateCompany")&&this.adapter._dataStore.get_property("ValidateContact")&&CJFValid&&islibValid){isValid=true;}
if(isValid){this.adapter._pageManager.initHtmlLazyLoadControl("OptionsPage");this.adapter.showModal(mode=this.adapter.ePopupMode.Spinner);this.adapter._webService=EBiz.Services.JPW.JobDetailsService;var uberdetails=this.adapter.GenerateUberDetailsObject();if(typeof dcsMultiTrack!="undefined"){var d_sbs=new Array();var d_sbs_cnt=new Array();if(uberdetails.OfccpInformation!=null){if(uberdetails.OfccpInformation.FolderRefCode!=null||uberdetails.OfccpInformation.FolderRefCode.length>0){d_sbs.push("Details:OFCCP:Section+Completed");d_sbs_cnt.push("1");}}
if(uberdetails.CompanyInformation!=null&&uberdetails.CompanyInformation.CompanyIndustry&&uberdetails.CompanyInformation.CompanyIndustry.SelectedValue){if(uberdetails.CompanyInformation.CompanyIndustry.SelectedValue.length>1){d_sbs.push("Details:Company+Industry:Add+Another");d_sbs_cnt.push("1");}}
if(uberdetails.ContactInformation.AllowApplyOnline!=null&&uberdetails.ContactInformation.AllowApplyOnline==true){d_sbs.push("Details:Contact+Method:Candidates+Apply+Online");d_sbs_cnt.push("1");}
if(uberdetails.ContactInformation.FilterCandidateResponse!=null&&uberdetails.ContactInformation.FilterCandidateResponse==true){d_sbs.push("Details:Contact+Method:Flag+Resumes");d_sbs_cnt.push("1");}
if(uberdetails.ContactInformation.AllowDirectContact!=null&&uberdetails.ContactInformation.AllowDirectContact==true){d_sbs.push("Details:Contact+Method:Directly");d_sbs_cnt.push("1");}
var hLib=this.adapter._dataStore.get_property("GetHiringLibView");if(hLib!=null&&hLib.isAddToLibrary==true){d_sbs.push("Details:Save+to+Hiring+Library");d_sbs_cnt.push("1");}
dcsMultiTrack('DCS.dcsuri','/jobs/JobWizard_LoadDetailsWizard.evt','DCSext.en','Load','WT.z_jpw_step',encodeURI('Job+Details'),'WT.z_jpw_substep',encodeURI(d_sbs.join(";")),'WT.z_jpw_ssc',d_sbs_cnt.join(";"));}
this.adapter.callServer("SaveJobDetailsData",[uberdetails,this.adapter._pendingNavigationType]);}
else{this.adapter._pendingNavigationType=null;this.adapter._dataStore.set_property("TriggerRequiredErrorDisplay","");window.scrollTo(0,0);}}
else if(this.adapter._currentPage=="JobPostingOptions"){this.adapter._dataStore.set_property("validateOptionsPage_results",true);this.adapter._dataStore.set_property("validateOptionsPage_request","1");var isValid=this.adapter._dataStore.get_property("validateOptionsPage_results");if(isValid){this.adapter._webService=EBiz.Services.JPW.JobPostingOptionsService;var uberObject=this.adapter.GenerateUberOptionsObject();if(typeof(dcsMultiTrack)!=="undefined"){var sbstep=[];var sbcnt=[];var sbflag=false;for(var i=0;i<uberObject.CountryOccupations.length;i++){if(uberObject.CountryOccupations[i].Occupations.length>1){sbflag=true;}}
if(sbflag){sbstep.push("Posting+Options:Search+Occupation:Add+Another");sbcnt.push("1");}
if(uberObject.SelectedLocations.length>1){sbstep.push("Posting+Options:Search+Location:Add+Another");sbcnt.push("1");}
if(uberObject.SaveToHiringLibrary.isAddToLibrary){sbstep.push("Posting+Options:+Save+Job+to+Hiring+Library");sbcnt.push("1");}
if(uberObject.SelectedEnhancements.length>0){var siteChk=false;for(var i=0;i<uberObject.SelectedEnhancements.length;i++){switch(uberObject.SelectedEnhancements[i].EnhancementType){case Presenters.JPW.DTO.EnhancementType.Diversity:sbstep.push("Posting+Options:Sites:Monster+&+Diversity");sbcnt.push("1");siteChk=true;break;case Presenters.JPW.DTO.EnhancementType.TiedDiversity:sbstep.push("Posting+Options:Sites:Monster+&+Diversity");sbcnt.push("1");siteChk=true;break;default:break;}}
if(!siteChk){sbstep.push("Posting+Options:Sites:Monster");sbcnt.push("1");}}
if(jQuery.data("ACRegion")==true){sbstep.push("Posting+Options:Search+Location:Type+Ahead");sbcnt.push("1");}
if(jQuery.data("ACCategory")==true){sbstep.push("Posting+Options:Search+Occupation:Type+Ahead");sbcnt.push("1");}
dcsMultiTrack('DCS.dcsuri','/jobs/JobPostingDetailsOptions_Det_jpw.evt','DCSext.en','MtchCrtaJPW',"DCSext.cseg",this.adapter.companyID,"DCSext.en_attrib","MtchCrtaJPW-appplus","DCSext.jt",this.adapter._JobTitle,"DCSext.mtchjt",uberObject.ApplyScoringData?uberObject.ApplyScoringData.JobTitle:"",'WT.z_jpw_substep',sbstep.join(";"),'WT.z_jpw_ssc',sbcnt.join(";"));}
this.adapter.callServer("SavePostingOptionsData",[uberObject,this.adapter._pendingNavigationType]);}
else{this.adapter._pendingNavigationType=null;window.scrollTo(0,0);}}}
else{var blnback=false;blnback=confirm(this.adapter.msgNavigationWarning);if(blnback){this.adapter.updateCurrentPage();this._webService=EBiz.Services.JPW.JobDetailsService;var pid=this.adapter.get_PostingID();this.adapter.callServer("GetPostingDetailsData",[pid]);}
else{this.adapter._pendingNavigationType=null;}}
event.stopPropagation();event.preventDefault();},GenerateUberDetailsObject:function(){var uber=new Presenters.JPW.DTO.JobDetailsView();this._dataStore.set_property("UberDetailsObject");uber.JobInformation=this._dataStore.get_property("GetInformationView");this._JobTitle=uber.JobInformation.JobTitle;uber.CompanyInformation=this._dataStore.get_property("GetCompanyView");uber.ContactInformation=this._dataStore.get_property("GetContactView");uber.OfccpInformation=this._dataStore.get_property("GetOfccpInformationView");uber.JobBuilderFields=this._dataStore.get_property("GetBuilderFieldsView");uber.JobDescription=this._dataStore.get_property("GetDescriptionView");uber.JobTemplateId=this._dataStore.get_property("selectedTemplateId");uber.PostingId=this.get_PostingID();if(this._pendingNavigationType==Presenters.JPW.DTO.NavigationActionType.SaveForLater){uber.SaveToHiringLibrary=this._dataStore.get_property("GetHiringLibView");}
else{this._hiringLibraryView=this._dataStore.get_property("GetHiringLibView");}
if(this._folderID!=null){uber.Folder=this._folderID;}
uber.Ref=window.location.search.substring(1);if(this.jobLibId!=null){uber.Lib=this.jobLibId*1;}
return uber;},GenerateUberOptionsObject:function(){var uber=new Presenters.JPW.DTO.PostingOptionsView();this._dataStore.set_property("UberOptionsObject");this._dataStore.set_property("UpdatePostingDate","");uber.PostingId=this.get_PostingID();var postingDate=this._dataStore.get_property("OPTIONS_PostingActiveDate");var expiryDate=this._dataStore.get_property("OPTIONS_PostingExpiryDate");var isManualExpiry=this._dataStore.get_property("OPTIONS_IsCustomExpiry");if(postingDate!=null&&postingDate!=undefined){uber.ActiveDate=postingDate;}
if(expiryDate!=null&&expiryDate!=undefined){uber.Expiry=expiryDate;}
if(isManualExpiry!=null&&isManualExpiry!=undefined){uber.IsCustomExpiry=isManualExpiry;}
var catStore=this._dataStore.get_property("selectedCategories");uber.CountryOccupations=[];for(var countryid in catStore){var newOccupation=[];for(var categoryid in catStore[countryid].Categories){for(var occupationid in catStore[countryid].Categories[categoryid].Occupations){var coOccItem={Category:catStore[countryid].Categories[categoryid].catid,Occupation:catStore[countryid].Categories[categoryid].Occupations[occupationid].occid};newOccupation.push(coOccItem);}}
var coitem={CountryId:catStore[countryid].countryid,Occupations:newOccupation};uber.CountryOccupations.push(coitem);}
var selectedLocationsMap=this._dataStore.get_property("selectedLocations");uber.SelectedLocations=[];if(selectedLocationsMap!=null){for(var currentLocation in selectedLocationsMap){uber.SelectedLocations.push(currentLocation*1);}}
uber.BuilderFields=this._dataStore.get_property("GetPostingOptionsBuilderFields");uber.SelectedEnhancements=this._dataStore.get_property("selectedEnhancements");var enhList=uber.SelectedEnhancements;var enWT=new Array();var enWSCnt=new Array();if(enhList!=null){for(var i=0;i<enhList.length;i++){switch(parseInt(enhList[i].EnhancementType)){case 5:enWT.push("Posting+Options:Enhancement:Bolding");enWSCnt.push("1");break;case 4:enWT.push("Posting+Options:Enhancement:jobLogo");enWSCnt.push("1");break;case 10:enWT.push("Posting+Options:Enhancement:Diversity");enWSCnt.push("1");break;case 14:enWT.push("Posting+Options:Enhancement:MOD");enWSCnt.push("1");break;case 6:enWT.push("Posting+Options:Enhancement:CAN");enWSCnt.push("1");break;case 9:enWT.push("Posting+Options:Enhancement:Resume+Search");enWSCnt.push("1");break;case 11:enWT.push("Posting+Options:Enhancement:NYT");enWSCnt.push("1");break;case 15:enWT.push("Posting+Options:Enhancement:Globe");enWSCnt.push("1");break;case 16:enWT.push("Posting+Options:Enhancement:Video");enWSCnt.push("1");break;case 17:enWT.push("Posting+Options:Enhancement:ApplyScoring");enWSCnt.push("1");break;default:break;}}
dcsMultiTrack('DCS.dcsuri','/jobs/JPWEnhancements.evt','DCSext.en','JPWEnhancements','WT.z_jpw_step',encodeURI('Job+Posting+Options'),'WT.z_jpw_substep',encodeURI(enWT.join(";")),'WT.z_jpw_ssc',encodeURI(enWSCnt.join(";")));}
uber.SkillsCollection=this.PopulateSkills();uber.SaveToHiringLibrary=this._hiringLibraryView;uber.JobBoardGroupAliasKey=this._dataStore.get_property("GetJobBoardGroupAlias");uber.ScreeningSelection=this._dataStore.get_property("GetScreeningSelection");uber.AutoReplyLetterSelection=this._dataStore.get_property("GetAutoReplyLetterSelection");if(uber.SaveToHiringLibrary==undefined||uber.SaveToHiringLibrary==null){uber.SaveToHiringLibrary=new Presenters.JPW.DTO.JobAddToLibraryView();uber.SaveToHiringLibrary.isAddToLibrary=false;}
this._dataStore.set_property("setApplyScoringData");uber.ApplyScoringData=this._dataStore.get_property("ApplyScoringData");if(this._folderID){uber.Folder=this._folderID;}
uber.Ref=window.location.search.substring(1);return uber;},PopulateSkills:function(){var skills=[];var inputs=this._skillsinput;var istag=false;if(inputs!=null){for(var i=0;i<inputs.length;i++){if(inputs[i]!=null){skills.push(encodeURIComponent(inputs[i].value));istag=true;}}}
if(istag)
dcsMultiTrack('DCS.dcsuri','/jobs/SkillsQHire.evt','DCSext.en','QuickHireSkills','WT.z_jpw_step',encodeURI('Job+Posting+Options'),'WT.z_jpw_substep',encodeURI('Posting+Options:Candidate+Skills:Used'),'WT.z_jpw_ssc','1');return skills;},PermissionErrorClosed:function(){window.location="/jobs/managejobs.aspx";},OnJobWizardContextErrorClosed:function(){window.location="/";},triggerJobWizardContextError:function(event){var ad=null;ad=this.jobWizardContextErrorPopup._behaviors[0];ad.showDialog(event);},ClearAllValidationErrors:function(){if(this._currentPage=="JobDetail"){this._dataStore.set_property("SetValidationErrors",{validateElement:"IONumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"JobLocation",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"JobDescription",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"EmailAddress",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"PhoneNumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"FaxNumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"FilterZipCode",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"ContactZipCode",isShow:false});}
else if(this._currentPage=="JobPostingOptions"){this._dataStore.set_property("SetValidationErrors",{validateElement:"JobSearchArea",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"JobSearchCategory",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"ResumeUpsell",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_Industry",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_JobTitle",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_JobHeading",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_ContactInfo",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"BG_PrintAd",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_AdType",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_Industry",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_JobTitle",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_PrintAd",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"NYT_ContactInfo",isShow:false});}}}
Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingDetailsOptionsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.HiringLibraryAdapter=function(element){Monster.Client.Behavior.JobPosting.HiringLibraryAdapter.initializeBase(this,[element]);this.previous_Selection=0;this.dropSelCount=0;this.isReserved=false;this.createProperty("Prompt");this.createProperty("LibraryDropDown");this.createProperty("SlotDropDown");this.createProperty("JobLib_rcJobInformation");this.createProperty("HLText");this.createProperty("isVisible");}
Monster.Client.Behavior.JobPosting.HiringLibraryAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.HiringLibraryAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("LibraryData");this.registerDataProperty("LoadData");this.registerDataProperty("CommonPostingID");this.registerDataProperty("GetCommonData");this.registerDataProperty("JobLibraryIsVisible");this.registerDataProperty("IsJobTitleUniqueAsJobLibraryName");this._webService=EBiz.Services.JPW.JobDetailsService;},initHandlers:function(element,event,context){event.preventDefault();switch(element.id){case this.LibraryDropDown.id:case this.SlotDropDown.id:if(event.type=="change"){$addHandlers(element,{change:this.DownloadLibraryData},{instance:this,value:[element,"FULL"]});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.DownloadLibraryData(element,"FULL");}}
break;default:break;}
if(element.id.endsWith("linkCopyReservedJobDesc")||element.id.endsWith("linkCopyJobDesc")){$addHandlers(element,{change:this.DownloadLibraryData},{instance:this,value:[element,"DESCONLY"]});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.DownloadLibraryData(element,"DESCONLY");}}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"GetJobLibraryData":userContext._dataStore.set_property("LoadData",result);break;default:break;}},LoadJobDesc:function(libraryid){if(MonsPageManager.enableInitOnDemand){MonsPageManager.onClick();}
this._dataStore.set_property("GetCommonData");var pid=this._dataStore.get_property("CommonPostingID");this.isReserved=true;this.callServer("GetJobLibraryData",[pid,libraryid,true]);},onFailure:function(result,userContext,methodName){switch(methodName){case"GetJobLibraryData":break;default:break;}},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.HiringLibraryAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"LoadData":break;case"GetCommonData":break;case"JobLibraryIsVisible":this.JobLib_rcJobInformation.style.display=this._dataStore.get_property("JobLibraryIsVisible")=="true"?"block":"none";break;case"IsJobTitleUniqueAsJobLibraryName":var drop_cntr=null;var jtitle=this._dataStore.get_property("IsJobTitleUniqueAsJobLibraryName");var isUq=true;if(this.LibraryDropDown!=null&&this.LibraryDropDown.options!=null){drop_cntr=this.LibraryDropDown;}
else if(this.SlotDropDown!=null&&this.SlotDropDown.options!=null){drop_cntr=this.SlotDropDown;}
if(this.isVisible=="false"&&this.HLText!=null){drop_cntr={};drop_cntr.options=[];for(var i=0;i<this.HLText.length;i++){drop_cntr.options.push({text:this.HLText[i]});}}
if(drop_cntr){var tempOptions=drop_cntr.options;for(var i=0;i<tempOptions.length;i++){if(tempOptions[i].text==jtitle){isUq=false;}}
this._dataStore.set_property("UniqueTitle",isUq);}
else{this._dataStore.set_property("UniqueTitle",true);}
break;default:break;}},DownloadLibraryData:function(cb,libtype){var me=(typeof(this.instance)!=='undefined')?this.instance:this;if(this.value!=null||this.value!=undefined){cb=this.value[0];libtype=this.value[1];}
var overwritePromptMsg=me.get_Prompt();var isPersonal=false;if(libtype=="FULL"){isPersonal=false;this.isReserved=false;}
else{this.isReserved=true;isPersonal=true;}
if(cb){var idx=cb.selectedIndex;var selectedIddVal=parseInt(cb.options[idx].value);var confirmOverwrite=false;me._dataStore.set_property("GetCommonData");var jTitle=me._dataStore.get_property("CommonJobTitle");if(jTitle==null||jTitle=="")
confirmOverwrite=true;else
confirmOverwrite=confirm(overwritePromptMsg);if(confirmOverwrite){me._dataStore.set_property("LibItemID",selectedIddVal);var pid=me._dataStore.get_property("CommonPostingID");me.callServer("GetJobLibraryData",[pid,selectedIddVal,isPersonal]);me.previous_Selection=idx;}
else{cb.selectedIndex=me.previous_Selection;}}}}
Monster.Client.Behavior.JobPosting.HiringLibraryAdapter.registerClass('Monster.Client.Behavior.JobPosting.HiringLibraryAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.initializeBase(this,[element]);this.createProperty("JobPrintAdPreview_newsPrintHolderInner");this.createProperty("JobPrintAdPreview_btnClose");this.createProperty("JobPrintAdPreview_newspaper");this.createProperty("JobPrintAdPreview_industry");this.createProperty("JobPrintAdPreview_jobTitle");this.createProperty("JobPrintAdPreview_adText");this.createProperty("JobPrintAdPreview_contact");}
Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.callBaseMethod(this,'initialize');this.registerDataProperty("PopulatePrintAdView");this._dataStore.set_property("PopulatePrintAdView");$addHandlers(this.JobPrintAdPreview_btnClose,{click:this.closePrompt},this);if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context){if(context=="buttonClose"){$addHandlers(element,{click:this.closePrompt},this);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"PopulatePrintAdView":var printAD;var newspaper=this.get_JobPrintAdPreview_newspaper();var contentPlace=this.get_JobPrintAdPreview_newsPrintHolderInner();printAD=this.getPrintAd(newspaper);contentPlace.innerHTML=printAD;break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;},onFailure:function(result,userContext,methodName){},getPrintAd:function(newspaper){var printAD="";if(newspaper=='NYTimes'){printAD+='<div>'+this.get_JobPrintAdPreview_industry()+'</div>';printAD+='<div class="divPreview">'+this.get_JobPrintAdPreview_jobTitle()+'</div>';printAD+='<div class="divPreview"><span class="word-wrap">'+this.get_JobPrintAdPreview_adText()+'</span></div>';}
else{printAD+='<div>'+this.get_JobPrintAdPreview_industry()+'</div>';printAD+='<div class="divPreview">'+this.get_JobPrintAdPreview_jobTitle()+'</div>';printAD+='<div class="divPreview"><span class="word-wrap">'+this.get_JobPrintAdPreview_adText()+'</span></div>';printAD+='<div>'+this.get_JobPrintAdPreview_contact()+'</div>';}
return printAD;},closePrompt:function(event){if(window.parent.globeprevdialog){window.parent.globeprevdialog.hideDialog();}
if(window.parent.nytprevdialog){window.parent.nytprevdialog.hideDialog();}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsPrintAdPreviewAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobTemplateAdapter=function(element){Monster.Client.Behavior.JobPosting.JobTemplateAdapter.initializeBase(this,[element]);this.JobTemplate_dropDownVisible=false;this.JobTemplate_tmpDescriptionID=0
this.JobTemplate_tmpTemplateID=0;this.JobTemplate_tmpTemplateDesc=null;this.createProperty("JobTemplatePreviewAdapter");this.currentTemplate=0;this.hiddenFields=[];this.createProperty("JobTemplate_lblTemplateSelected");this.createProperty("JobTemplate_modalDialogContentURL");this.createProperty("JobTemplate_nameMaxLength");this.createProperty("JobTemplate_stdTemplateId");this.createProperty("JobTemplate_originalDescriptionID");this.createProperty("JobTemplate_selectedTemplateId");this.createProperty("OkButton");this.createProperty("CancelButton");this.createProperty("SelectionHeader");this.createProperty("PostingID");this.createProperty("_selectionAlertTemplateID");this.createProperty("_selectionAlertTemplateDescription");this.createProperty("_selectionAlertTemplateJobDescriptionID");}
Monster.Client.Behavior.JobPosting.JobTemplateAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobTemplateAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("CommonPostingID");this.registerDataProperty("LoadData");this.registerDataProperty("GetCommonData");this.registerDataProperty("PopulateDetailsView");this.registerDataProperty("originalDescriptionID");this.registerDataProperty("selectedTemplateId");this._webService=EBiz.Services.JPW.JobDetailsService;this._dataStore.set_property("selectedTemplateId",this.JobTemplate_selectedTemplateId);this._dataStore.set_property("originalDescriptionID",this.JobTemplate_originalDescriptionID);},initHandlers:function(element,event,context){event.preventDefault();switch(element.id){case"templateButton":$addHandlers(element,{click:this.JobTemplate_showTemplateDropdown},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.JobTemplate_showTemplateDropdown()}
break;case"previewtemplate":this.hiddenFields=[];this.hiddenFields.push($get('JobTemplateID',element.parentNode));$addHandlers(element,{click:this.Preview},{adapter:this,jobTemplateID:context});if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.Preview.call({adapter:this,jobTemplateID:context});}
break;case"selecttemplate":$addHandlers(element,{click:this.Select},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.Select(event,element);}
break;case this.OkButton.id:$addHandlers(element,{click:this.OkClick},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.OkClick(event,element);}
break;case this.CancelButton.id:$addHandlers(element,{click:this.CancelClick},this);if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){this.CancelClick(event,element);}
break;default:break;}},Preview:function(){this.adapter.previewJobTemplate(this.jobTemplateID);},Select:function(event,args){this.hiddenFields=[];this.hiddenFields.push($get('JobTemplateID',event.target.parentNode));this.hiddenFields.push($get('EncodeDesc',event.target.parentNode));this.hiddenFields.push($get('JobDescID',event.target.parentNode));this.selectTemplate(this.hiddenFields[0].value,this.hiddenFields[1].value,this.hiddenFields[2].value);return false;},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"GetJobDetailStateDataByTemplateId":userContext.JobTemplate_onSuccessSelectTemplate(result);break;case"SaveJobPostingPreview":case"SaveCustomJobDescriptionPreview":userContext.JobTemplate_previewTemplate(userContext.currentTemplate);break;default:break;}},OnFailure:function(result,userContext,methodName){switch(methodName){case"GetJobDetailStateDataByTemplateId":break;case"SaveJobPostingPreview":case"SaveCustomJobDescriptionPreview":break;default:break;}},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.JobTemplateAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"LoadData":var data=this._dataStore.get_property("LoadData");if(data.JobTemplate!=null&&data.JobTemplate.JobTemplateId!=null&&data.JobTemplate.JobTemplateId!=0)
this.selectTemplate(data.JobTemplate.JobTemplateId,data.JobTemplate.TemplateDescription,data.JobTemplate.JobDescriptionID,true);break;case"CommonPostingID":break;default:break;}},selectTemplate:function(templateID,templateDescription,jobDescriptionID,skipDropDownDisplay){var isCJDJob=(this._dataStore.get_property("originalDescriptionID")>0);var isCJDPage=(this._dataStore.get_property("currentPage")=="CJD");if(((((this._hasDataTransformationImpact()&&jobDescriptionID>0)||isCJDJob)&&!isCJDPage)||isCJDPage)&&this.JobTemplate_selectedTemplateId!=templateID){this.showSelectionAlert(templateID,templateDescription,jobDescriptionID);}
else{this.JobTemplate_selectTemplate(templateID,templateDescription,jobDescriptionID,skipDropDownDisplay);}},_hasDataTransformationImpact:function(){this._dataStore.set_property("HasDataTransformationImpact","false");this._dataStore.set_property("JobInformation_DataTransformationImpact");this._dataStore.set_property("JobDesc_DataTransformationImpact");return this._dataStore.get_property("HasDataTransformationImpact")=="true";},showSelectionAlert:function(templateID,templateDescription,jobDescriptionID){document.getElementById('selectionAlertHeader').innerHTML=this.get_SelectionHeader().replace('%1',templateDescription);this._selectionAlertTemplateID=templateID;this._selectionAlertTemplateDescription=templateDescription;this._selectionAlertTemplateJobDescriptionID=jobDescriptionID;this.setSelectionAlertVisibility(true);},OkClick:function(event){this.JobTemplate_selectTemplate(this._selectionAlertTemplateID,this._selectionAlertTemplateDescription,this._selectionAlertTemplateJobDescriptionID);event.preventDefault();event.stopPropagation();},CancelClick:function(event){this.JobTemplate_showTemplateDropdown();event.preventDefault();event.stopPropagation();},setSelectionAlertVisibility:function(visible){var tcContainer=$get("tcContainer");var selectionAlert=$get("selectionAlert");var warningIframe=$get("warningIframe");selectionAlert.style.display=(visible?'block':'none');if($isIE()){selectionAlert.style.visibility=(visible?'visible':'hidden');if(Sys.Browser.version<7){if(visible){warningIframe.style.visibility="visible";warningIframe.style.display="block";warningIframe.style.height=selectionAlert.clientHeight+"px";warningIframe.style.width=selectionAlert.clientWidth+"px";warningIframe.style.marginTop=tcContainer.clientHeight-1+"px";selectionAlert.style.marginTop=tcContainer.clientHeight-1+"px";}
else{warningIframe.style.display="none";warningIframe.style.visibility="hidden";}}}},previewJobTemplate:function(templateID){this._dataStore.set_property("GetDetailsView");this.currentTemplate=templateID;var isCJDPage=(this._dataStore.get_property("currentPage")=="CJD");if(isCJDPage){var pid=this._dataStore.get_property("CommonPostingID");this._webService=EBiz.Services.JPW.CustomJobDescriptionService;this.callServer("SaveCustomJobDescriptionPreview",[pid,templateID,createJobBuilderAnswersView(),Presenters.JPW.DTO.PreviewTypes.JobPostingPreview]);}
else{var view=this._dataStore.get_property("PopulateDetailsView");this._webService=EBiz.Services.JPW.JobDetailsService;this.callServer("SaveJobPostingPreview",[view,Presenters.JPW.DTO.PreviewTypes.JobPostingPreview]);}},JobTemplate_showTemplateDropdown:function(){var dropdown=$get("templateContainer");dropdown.style.zIndex=100;this.JobTemplate_dropDownVisible=!this.JobTemplate_dropDownVisible;dropdown.style.display=(this.JobTemplate_dropDownVisible?"block":"none");var templateIframe=$get("templateIframe");var tcContainer=$get("tcContainer");if(this.JobTemplate_dropDownVisible&&$isIE()){templateIframe.style.display="block";templateIframe.style.height=tcContainer.clientHeight+"px";templateIframe.style.width=tcContainer.clientWidth+"px";}
else{templateIframe.style.display="none";}
this.setSelectionAlertVisibility(false);},JobTemplate_previewTemplate:function(templateId){var previewTemplateType='10010';if(templateId!=this.JobTemplate_selectedTemplateId){previewTemplateType='10001';}
var strURL=this.JobTemplate_modalDialogContentURL+templateId;window.open(strURL,"jobSearchResultsPreview","left=80,top=80,height=770, width=1000, scrollbars=yes, resizable=yes");this.hideModal(mode=this.ePopupMode.Spinner);},JobTemplate_selectTemplate:function(templateId,templateDesc,descriptionBuilderId,skipDropDownDisplay){var view=new Presenters.JPW.DTO.JobTemplateView();this.JobTemplate_tmpTemplateDesc=templateDesc;this.JobTemplate_tmpDescriptionID=descriptionBuilderId;this.JobTemplate_tmpTemplateID=templateId;var selectedTemplateType='11000';if(templateId!=this.get_JobTemplate_selectedTemplateId()){selectedTemplateType='10100';}
view.SelectedTemplateId=templateId;this._dataStore.set_property("selectedTemplateId",templateId);view.SelectedTemplateJobDescriptionID=descriptionBuilderId;this._dataStore.set_property("GetCommonData");var pid=this.PostingID;if(pid==null)
pid=this._dataStore.get_property("CommonPostingID");this._webService=EBiz.Services.JPW.JobDetailsService;this.callServer("GetJobDetailStateDataByTemplateId",[pid,parseInt(templateId)]);if(skipDropDownDisplay==null||skipDropDownDisplay==false)
this.JobTemplate_showTemplateDropdown();},JobTemplate_onSuccessSelectTemplate:function(result){this.JobTemplate_UpdateTemplateName();if(result.Errors.length==1&&result.Errors[0].WSErrorType==3){var isNonCJDSelected=result.Errors[0].ErrorMessageText.search("JobPostingDetailsOptions")!=-1;var isCJDJob=(this._dataStore.get_property("originalDescriptionID")>0);var isCJDPage=(this._dataStore.get_property("currentPage")=="CJD");if(((!isNonCJDSelected&&!isCJDPage)||isCJDPage)&&this.JobTemplate_selectedTemplateId!=this._dataStore.get_property("selectedTemplateId")){document.location=result.Errors[0].ErrorMessageText;}
else if(isNonCJDSelected&&isCJDJob&&!isCJDPage){for(var i=0;result.JobDetailStates.length>i;i++){switch(result.JobDetailStates[i].JobDetailStateTypes){case Presenters.JPW.DTO.JobDetailStateTypes.JobDescriptionIsVisible:this._dataStore.set_property("JobDescriptionIsVisible",result.JobDetailStates[i].Value);break;case Presenters.JPW.DTO.JobDetailStateTypes.JobTitleIsEnabled:this._dataStore.set_property("JobTitleIsEnabled",result.JobDetailStates[i].Value);break;case Presenters.JPW.DTO.JobDetailStateTypes.JobLibraryIsVisible:this._dataStore.set_property("JobLibraryIsVisible",result.JobDetailStates[i].Value);break;case Presenters.JPW.DTO.JobDetailStateTypes.JobLogoIsVisible:this._dataStore.set_property("JobLogoIsVisible",result.JobDetailStates[i].Value);break;case Presenters.JPW.DTO.JobDetailStateTypes.OfflineContactIsVisible:this._dataStore.set_property("OfflineContactIsVisible",result.JobDetailStates[i].Value);break;default:break;}}
this.JobTemplate_selectedTemplateId=this._dataStore.get_property("selectedTemplateId");this._dataStore.set_property("originalDescriptionID","0");}
if(result.IsCJDTemplate){this._dataStore.set_property("hideCJDCrumb",true);}
else{this._dataStore.set_property("hideCJDCrumb",false);}}},JobTemplate_Refresh:function(){this._dataStore.set_property("GetCommonData");var pid=this._dataStore.get_property("CommonPostingID");this._webService=EBiz.Services.JPW.JobDetailsService;this.callServer("GetJobTemplateData",[pid]);},JobTemplate_onSuccessRefresh:function(view){this.JobTemplate_tmpTemplateDesc=view.SelectedTemplateName;this.JobTemplate_UpdateTemplateName();},JobTemplate_UpdateTemplateName:function(){this.JobTemplate_lblTemplateSelected.title=this.JobTemplate_tmpTemplateDesc;if(this.JobTemplate_tmpTemplateDesc.length>parseInt(this.get_JobTemplate_nameMaxLength())){this.JobTemplate_tmpTemplateDesc=this.JobTemplate_tmpTemplateDesc.substring(0,this.get_JobTemplate_nameMaxLength());}
this.JobTemplate_lblTemplateSelected.innerHTML=this.JobTemplate_tmpTemplateDesc;}}
Monster.Client.Behavior.JobPosting.JobTemplateAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobTemplateAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter=function(element){Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter.initializeBase(this,[element]);this.createProperty("JobAgencyInfo_txtEmail");this.createProperty("JobAgencyInfo_txtPhone");this.createProperty("JobAgencyInfo_txtFax");this.createProperty("JobAgencyInfo_txtContactName");this.createProperty("JobAgencyInfo_txtCompanyName");this.createProperty("JobAgencyInfo_txtAddress1");this.createProperty("JobAgencyInfo_txtAddress2");this.createProperty("JobAgencyInfo_txtCity");this.createProperty("JobAgencyInfo_ddlState");this.createProperty("JobAgencyInfo_txtPostalCode");this.createProperty("JobAgencyInfo_IsAdAgencyCompany");}
Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("GetAgencyView");this.registerDataProperty("UberDetailsObject");},dispose:function(){Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":var view=this.BuildJobAgencyInfoView();this._dataStore.set_property("GetAgencyView",view);break;default:break;}},ClearJobAgencyControl:function(){this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtEmail,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtPhone,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtFax,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtContactName,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtCompanyName,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtAddress1,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtAddress2,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtCity,"","");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_ddlState,0,"");this.JobAgencyInfo_SetValueToControl(this.JobAgencyInfo_txtPostalCode,"","");},BuildJobAgencyInfoView:function(){var view,contactDef,address;view=new Presenters.JPW.DTO.AgencyInformationView();contactDef=new Presenters.JPW.DTO.ContactDefinitionData();contactDef.ContactPerson=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtContactName,"","text");contactDef.Company=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtCompanyName,"","text");contactDef.Email=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtEmail,"","text");contactDef.Fax=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtFax,"","text");contactDef.Phone=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtPhone,"","text");address=new Presenters.JPW.DTO.AddressData();address.City=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtCity,"","text");address.StreetAddress1=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtAddress1,"","text");address.StreetAddress2=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtAddress2,"","text");address.ZipCode=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_txtPostalCode,"","text");address.StateId=this.JobAgencyInfo_GetControlValue(this.JobAgencyInfo_ddlState,"","select-one");contactDef.Address=address;view.Contact=contactDef;return null;},JobAgencyInfo_GetControlValue:function(ctrl,sampleText,type){if(ctrl==null)
{switch(type)
{case"checkbox":return false;break;case"select-one":return 0;break;case"text":return"";break;}
return"";}
switch(ctrl.type)
{case"checkbox":return ctrl.checked;break;case"select-one":if(ctrl.value=="")
{return 0;}
else
{return parseInt(ctrl.value);}
break;case"text":if(ctrl.value.trim()==sampleText)
{return"";}
else
{return ctrl.value;}
break;}}}
Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsAgencyInfoAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter=function(element){Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter.initializeBase(this,[element]);this.createProperty("postingDetailsParent");this.createProperty("saveTemplateChk");this.createProperty("saveTemplateDiv");this.createProperty("PostingID");this.createProperty("TemplateID");this.createProperty("_pageMode");this.createProperty("msgLibraryNameRequired");this.createProperty("hideCompanyInformation");this.createProperty("msgDescriptionRequired");this.createProperty("IsMarkJobPrivate");this.createProperty("JobLibraryDescription");this.createProperty("JobLibraryName");this.createProperty("JobLibraryDescriptionLabel");this.createProperty("JobLibraryNameLabel");this.createProperty("errorLibraryName");this.createProperty("errorLibraryDescription");this.createProperty("JOB_HIRING_LIBRARY_URL");this.jobLibraryID=null;this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobDetailsService;this.registerDataProperty("ValidateInformation");this.registerDataProperty("ValidateDescription");this.registerDataProperty("ValidateContact");this.registerDataProperty("ValidateCompany");this.registerDataProperty("ValidateLibrary");this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("GetDetailsView");},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"validateDetailsPage_request":var reqErrors=this.CheckRequired();var isValid=reqErrors.length==0;this._dataStore.set_property("ValidateLibrary",isValid);if(!isValid)
this._dataStore.set_property("DetailsRequiredErrorsCollector",reqErrors);break;case"GetDetailsView":this._dataStore.set_property("PopulateDetailsView",this.GenerateUberDetailsObject());break;default:break;}},initHandlers:function(element,event,context){var handler;if(element.id.endsWith("btnCancel")){handler=this.onBtnCancelClick;}
else if(element.id.endsWith("btnSave")){handler=this.onBtnSaveClick;}
var delegate=Function.createDelegate(this,handler);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
handler.call(this,event);},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0,l=this._delegates.length;i<l;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
delete this._delegates;}
Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter.callBaseMethod(this,'dispose');},onSuccess:function(result,userContext,methodName){userContext.ClearAllValidationErrors();if(userContext.processWebServiceErrorList(result)){return;}
switch(methodName){case"SaveJobLibraryItemDetailData":if(result!=null){if(result.length==1&&result[0].WSErrorType==Presenters.Base.Data.WSErrorType.RedirectUrl){document.location=userContext._redirectURL=result[0].ErrorMessageText;}
else{userContext.HandleServerErrors(result)}}
break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"SaveJobLibraryItemDetailData":break;}},CheckRequired:function(){var reqErrors=[];if(this.JobLibraryDescription.value!=""&&this.JobLibraryDescription.value!=null){this.ShowError(this.JobLibraryDescription,false);}
else{this.ShowError(this.JobLibraryDescription,true);reqErrors.push(this.msgDescriptionRequired);}
if(this.JobLibraryName.value!=""&&this.JobLibraryName.value!=null){this.ShowError(this.JobLibraryName,false);}
else{this.ShowError(this.JobLibraryName,true);reqErrors.push(this.msgLibraryNameRequired);}
return reqErrors;},ShowError:function(element,isShow){var labelTag=null;var iconTag=null;switch(element){case this.JobLibraryName:labelTag=this.JobLibraryNameLabel;iconTag=this.errorLibraryName;break;case this.JobLibraryDescription:labelTag=this.JobLibraryDescriptionLabel;iconTag=this.errorLibraryDescription;break;default:break;}
if(labelTag!=null)
isShow!=true?labelTag.style.color='#000000':labelTag.style.color='#CC0000';if(iconTag!=null)
isShow!=true?iconTag.style.display='none':iconTag.style.display='inline';},HandleServerErrors:function(result){for(var i=0;i<result.length;i++){switch(result[i].ErrorFieldId){case Presenters.JPW.DTO.ValidationFields.IONumber:this._dataStore.set_property("SetValidationErrors",{validateElement:"IONumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.JobLocation:this._dataStore.set_property("SetValidationErrors",{validateElement:"JobLocation",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.JobDescription:this._dataStore.set_property("SetValidationErrors",{validateElement:"JobDescription",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.EmailAddress:this._dataStore.set_property("SetValidationErrors",{validateElement:"EmailAddress",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.PhoneNumber:this._dataStore.set_property("SetValidationErrors",{validateElement:"PhoneNumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.FaxNumber:this._dataStore.set_property("SetValidationErrors",{validateElement:"FaxNumber",isShow:true});break;case Presenters.JPW.DTO.ValidationFields.ContactZipCode:this._dataStore.set_property("SetValidationErrors",{validateElement:"ContactZipCode",isShow:true});break;default:break;}}
this._dataStore.set_property("ErrorStore","");var err="";for(var i=0;i<result.length;i++){if(err==""){err=result[i].ErrorMessageText;}
else{err=err+"<br \>"+result[i].ErrorMessageText;}}
this._dataStore.set_property("ErrorStore",err);this._dataStore.set_property("TriggerRequiredErrorDisplay","");window.scrollTo(0,0);},onBtnSaveClick:function(event){event.stopPropagation();event.preventDefault();var isValid=false;this._dataStore.set_property("validateDetailsPage_request","1");this._dataStore.set_property("ErrorSummaryDisplay_ClearErrors","");var CJFValid=this._dataStore.get_property("ValidateCustomFields")==false?false:true;if(this.hideCompanyInformation=="True"){if(this._dataStore.get_property("ValidateInformation")&&this._dataStore.get_property("ValidateDescription")&&this._dataStore.get_property("ValidateContact")&&CJFValid&&this._dataStore.get_property("ValidateLibrary")){isValid=true;}}
else{if(this._dataStore.get_property("ValidateInformation")&&this._dataStore.get_property("ValidateDescription")&&this._dataStore.get_property("ValidateCompany")&&this._dataStore.get_property("ValidateContact")&&this._dataStore.get_property("ValidateLibrary")&&CJFValid){isValid=true;}}
if(isValid){this.callServer("SaveJobLibraryItemDetailData",[this.GenerateUberLibraryObject()]);}
else{this.DisplayErrors();}},DisplayErrors:function(){this._dataStore.set_property("TriggerRequiredErrorDisplay","");window.scrollTo(0,0);},onBtnCancelClick:function(event){event.stopPropagation();event.preventDefault();document.location=this.JOB_HIRING_LIBRARY_URL;},GenerateUberDetailsObject:function(){var detailsView=new Presenters.JPW.DTO.JobDetailsView();this._dataStore.set_property("UberDetailsObject");detailsView.JobInformation=this._dataStore.get_property("GetInformationView");detailsView.CompanyInformation=this._dataStore.get_property("GetCompanyView");detailsView.ContactInformation=this._dataStore.get_property("GetContactView");detailsView.JobDescription=this._dataStore.get_property("GetDescriptionView");detailsView.JobTemplateId=this.get_TemplateID();detailsView.PostingId=this.get_PostingID();detailsView.JobTemplateId=this._dataStore.get_property("selectedTemplateId");detailsView.JobBuilderFields=this._dataStore.get_property("GetBuilderFieldsView");return detailsView;},GenerateUberLibraryObject:function(){var fullView=new Presenters.JPW.DTO.JobLibraryItemDetailView();fullView.JobDetails=this.GenerateUberDetailsObject();var summaryView=new Presenters.JPW.DTO.JobLibrarySummaryView();summaryView.IsMarkJobPrivate=this.IsMarkJobPrivate?this.IsMarkJobPrivate.checked:false;summaryView.JobLibraryDescription=this.JobLibraryDescription.value;summaryView.JobLibraryName=this.JobLibraryName.value;fullView.JobLibrarySummary=summaryView;fullView.JobLibraryId=this.jobLibraryID;return fullView;},ClearAllValidationErrors:function(){this._dataStore.set_property("SetValidationErrors",{validateElement:"IONumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"JobLocation",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"JobDescription",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"EmailAddress",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"PhoneNumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"FaxNumber",isShow:false});this._dataStore.set_property("SetValidationErrors",{validateElement:"ContactZipCode",isShow:false});}}
Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobLibraryItemDetailAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter=function(element)
{Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter.initializeBase(this,[element]);this.createProperty("PostingID");this.createProperty("CJD_currentPage");}
Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this._dataStore.set_property("CommonPostingID",this.get_PostingID());this._dataStore.set_property("currentPage",this.get_CJD_currentPage());},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){default:break;}},onSuccess:function(result,userContext,methodName)
{if(userContext.processWebServiceErrorList(result))
return;},onFailure:function(result,userContext,methodName)
{}}
Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter.registerClass('Monster.Client.Behavior.JobPosting.CustomJobDescriptionAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.initializeBase(this,[element]);this.createProperty("SelectedVideoId");this.createProperty("RADIO_GROUP_NAME");this.createProperty("MSG_INVALID_URL");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("videoUrl");this.registerDataProperty("msgInvalidUrl");this._dataStore.set_property("msgInvalidUrl",this.MSG_INVALID_URL);this._webService=EBiz.Services.JPW.JobPostingOptionsService;Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context){if(context=="radio"){this.SelectedVideoId=element.value;var delegate=Function.createDelegate(this,this.OnVideoSelectionChange);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.OnVideoSelectionChange(event);}
else if(context=="preview"){var delegate=Function.createDelegate(this,this.OnPreviewClick);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.OnPreviewClick(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"videoUrl":case"msgInvalidUrl":break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"ValidateUrl":if(result){popWin=open(userContext._dataStore.get_property("videoUrl"),'Video','width=640,height=380,top='+((screen.height-600)/2)+',left='+((screen.width-800)/2)+',scrollbars=yes, resizable=yes');popWin.focus();}
else{alert(userContext._dataStore.get_property("msgInvalidUrl"));}
break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(userContext,'onSuccess',[result,userContext,methodName]);break;}},onFailure:function(result,userContext,methodName){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'onFailure',[result,userContext,methodName]);},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);if(newData!==null){var isSelected=false;var isDisabled=false;var selectionExist=false;for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsSelected){isSelected=currentData.Value.toLowerCase();}
if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsCheckboxDisabled){isDisabled=currentData.Value.toLowerCase();}}
var selectedEnhancements=this._dataStore.get_property("selectedEnhancements");for(var j=0;j<selectedEnhancements.length;j++){if(selectedEnhancements[j].EnhancementType==Presenters.JPW.DTO.EnhancementType.JobVideo.toString()){selectedEnhancements[j].IsSelected=currentData.Value.toLowerCase();selectionExist=true;}}
if(!selectionExist){var newSelectionEntry={EnhancementFields:[],EnhancementType:Presenters.JPW.DTO.EnhancementType.JobVideo.toString(),IsSelected:isSelected};selectedEnhancements.push(newSelectionEntry);}
this._dataStore.set_property("selectedEnhancements",selectedEnhancements);}},OnVideoSelectionChange:function(event){var list=document['forms']['aspnetForm'][this.RADIO_GROUP_NAME];var selectRadio;for(i=0;i<list.length;i++){if(list[i].checked==true){selectRadio=list[i].value;}}
var selectedEnhancements=this._dataStore.get_property("selectedEnhancements");if(typeof(selectedEnhancements)!="undefined"||selectedEnhancements!=null){for(var i=0;i<selectedEnhancements.length;i++){for(var j=0;j<selectedEnhancements[i].EnhancementFields.length;i++){var EnhancementType=selectedEnhancements[i].EnhancementFields[j].EnhancementFieldType;if(EnhancementType==Presenters.JPW.DTO.EnhancementFieldTypes.SelectedOptionValue){selectedEnhancements[i].EnhancementFields[j].Value=selectRadio;break;}}}}
this._dataStore.set_property("selectedEnhancements",selectedEnhancements);},OnPreviewClick:function(event){var _videoUrl=event.target.href;this._dataStore.set_property("videoUrl",_videoUrl);this.callServer("ValidateUrl",[_videoUrl]);event.stopPropagation();event.preventDefault();},getEnhancementData:function(){var retList=[];if(this.SelectedVideoId!=null)
retList.push({EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.SelectedOptionValue,Value:this.SelectedVideoId});return retList;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsVideoAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.OfccpInformationAdapter=function(element)
{Monster.Client.Behavior.JobPosting.OfccpInformationAdapter.initializeBase(this,[element]);this.createProperty("OFCCP_lblRemainingChars");this.createProperty("OFCCP_txtFolderRefCode");this.createProperty("OFCCP_txtDataManagementProtocol");this.createProperty("OFCCP_txtNewDmpEntry");this.createProperty("OFCCP_IsControlVisible");this.createProperty("OFCCP_IsDataManagementProtocolEditable");this.createProperty("OFCCP_IsDataManagementProtocolVisible");this.createProperty("OFCCP_IsFolderRefCodeEditable");this.createProperty("OFCCP_IsFolderRefCodeVisible");}
Monster.Client.Behavior.JobPosting.OfccpInformationAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.OfccpInformationAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
if(this.OFCCP_IsDataManagementProtocolVisible=="true"||this.OFCCP_IsDataManagementProtocolVisible=="True"){ofccpDetail.SetVisible(true);ofccpDetail.UpdateRemainingCharacters();}},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobDetailsService;this.registerDataProperty("GetOfccpInformationView");this.registerDataProperty("UberDetailsObject");},dispose:function(){if(MonsPageManager.initState(this._id)){}
Monster.Client.Behavior.JobPosting.OfccpInformationAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":var view=this.BuildOfccpInformationView();this._dataStore.set_property("GetOfccpInformationView",view);break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;},onFailure:function(result,userContext,methodName){},BuildOfccpInformationView:function(){if(this.OFCCP_IsControlVisible=="true"){var view=new Presenters.Ofccp.DTO.OfccpInformationView();if(this.OFCCP_IsFolderRefCodeEditable=="true")view.FolderRefCode=this.OFCCP_txtFolderRefCode.value;if(this.OFCCP_IsDataManagementProtocolEditable=="true")view.DataManagementProtocol=this.OFCCP_txtDataManagementProtocol.value
view.NewDmpEntry=this.OFCCP_txtNewDmpEntry.value
return view;}
return null;}}
Monster.Client.Behavior.JobPosting.OfccpInformationAdapter.registerClass('Monster.Client.Behavior.JobPosting.OfccpInformationAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter=function(element){Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter.initializeBase(this,[element]);this.cjfControls={};this.PostingOptionsBuilderFieldControls={};this.dp=Monster.BuilderFields.Entities.DisplayType;this.vt=Monster.EBiz.Web.ServerControls.BuilderFields.ValidationType;this._builderFieldAnswers=null;this._postingOptionsBuilderFieldAnswers=null;this.reqErrors=[];this.msgReqiredError=null;this.msgMaxLengthError=null;this.msgMinLengthError=null;this.msgInvalidDateError=null;}
Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter.callBaseMethod(this,'initialize');this.registerDataProperty("validateDetailsPage_request");this.registerDataProperty("LoadData");if(this.cjfControls.process){this.registerDataProperty("UberDetailsObject");delete this.cjfControls.process;}
if(this.PostingOptionsBuilderFieldControls.process){this.registerDataProperty("UberOptionsObject");delete this.PostingOptionsBuilderFieldControls.process;}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"UberDetailsObject":if(!this._builderFieldAnswers){this._builderFieldAnswers=this.createJobBuilderAnswersView();}
this._dataStore.set_property("GetBuilderFieldsView",this._builderFieldAnswers);break;case"UberOptionsObject":if(!this._postingOptionsBuilderFieldAnswers){this._postingOptionsBuilderFieldAnswers=this.createPostingOptionsBuilderAnswersView();}
this._dataStore.set_property("GetPostingOptionsBuilderFields",this._postingOptionsBuilderFieldAnswers);break;case"validateDetailsPage_request":this._builderFieldAnswers=this.createJobBuilderAnswersView();if(this._builderFieldAnswers){this._dataStore.set_property("ValidateCustomFields",true);}
else{this._dataStore.set_property("ValidateCustomFields",false);if(this.reqErrors.length){this._dataStore.set_property("DetailsRequiredErrorsCollector",this.reqErrors);this.reqErrors=[];}}
break;case"LoadData":result=this._dataStore.get_property("LoadData");if(result.JobBuildersData!=null){for(var i=0,l=result.JobBuildersData.length;i<l;i++){var answerData=result.JobBuildersData[i];this.setSelectedValues(answerData,this.cjfControls);this.setSelectedValues(answerData,this.PostingOptionsBuilderFieldControls);}}
break;default:break;}},createJobBuilderAnswersView:function(){var view=new Presenters.JPW.DTO.JobBuilderFieldsView();view.BuilderFieldAnswers=[];var validated=true;for(var cjfControlKey in this.cjfControls){var answerData=new Presenters.JPW.DTO.JobBuilderFieldAnswerData();if(validated){validated=this.getSelectedValues(cjfControlKey,answerData,this.cjfControls);}
else{this.getSelectedValues(cjfControlKey,answerData,this.cjfControls);}
view.BuilderFieldAnswers.push(answerData);}
if(validated){return view;}
return null;},createPostingOptionsBuilderAnswersView:function(){var view=new Presenters.JPW.DTO.JobBuilderFieldsView();view.BuilderFieldAnswers=[];var validated=true;for(var cjfControlKey in this.PostingOptionsBuilderFieldControls){var answerData=new Presenters.JPW.DTO.JobBuilderFieldAnswerData();if(validated){validated=this.getSelectedValues(cjfControlKey,answerData,this.PostingOptionsBuilderFieldControls);}
else{this.getSelectedValues(cjfControlKey,answerData,this.PostingOptionsBuilderFieldControls);}
view.BuilderFieldAnswers.push(answerData);}
if(validated){return view;}
return null;},setSelectedValues:function(answerData,controlCollection){if(!controlCollection)return;var cjfControlInfo=controlCollection[answerData.BuilderFieldId];var domHandle=$get(cjfControlInfo.DomHandle);switch(cjfControlInfo.DisplayType){case this.dp.Textbox:case this.dp.Hidden:domHandle.getElementsByTagName("INPUT")[0].value=answerData.AnswerText;break;case this.dp.Listbox:var length=answerData.ReferenceListItems.length;var list=domHandle.getElementsByTagName("SELECT")[0];if(!length){list.selectedIndex==-1;}
else{for(var i=0;i<length;i++){for(var j=0,k=list.options.length;j<k;j++){if(list.options[j].value==answerData.ReferenceListItems[i]){list.options[j].selected=true;break;}}}}
break;case this.dp.DropDown:var length=answerData.ReferenceListItems.length;var list=domHandle.getElementsByTagName("SELECT")[0];if(!length){list.selectedIndex==-1;}
else{for(var i=0,l=list.options.length;i<l;i++){if(list.options[i].value==answerData.ReferenceListItems[0]){list.options[i].selected=true;break;}}}
break;case this.dp.RadioButton:case this.dp.CheckBox:var length=answerData.ReferenceListItems.length;var elementArray=domHandle.getElementsByTagName("INPUT");for(var i=0;i<length;i++){for(var j=0,k=elementArray.length;j<k;j++){if(elementArray[j].value==answerData.ReferenceListItems[i]){elementArray[j].checked=true;break;}}}
break;case this.dp.Textarea:var shownValue=answerData.AnswerText.replace(/&lt;/g,'<')
shownValue=shownValue.replace(/&gt;/g,'>')
shownValue=shownValue.replace(/&amp;/g,'&');domHandle.getElementsByTagName("TEXTAREA")[0].value=shownValue;break;case this.dp.Text:var answerCtrl=$(domHandle).find(".job-info-inner-form-wrapper").find("span")[0];var hdnCtrl=$(domHandle).find(".job-info-inner-form-wrapper").find("input")[0];answerCtrl.innerHTML=answerData.AnswerText;hdnCtrl.value=answerData.ReferenceListItems[0];break;case this.dp.Date:var datePickerControl=domHandle.getElementsByTagName("INPUT")[0];var date=Date.parseInvariant(answerData.AnswerText);if(date){datePickerControl.value=$returnDateWithFormat(date);}
break;case this.dp.EditableRadioButton:break;case this.dp.Image:break;default:throw new Error("EBiz.Services.JPW.DisplayType value of "+cjfControlInfo.InputDisplayType+" is not supported");break;}},getSelectedValues:function(cjfControlID,answerData,controlCollection){if(!controlCollection)return;answerData.BuilderFieldId=cjfControlID;answerData.AnswerText="";var cjfControlInfo=controlCollection[cjfControlID];var domHandle=$get(cjfControlInfo.DomHandle);switch(cjfControlInfo.DisplayType){case this.dp.Textbox:case this.dp.Hidden:answerData.AnswerText=domHandle.getElementsByTagName("INPUT")[0].value;break;case this.dp.Listbox:var list=domHandle.getElementsByTagName("SELECT")[0];answerData.ReferenceListItems=[];if(list.selectedIndex==-1){answerData.AnswerText='';answerData.ReferenceListItems.push(-1);}
else{var length=list.options.length;for(var i=0;i<length;i++){if(list.options[i].selected){answerData.AnswerText+=list.options[i].text+'|';answerData.ReferenceListItems.push(list.options[i].value);}}}
break;case this.dp.DropDown:var list=domHandle.getElementsByTagName("SELECT")[0];answerData.ReferenceListItems=[];if(list.selectedIndex==-1){answerData.AnswerText='';answerData.ReferenceListItems.push(-1);}
else{answerData.AnswerText=list.options[list.selectedIndex].text;answerData.ReferenceListItems.push(list.options[list.selectedIndex].value);}
break;case this.dp.RadioButton:var radioArray=domHandle.getElementsByTagName("INPUT");var length=radioArray.length;if(length){answerData.ReferenceListItems=[];for(var i=0;i<length;i++){if(radioArray[i].checked){answerData.ReferenceListItems.push(radioArray[i].value);if(radioArray[i].nextSibling!=null){answerData.AnswerText=radioArray[i].nextSibling.innerHTML;}}}}
break;case this.dp.CheckBox:var checkBoxArray=domHandle.getElementsByTagName("INPUT");var length=checkBoxArray.length;if(length){answerData.ReferenceListItems=[];for(var i=0;i<length;i++){var checkBoxRef=checkBoxArray[i];if(checkBoxRef.checked==true){answerData.ReferenceListItems.push(checkBoxRef.value);var textNode=checkBoxRef.nextSibling;if(null!=textNode)answerData.AnswerText+=textNode.nodeValue+'|';}}}
break;case this.dp.Textarea:answerData.AnswerText=domHandle.getElementsByTagName("TEXTAREA")[0].value;break;case this.dp.Text:var answerCtrl=$(domHandle).find(".job-info-inner-form-wrapper").find("span")[0];var hdnCtrl=$(domHandle).find(".job-info-inner-form-wrapper").find("input")[0];answerData.AnswerText=answerCtrl.innerHTML;if(hdnCtrl.value){answerData.ReferenceListItems=[];answerData.ReferenceListItems.push(hdnCtrl.value);}
break;case this.dp.Date:var datePickerControl=domHandle.getElementsByTagName("INPUT")[0];var validateDate=function isValidDate(d){if(Object.prototype.toString.call(d)!=="[object Date]")return false;return!isNaN(d.getTime());};try{var _date=new Date(datePickerControl.value);if(!validateDate(_date)){throw"wrong value";};answerData.AnswerText=_date.format('MM/dd/yyyy');}
catch(e){if(!$getParsedDate(datePickerControl)){answerData.AnswerText="invaliddate";}}
break;case this.dp.EditableRadioButton:break;case this.dp.Image:break;default:throw new Error("EBiz.Services.JPW.DisplayType value of "+cjfControlInfo.InputDisplayType+" is not supported");break;}
return this.validateCJFControl(cjfControlInfo,answerData.AnswerText,domHandle);},validateCJFControl:function(cjfControlInfo,validationData,container){var result=true;if(!this._dataStore.get_property("ValidateJobSave")){for(var i=0,l=cjfControlInfo.Validate.length;i<l;i++){var rule=cjfControlInfo.Validate[i];switch(rule.type){case this.vt.Required:if(rule.value){if(!validationData){result=false;this.reqErrors.push(this.msgReqiredError.replace("%1",cjfControlInfo.Caption));}}
break;case this.vt.IsDate:if(rule.value){if(validationData=="invaliddate"){result=false;this.reqErrors.push(this.msgInvalidDateError.replace("%1",cjfControlInfo.Caption));}}
break;case this.vt.MaxLength:if(validationData.length>parseInt(rule.value)){result=false;this.reqErrors.push(this.msgMaxLengthError.replace("%1",cjfControlInfo.Caption).replace("%2",rule.value));}
break;case this.vt.RegEx:var pattern=new RegExp(rule.value);if(!pattern.test(validationData)){result=false;this.reqErrors.push(rule.message);}
break;}}
this.ShowError(!result,container,cjfControlInfo.labelId,cjfControlInfo.iconId);}
return result;},ShowError:function(isShow,container,labelId,iconId){var labelTag=labelId?$get(labelId,container):null;var iconTag=iconId?$get(iconId,container):null;if(labelTag){isShow!=true?labelTag.style.color='#000000':labelTag.style.color='#CC0000';}
if(iconTag){isShow!=true?iconTag.style.display='none':iconTag.style.display='inline';}}}
Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobDetailsBuilderFieldsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.initializeBase(this,[element]);this._delegates=[];this.createProperty("GridJobBoards");this.createProperty("JobBoardsRoundedCorner");this.createProperty("RNHelp");this.createProperty("EncryptedPostingId");this.createProperty("HelpChannelConfig");this._IsJobBoardGroupControlVisible=false;this._SelectedJobBoardGroupAlias;this._folder=null;this._JobBoardGroupList=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.callBaseMethod(this,'initialize');this.JobBoardsRoundedCorner.style.display="none";if(this.RNHelp){if(this.HelpChannelConfig=="True"){this.RNHelp.style.display="block";}
else{this.RNHelp.style.display="none";}}
if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this.registerDataProperty("GetJobBoardGroupAlias");},initOnDemand:function(){this.registerDataProperty("OPTIONS_JobBoardGroupData");this.registerDataProperty("OPTIONS_ErroDatas");this.registerDataProperty("CommonPostingID");this.registerDataProperty("OPTIONS_FolderId");this.registerDataProperty("initCAN");this._dataStore.set_property("GetJobBoardGroupAlias",this._SelectedJobBoardGroupAlias);this._webService=EBiz.Services.JPW.JobDetailsService;},initHandlers:function(element,event,context){if(context=="radio"){this._SelectedJobBoardGroupAlias=element.value;var delegate=Function.createDelegate(this,this.OnBoardGroupSelectionChange);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.OnBoardGroupSelectionChange(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.callBaseMethod(this,'dispose');},loadIntialValues:function(){var result=this._dataStore.get_property("OPTIONS_JobBoardGroupData");this._IsJobBoardGroupControlVisible=result.IsJobBoardGroupControlVisible;this._SelectedJobBoardGroupAlias=result.SelectedJobBoardGroupAliasKey;this._JobBoardGroupList=result.JobBoardGroupList;if(this._IsJobBoardGroupControlVisible){this.JobBoardsRoundedCorner.style.display="block";this.intializeGridControl(this._JobBoardGroupList);}
else{this.JobBoardsRoundedCorner.style.display="none";}},intializeGridControl:function(jobBoardGroupList){if(jobBoardGroupList!=null){this.addItemToGrid(jobBoardGroupList);}},addItemToGrid:function(jobBoardGroupList){var gridJobBoardsContainer=$("#GridJobBoardsContainer");if(gridJobBoardsContainer&&gridJobBoardsContainer.length==1){var newtable=document.createElement("table");var newtbody=document.createElement("tbody");var newtr,rowItem_BoardAliasValue,rowItem_BoardAliasName,rowItem_BoardAliasName,chkFlagged,radioButtonCell,boardDesc;for(var i=0;i<jobBoardGroupList.length;i++){rowItem_BoardAliasValue=jobBoardGroupList[i].Value;rowItem_BoardAliasName=jobBoardGroupList[i].Text;chkFlagged=false;if(rowItem_BoardAliasValue==this._SelectedJobBoardGroupAlias)
chkFlagged=true;newtr=document.createElement('tr');radioButtonCell=document.createElement('td');radioButtonCell.className="radioButton";if(chkFlagged){radioButtonCell.innerHTML="<input type='radio' name='cbxUseBoard'  value='"+rowItem_BoardAliasValue+"' checked='"+chkFlagged+"' onclick=\"initClick(this, event, [{adapterID: '"+this.get_id()+"', context:'radio'}]);\" />";}
else{radioButtonCell.innerHTML="<input type='radio' name='cbxUseBoard'  value='"+rowItem_BoardAliasValue+"' onclick=\"initClick(this, event, [{adapterID: '"+this.get_id()+"', context:'radio'}]);\" />";}
newtr.appendChild(radioButtonCell);boardDesc=document.createElement('td');boardDesc.className="actionLinks";boardDesc.innerHTML="<span>"+rowItem_BoardAliasName+"</span>";newtr.appendChild(boardDesc);newtbody.appendChild(newtr);}
newtable.appendChild(newtbody);if(gridJobBoardsContainer[0].childNodes.length>0){gridJobBoardsContainer[0].removeChild(gridJobBoardsContainer[0].lastChild);}
gridJobBoardsContainer[0].appendChild(newtable);}},OnBoardGroupSelectionChange:function(event){var list=document['forms']['aspnetForm']['cbxUseBoard'];for(i=0;i<list.length;i++){if(list[i].checked==true){this._SelectedJobBoardGroupAlias=list[i].value;}}
this._dataStore.set_property("GetJobBoardGroupAlias",this._SelectedJobBoardGroupAlias);},changeCANSettings:function(){if(this._SelectedJobBoardGroupAlias!=undefined){var jbSelections=this._SelectedJobBoardGroupAlias;if(jbSelections.length<3)
return;var isMons=false;var isVets=false;var l=jbSelections.length;var boards=jbSelections.substring(1,l-1);var listBoards=boards.split("|");if(listBoards.length<1)
return;for(var i=0;i<listBoards.length;i++){if(listBoards[i]=="1"){isMons=true;}
if(listBoards[i]=="6965"){isVets=true;}}
if(isMons&&isVets){this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.CareerAdNetwork,Value:true});this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.VetsCareerAdNetwork,Value:true});}
else if(isMons){this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.CareerAdNetwork,Value:true});this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.VetsCareerAdNetwork,Value:false});}
else if(isVets){this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.CareerAdNetwork,Value:false});this._dataStore.set_property("modifyCANBoard",{Id:Presenters.JPW.DTO.EnhancementType.VetsCareerAdNetwork,Value:true});}}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_JobBoardGroupData":this.loadIntialValues();this._dataStore.set_property("GetJobBoardGroupAlias",this._SelectedJobBoardGroupAlias);break;case"GetJobBoardGroupAlias":this._webService=EBiz.Services.JPW.JobPostingOptionsService;var jobBoardGroupAlias=this._dataStore.get_property("GetJobBoardGroupAlias");this._dataStore.set_property("CommonPostingID",this.get_EncryptedPostingId());var pid=this._dataStore.get_property("CommonPostingID");if(pid!=null&&jobBoardGroupAlias!=null){this.callServer("upsjbgf",[pid,this._folder,jobBoardGroupAlias]);}
break;case"OPTIONS_FolderId":this._folder=this._dataStore.get_property("OPTIONS_FolderId")*1;break;case"OPTIONS_ErroDatas":break;case"CommonPostingID":break;case"initCAN":this.changeCANSettings();break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){case"upsjbgf":this._webService=EBiz.Services.JPW.JobDetailsService;userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result.PostingSummaryData);userContext.changeCANSettings();break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"upsjbgf":this._webService=EBiz.Services.JPW.JobDetailsService;break;default:break;}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsJobBoardsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.initializeBase(this,[element]);this._delegates=[];this.createProperty("ToolsRoundedCorner");this.createProperty("cbScreening");this.createProperty("cbLetters");this._IsToolsControlVisible=false;this._IsScreeningSelected=false;this._IsAutoReplyLetterSelected=false;}
Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this.registerDataProperty("GetScreeningSelection");this.registerDataProperty("GetAutoReplyLetterSelection");this.registerDataProperty("GetContactView");},initOnDemand:function(){this.registerDataProperty("OPTIONS_FreeToolsData");this.registerDataProperty("CommonPostingID");this._dataStore.set_property("GetScreeningSelection",this._IsScreeningSelected);this._dataStore.set_property("GetAutoReplyLetterSelection",this._IsAutoReplyLetterSelected);this._webService=EBiz.Services.JPW.JobDetailsService;},initHandlers:function(element,event,context){if(context=="cbScreening"||context=="cbLetters"){var delegate=Function.createDelegate(this,this.onCheckboxClicked);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onCheckboxClicked(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}},onCheckboxClicked:function(event){if(event.target.id.endsWith("cbScreening")){this._IsScreeningSelected=event.target.checked;this._dataStore.set_property("GetScreeningSelection",this._IsScreeningSelected);if(this._IsScreeningSelected){this.cbLetters.disabled=true;}
else{this.cbLetters.disabled=false;}}
else if(event.target.id.endsWith("cbLetters")){this._IsAutoReplyLetterSelected=event.target.checked;this._dataStore.set_property("GetAutoReplyLetterSelection",this._IsAutoReplyLetterSelected);}
event.stopPropagation();},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.callBaseMethod(this,'dispose');},loadIntialValues:function(){var result=this._dataStore.get_property("OPTIONS_FreeToolsData");this._dataStore.set_property("BuildContactView",true);var contactInfo=false;contactInfo=this._dataStore.get_property("GetContactView");if(contactInfo!=null&&contactInfo.AllowApplyOnline!=null){this._IsToolsControlVisible=result.IsFreeToolsControlVisible&&contactInfo.AllowApplyOnline;}
if(this._IsToolsControlVisible){this.ToolsRoundedCorner.style.display="block";}
else{this.ToolsRoundedCorner.style.display="none";this._IsScreeningSelected=false;this._IsAutoReplyLetterSelected=false;}
if(this._IsScreeningSelected){this.cbScreening.checked=true;}
else{this.cbScreening.checked=false;}
if(this._IsAutoReplyLetterSelected){this.cbLetters.checked=true;}
else{this.cbLetters.checked=false;}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_FreeToolsData":this.loadIntialValues();break;case"CommonPostingID":break;default:break;}},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))
return;switch(methodName){default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){default:break;}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsToolsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace("Monster.Client.Behavior");Monster.Client.Behavior.JobPosting.BuilderFieldImageListAdapter=function(element){Monster.Client.Behavior.JobPosting.BuilderFieldImageListAdapter.initializeBase(this,[element]);this.selectedImageID=null;this._images=[];this._defaultImageID=null;this._selectedImageIndex=null;this._changeImageButton=null;this._cancelButton=null;this._selectButton=null;this._imageListUL=null;this._imageListLayer=null;this._leftPaddle=null;this._rightPaddle=null;this._displayImage=null;}
Monster.Client.Behavior.JobPosting.BuilderFieldImageListAdapter.prototype={THUMBNAIL_WIDTH:107,SELECTED_THUMBNAIL_WIDTH:233,CAROUSEL_HEIGHT:124,initOnDemand:function(){var container=$(this.get_element());this._displayImage=container.find("#DisplayImage")[0];this._imageListUL=container.find("#ImageList")[0];this._imageListLayer=container.find("#ImageListLayer")[0];debugger;this._selectedImageIndex=this.FindSelectedImageIndexByID(this.selectedImageID);},get_Images:function(){if(this._images.length===0){var listItems=this._imageListUL.getElementsByTagName("LI");for(var i=0,l=listItems.length;i<l;i++){this._images[this._images.length]=listItems[i].firstChild.firstChild;}}
return this._images;},FindSelectedImageIndexByID:function(imgID){var imgList=this.get_Images();for(var i=0,l=imgList.length;i<l;i++){if(imgList[i].alt===imgID){return i;}}
return null;},FindSelectedImageIDByIndex:function(idx){var imgList=this.get_Images();return imgList[idx].alt;},ShowThumbnail:function(imgElement,isSelected,leftOffset){var listItemElement=imgElement.parentNode.parentNode;imgElement.width=(isSelected)?this.SELECTED_THUMBNAIL_WIDTH:this.THUMBNAIL_WIDTH;listItemElement.style.top=Math.floor((this.CAROUSEL_HEIGHT-imgElement.height)/2)+"px";listItemElement.style.left=leftOffset+"px";if(isSelected){listItemElement.style.opacity=1;if(imgElement.filters)imgElement.filters.alpha.opacity=100;}else{listItemElement.style.opacity=0.6;if(imgElement.filters)imgElement.filters.alpha.opacity=60;}
listItemElement.style.visibility="visible";},ResetAllThumbnails:function(){var imgList=this.get_Images();for(var i=0,l=imgList.length;i<l;i++){var tempLI=imgList[i].parentNode.parentNode;tempLI.style.visibility="hidden";}},RenderCarousel:function(){var imgList;var selIdx,preIdx,postIdx;imgList=this.get_Images();selIdx=this._selectedImageIndex;preIdx=(selIdx-1<0)?imgList.length-1:selIdx-1;postIdx=(selIdx+1===imgList.length)?0:selIdx+1;this.ResetAllThumbnails();this.ShowThumbnail(imgList[preIdx],false,6);this.ShowThumbnail(imgList[selIdx],true,(6+this.THUMBNAIL_WIDTH+8));this.ShowThumbnail(imgList[postIdx],false,(6+this.THUMBNAIL_WIDTH+8+this.SELECTED_THUMBNAIL_WIDTH+8));},UpdateSelectedImage:function(evt){evt.preventDefault();this.selectedImageID=evt.target.alt;this._selectedImageIndex=this.FindSelectedImageIndexByID(evt.target.alt);this.RenderCarousel();},RotateLeft:function(element,event){event.preventDefault();element.blur();var imgList=this.get_Images();var newIdx=(this._selectedImageIndex+1===imgList.length)?0:this._selectedImageIndex+1;var newImgId=this.FindSelectedImageIDByIndex(newIdx);this.selectedImageID=newImgId;this._selectedImageIndex=newIdx;this.RenderCarousel();},RotateRight:function(element,event){event.preventDefault();element.blur();var imgList=this.get_Images();var newIdx=(this._selectedImageIndex-1<0)?imgList.length-1:this._selectedImageIndex-1;var newImgId=this.FindSelectedImageIDByIndex(newIdx);this.selectedImageID=newImgId;this._selectedImageIndex=newIdx;this.RenderCarousel();},OpenImageList:function(element,event){event.preventDefault();element.blur();if(!this._changeImageButton){this._changeImageButton=element;this.initOnDemand();}
this._imageListLayer.style.visibility="visible";this.RenderCarousel();},CloseImageList:function(element,event,context){event.preventDefault();switch(context){case"cancel":this._cancelButton=element;this.selectedImageID=this._defaultImageID;this._selectedImageIndex=this.FindSelectedImageIndexByID(this._defaultImageID);break;case"select":this._selectButton=element;this._defaultImageID=this.selectedImageID;this._displayImage.src=this.get_Images()[this._selectedImageIndex].src;break;default:break;}
this.ResetAllThumbnails();this._imageListLayer.style.visibility="hidden";}}
Monster.Client.Behavior.JobPosting.BuilderFieldImageListAdapter.registerClass("Monster.Client.Behavior.JobPosting.BuilderFieldImageListAdapter",Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=="undefined")Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter=function(element){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.initializeBase(this,[element]);this.createProperty("chkApplyScoring");this.createProperty("rbSingleScore");this.createProperty("rbReScore");this.createProperty("divRadios");this.createProperty("candidateSkillsSection");this.createProperty("applicantMatching_jobTitle");this.createProperty("applicantMatching_keyword1");this.createProperty("applicantMatching_keyword2");this.createProperty("applicantMatching_keyword3");this.createProperty("applicantMatching_keyword4");this.createProperty("applicantMatching_keyword5");this.createProperty("error_RequiredSkill");this.createProperty("error_SkillBoolean");this.createProperty("error_JobTitleBoolean");this.createProperty("regexBoolCheck");this._delegates=[];this._scoringType=Presenters.JPW.DTO.ApplyScoringType.Invalid;this._candidateSkillsSectionVisibility=null;this._isVisible=false;this._inputboxBlured=new Date();}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this.registerDataProperty("validateOptionsPage_request");},initOnDemand:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.callBaseMethod(this,'initOnDemand');},initHandlers:function(element,event,context){if(context=="rbSingleScore"||context=="rbReScore"){var delegate=Function.createDelegate(this,this.onApplyScoringTypeChanged);$addHandler(element,"click",delegate);this._delegates.push([element,"click",delegate]);if(!$isIE())
this.onApplyScoringTypeChanged(event);}
else{Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.callBaseMethod(this,'initHandlers',[element,event,context]);}
switch(element.id){case this.applicantMatching_jobTitle.id:case this.applicantMatching_keyword1.id:case this.applicantMatching_keyword2.id:case this.applicantMatching_keyword3.id:case this.applicantMatching_keyword4.id:case this.applicantMatching_keyword5.id:if($.fn.mautocomplete){$.fn.mautocomplete.lazyLoadById(element.id);}
element.onfocus="";var blurDelegate=Function.createDelegate(this,this.inputBoxBlurEvent);$addHandler(element,"blur",blurDelegate);this._delegates.push([element,"blur",blurDelegate]);var acResultDelegate=Function.createDelegate(this,this.acResultDelegate);$("#"+element.id).bind("result",acResultDelegate);this._delegates.push([element,"result",acResultDelegate]);break;case this.chkApplyScoring.id:this.chkApplyScoringEvent(event);var chkApplyScoringDelegate=Function.createDelegate(this,this.chkApplyScoringEvent);$("#"+element.id).bind("click",chkApplyScoringDelegate);this._delegates.push([element,"click",chkApplyScoringDelegate]);break;}},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter.callBaseMethod(this,'dispose');},updateEnhancementSpecificData:function(newData){Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.callBaseMethod(this,'updateEnhancementSpecificData',[newData]);this._scoringType=Presenters.JPW.DTO.ApplyScoringType.Invalid;var selectionVisible=null;if(newData!==null){for(var i=0;i<newData.length;i++){var currentData=newData[i];if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.ApplyScoringType){this._scoringType=currentData.Value;continue;}
if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.ApplyScoringTypeSelectionVisible){selectionVisible=currentData.Value=="True";continue;}
if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsVisible){this._isVisible=currentData.Value=="True";continue;}
if(currentData.EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.ApplyScoringData){var currentDataDecoded=decodeURIComponent(currentData.Value);var jobTitle=/jt=([^&]*)(&|$)/.exec(currentDataDecoded);jobTitle=decodeURIComponent(jobTitle?jobTitle[1]:"");var skills=/sk=([^&]*)(&|$)/.exec(currentDataDecoded);if(skills){skills=decodeURIComponent(skills[1]).split(",");this.applicantMatching_jobTitle.value=jobTitle?jobTitle:"";this.applicantMatching_keyword1.value=(skills[0]?skills[0].substring(0,skills[0].length-4):"");this.applicantMatching_keyword2.value=(skills[1]?skills[1].substring(0,skills[1].length-4):"");this.applicantMatching_keyword3.value=(skills[2]?skills[2].substring(0,skills[2].length-4):"");this.applicantMatching_keyword4.value=(skills[3]?skills[3].substring(0,skills[3].length-4):"");this.applicantMatching_keyword5.value=(skills[4]?skills[4].substring(0,skills[4].length-4):"");var view=new Presenters.SmartFindIII.Views.SmartFindFilterView;view.JobTitle=jobTitle;view.Skills=skills.join(";");}
else{skills="";}
continue;}}}
if(this._scoringType==Presenters.JPW.DTO.ApplyScoringType.SingleScore){this.rbSingleScore.checked=true;}
else if(this._scoringType==Presenters.JPW.DTO.ApplyScoringType.ReScore){this.rbReScore.checked=true;}
if(this.chkApplyScoring.disabled){this.chkApplyScoring.disabled=false;this.rbSingleScore.disabled=true;this.rbReScore.disabled=true;}
if(selectionVisible!=null){this.divRadios.style.display=selectionVisible?"block":"none";}
this.updateCandidateSkillsVisibility();},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"validateOptionsPage_request":this._SaveTalentMachData();this._dataStore.set_property("validateOptionsPage_results",this._validateApplicantScoringData());break;default:Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.callBaseMethod(this,'onDataStoreEvent',[sender,args]);break;}},onCheckboxClickedNotification:function(event){this.updateCandidateSkillsVisibility();},chkApplyScoringEvent:function(event){var tempDate=new Date();if(tempDate.getSeconds()==this._inputboxBlured.getSeconds()&&tempDate.getMinutes()==this._inputboxBlured.getMinutes()&&tempDate.getHours()==this._inputboxBlured.getHours())
event.preventDefault();},onApplyScoringTypeChanged:function(event){this._scoringType=this.rbSingleScore.checked?Presenters.JPW.DTO.ApplyScoringType.SingleScore:Presenters.JPW.DTO.ApplyScoringType.ReScore;this.updateEnhancementValue();},inputBoxBlurEvent:function(event){if(this.applicantMatching_jobTitle&&this.applicantMatching_jobTitle.value.length>0||this.applicantMatching_keyword1&&this.applicantMatching_keyword1.value.length>0||this.applicantMatching_keyword2&&this.applicantMatching_keyword2.value.length>0||this.applicantMatching_keyword3&&this.applicantMatching_keyword3.value.length>0||this.applicantMatching_keyword4&&this.applicantMatching_keyword4.value.length>0||this.applicantMatching_keyword5&&this.applicantMatching_keyword5.value.length>0){if(this.chkApplyScoring.checked==false){this.chkApplyScoring.checked=true;this.updateCandidateSkillsVisibility();this.updateEnhancementValue(true);this._inputboxBlured=new Date();}}
this._SaveTalentMachData();},acResultDelegate:function(event){var inputBoxTarget=$("#"+event.target.id);inputBoxTarget.data("acData",inputBoxTarget.val());},updateCandidateSkillsVisibility:function(){if(this.candidateSkillsSection){if(this.chkApplyScoring.checked){this._candidateSkillsSectionVisibility=this.candidateSkillsSection.style.display;this.candidateSkillsSection.style.display="none";}
else{if(this._candidateSkillsSectionVisibility!=null){this.candidateSkillsSection.style.display=this._candidateSkillsSectionVisibility;}}}},getEnhancementData:function(){return[{EnhancementFieldType:Presenters.JPW.DTO.EnhancementFieldTypes.ApplyScoringType,Value:this._scoringType}];},initValidator:function(element,args){var targetElement=args[1];var targetElementValue=targetElement.value;var acData=$("#"+targetElement.id).data("acData");var removedACData=targetElementValue.replace(acData,"").toLowerCase();if(element._HasBooleanContent(removedACData)){var bounds=Sys.UI.DomElement.getBounds(targetElement);var errorDiv=$("#validator-popup").show();Sys.UI.DomElement.setLocation(errorDiv[0],bounds.x+240,bounds.y);targetElement.errorFlyout=errorDiv[0];if(targetElement==element.applicantMatching_jobTitle)
errorDiv.find("#popText").text(element.error_JobTitleBoolean);else
errorDiv.find("#popText").text(element.error_SkillBoolean);}},_SaveTalentMachData:function(){var view=new Presenters.SmartFindIII.Views.SmartFindFilterView;view.JobTitle=encodeURIComponent(this.applicantMatching_jobTitle?this.applicantMatching_jobTitle.value:"");view.Enabled=this.chkApplyScoring.checked;view.Skills=((this.applicantMatching_keyword1&&this.applicantMatching_keyword1.value.length>0)?encodeURIComponent(this.applicantMatching_keyword1.value)+" nth,":"")+
((this.applicantMatching_keyword2&&this.applicantMatching_keyword2.value.length>0)?encodeURIComponent(this.applicantMatching_keyword2.value)+" nth,":"")+
((this.applicantMatching_keyword3&&this.applicantMatching_keyword3.value.length>0)?encodeURIComponent(this.applicantMatching_keyword3.value)+" nth,":"")+
((this.applicantMatching_keyword4&&this.applicantMatching_keyword4.value.length>0)?encodeURIComponent(this.applicantMatching_keyword4.value)+" nth,":"")+
((this.applicantMatching_keyword5&&this.applicantMatching_keyword5.value.length>0)?encodeURIComponent(this.applicantMatching_keyword5.value)+" nth":"");this._dataStore.set_property("ApplyScoringData",view);},_HasBooleanContent:function(field){field=" "+field+" ";var regExp=new RegExp(this.regexBoolCheck,"i");var result=field.search(regExp);if(result!==null&&result!==-1){return true;}else{return false;}},_validateApplicantScoringData:function(){if(!this._isVisible){return true;}
var returnValue=false;if(this.chkApplyScoring&&this.chkApplyScoring.checked==false){returnValue=true;}else if(this.chkApplyScoring&&this.chkApplyScoring.checked==true&&this.applicantMatching_keyword1&&this.applicantMatching_keyword1.value.trim()!==""){returnValue=true;}else{returnValue=false;}
if(returnValue==false){this._dataStore.set_property("ErrorSummaryDisplay_AddError",this.error_RequiredSkill);}
return returnValue;}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsApplyScoringAdapter',Monster.Client.Behavior.JobPosting.JobPostingOptionsEnhancementsBaseAdapter);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter=function(element)
{Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter.initializeBase(this,[element]);this.createProperty("applyScoringBody");this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("OPTIONS_defaultEnhancementData");},initHandlers:function(element,event,context){},dispose:function(){if(MonsPageManager.initState(this._id)){for(var i=0;i<this._delegates.length;i++){var del=this._delegates[i];$removeHandler(del[0],del[1],del[2]);delete del[2];}
this._delegates=[];}
Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultEnhancementData":var result=this._dataStore.get_property("OPTIONS_defaultEnhancementData");if(result!=null){var visible=false;for(var i=0;i<result.length;++i){if(result[i].EnhancementType==Presenters.JPW.DTO.EnhancementType.ApplyScoring){for(var j=0;j<result[i].EnhancementFields.length;++j){if(result[i].EnhancementFields[j].EnhancementFieldType==Presenters.JPW.DTO.EnhancementFieldTypes.IsVisible){visible=result[i].EnhancementFields[j].Value=="True";break;}}
break;}}
this.applyScoringBody.style.display=visible?"block":"none";}
break;default:break;}}}
Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter.registerClass('Monster.Client.Behavior.JobPosting.JobPostingOptionsApplyScoringAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter=function(element){Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter.initializeBase(this,[element]);this._tableTypes=["region","occupation"];this._regionCache={};this._categoryCache={};this._countryLookUp={};this._abvLookUp={};this._occLimit={};this._categoryBaseSelector="li#{0}";this._browseListUrl="JobLocationCategoriesBrowser.aspx?type={0}";this._updateSummary=false;this._isWorkatHome=false;this._isAreaWide=false;this._isGeo=true;this._activeDateChangeDelegate=null;this._modal=null;this._modalRegions=null;this._locationendPoint="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/sl";this._occupationendPoint="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/spf";this._specialOccn="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/spg";this._regionsPage="http://{0}/jpw/jobs/regions.aspx";this._folder=null;this._customExpChk=null;this._expiryWrapper=null;this._isExpEnabled=false;this.createProperty("encryptedPostingId");this.createProperty("costMessages");this.createProperty("isWFH");this.createProperty("isAWI");this.createProperty("dateActive");this.createProperty("dateExpiry");this.createProperty("localFormat");this.createProperty("plgID");this.createProperty("isSJAD");this.createProperty("isExpEnabled");this.createProperty("UIMessages");this.createProperty("headerMessages");this.createProperty("occupationMsg");this.createProperty("isGovt");this.createProperty("locExample");this.createProperty("catExample");this.createProperty("isLGRAN");this.createProperty("isGeo");this.createProperty("occpnCount");this.createProperty("catAWILimit");this.createProperty("isOccupationSectionHidden");}
Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("OPTIONS_defaultQuickLocations");this.registerDataProperty("OPTIONS_defaultCategoryGlobalData");this.registerDataProperty("OPTIONS_defaultSummaryData");this.registerDataProperty("selectedCategories");this.registerDataProperty("selectedLocations");this.registerDataProperty("UpdatePostingDate");this.registerDataProperty("OPTIONS_updateOcpnLimit");this.registerDataProperty("OPTIONS_FolderId");this.registerDataProperty("OPTIONS_defaultActiveDate");this.registerDataProperty("OPTIONS_defaultExpiryDate");this.registerDataProperty("OPTIONS_defaultCustomExpiry");this.registerDataProperty("OPTIONS_isFrFlagged");this._webService=EBiz.Services.JPW.JobPostingOptionsService;this._isWorkatHome=(this.isWFH=="True");this._isAreaWide=(this.isAWI=="True");this._isGeo=(this.isGeo=="true");if(this._isGeo){$addHandlers($get('btnAddRegion'),{click:this.addSelectedRegion},this);$addHandlers($get('btnAddAnotherRegion'),{click:this.showRegionsAddLayer},this);$addHandlers($get('blistRegion'),{click:this.launchBrowseList},{instance:this,value:{type:this._tableTypes[0],index:null}});}
else{$addHandlers($get('btnAddAnotherRegion'),{click:this.launchBrowseList},{instance:this,value:{type:this._tableTypes[0],index:null}});}
this._locationendPoint=String.format(this._locationendPoint,window.location.hostname);this._regionsPage=String.format(this._regionsPage,window.location.hostname);if(this._isAreaWide||this.isLGRAN=="true"){this._occupationendPoint=String.format(this._specialOccn,window.location.hostname);}
else{this._occupationendPoint=String.format(this._occupationendPoint,window.location.hostname);}
if(this.occpnCount){this._occLimit["0"]=this.occpnCount;}
DATE_FORMAT_MONS=this.localFormat;},initHandlers:function(element,event,context){event.preventDefault();},activeDateChange:function(sender,args){if(this.dateActive!=null){this._dataStore.set_property("OPTIONS_PostingActiveDate",$getUTCFromLocalDate_j($getParsedDate(this.dateActive)));}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultQuickLocations":var locationData=this._dataStore.get_property("OPTIONS_defaultQuickLocations");var summaryInfo=this._dataStore.get_property("OPTIONS_defaultSummaryData");this._regionCache={};this._categoryCache={};if(locationData!=null&&locationData!=""&&locationData!=[]){this.generateRegionCache(locationData);this.modifyRegions(summaryInfo.LocationSummaryDetails);this.fillRegions();this.hideRegionPicker(true);$('#regionHolder').show();}
else{this.hideRegionPicker(false);$('#regionHolder').hide();}
this._updateSummary=false;this._dataStore.set_property("selectedLocations",this._regionCache);if(this.dateActive){$.datepicker._attachDatepicker(this.dateActive,{dateFormat:this.localFormat});}
if(this.dateExpiry){$.datepicker._attachDatepicker(this.dateExpiry,{dateFormat:this.localFormat});}
if(this.isSJAD=="True"){$('#divPostingDate').show();}
else{$('#divPostingDate').hide();}
var payload_ac={q:"",plg:this.plgID*1};$('div.regionPicker > input').mautocomplete({"getDataEndpoint":this._locationendPoint,"isCustomEndPoint":true,"customData":payload_ac,"customQf":"q","pgContext":"Job+Posting+Options","ctrlType":"Posting+Options:Search+Location:Type+Ahead"});$('div.regionPicker > input').bind("result",this.AutoCompleteResult);$('div.regionPicker > input').bind("focus",this.ClearInput);$('div.regionPicker > input').bind("blur",this.AddWaterMark);var wMarkData={m:this.locExample,type:"loc"};jQuery.data($('div.regionPicker > input')[0],"WaterMark",wMarkData);this.setDateAccess();break;case"OPTIONS_defaultCategoryGlobalData":var catData=this._dataStore.get_property("OPTIONS_defaultCategoryGlobalData");var catselector=String.format(this._categoryBaseSelector,"cat1");if(catData!=null){this.generateCategoryCache(catData);this.fillOccupations();this.hideCategoryPicker(true,catselector);$(catselector+"> div#catRight > #categoryHolder").show();}
else{var cnt=this.getPropertyCount(this._regionCache);var listLi=$('ol.searchOrderedList').children();if(listLi.length>1){$('ol.searchOrderedList').children('li').not(':first-child').remove();}
if(cnt==0){}
else{var cnt=0;for(var p in this._regionCache){cnt=this._regionCache[p].cid;this._categoryCache[cnt]={countryid:cnt,Categories:{}};var tempLI=this.buildCategoriesMarkUp(1,cnt);$('ol.searchOrderedList').append(tempLI);this.hideCategoryPicker(false,catselector);$(catselector+"> div#catRight > #categoryHolder").hide();}}}
this._updateSummary=false;this._dataStore.set_property("selectedCategories",this._categoryCache);break;case"selectedCategories":if(this._updateSummary){var catStore=this._dataStore.get_property("selectedCategories");selCountryOccupations=[];for(var countryid in catStore){var newOccupation=[];for(var categoryid in catStore[countryid].Categories){for(var occupationid in catStore[countryid].Categories[categoryid].Occupations){var coOccItem={Category:catStore[countryid].Categories[categoryid].catid,Occupation:catStore[countryid].Categories[categoryid].Occupations[occupationid].occid};newOccupation.push(coOccItem);}}
var coitem={CountryId:catStore[countryid].countryid,Occupations:newOccupation};selCountryOccupations.push(coitem);}
this.callServer("upsocpnsf",[this.encryptedPostingId,this._folder,selCountryOccupations]);}
break;case"selectedLocations":if(this._updateSummary){var selectedLocationsMap=this._dataStore.get_property("selectedLocations");selLocations=[];if(selectedLocationsMap!=null){for(var currentLocation in selectedLocationsMap){selLocations.push(currentLocation*1);}}
this.callServer("upslidsf",[this.encryptedPostingId,this._folder,selLocations]);}
break;case"OPTIONS_updateOcpnLimit":var limitDict=this._dataStore.get_property("OPTIONS_updateOcpnLimit");for(var i=0;i<limitDict.length;i++){var limitData=limitDict[i];if(limitData[0]in this._occLimit){}
else{this._occLimit[limitData[0]]=limitData[1];}}
this.fillOccupations();break;case"UpdatePostingDate":this._dataStore.set_property("OPTIONS_PostingActiveDate",$getUTCFromLocalDate_j($getParsedDate(this.dateActive)));this._dataStore.set_property("OPTIONS_PostingExpiryDate",$getUTCFromLocalDate_j($getParsedDate(this.dateExpiry)));if(this._isExpEnabled){this._dataStore.set_property("OPTIONS_IsCustomExpiry",this._customExpChk.checked);}
else{this._dataStore.set_property("OPTIONS_IsCustomExpiry",false);}
break;case"OPTIONS_FolderId":this._folder=this._dataStore.get_property("OPTIONS_FolderId")*1;break;case"OPTIONS_defaultActiveDate":var dt_active=this._dataStore.get_property("OPTIONS_defaultActiveDate");if(dt_active)
this.dateActive.value=$returnDateWithFormat($getLocalFromUTCDate_j(dt_active));break;case"OPTIONS_defaultExpiryDate":var dt_expiry=this._dataStore.get_property("OPTIONS_defaultExpiryDate");if(dt_expiry)
this.dateExpiry.value=$returnDateWithFormat($getLocalFromUTCDate_j(dt_expiry));break;case"OPTIONS_defaultCustomExpiry":var customExp=this._dataStore.get_property("OPTIONS_defaultCustomExpiry");this._customExpChk=$get('chkCustomExpiry');this._expiryWrapper=$get('chkExpiryWrapper');this._isExpEnabled=null;for(var i=0;i<customExp.length;i++){switch(i){case 0:this._expiryWrapper.style.display=(customExp[0]==true)?"":"none";this._isExpEnabled=customExp[0];if(customExp[0]){$addHandlers(this._customExpChk,{click:this.enableExpiry},this);}
break;case 1:this._customExpChk.checked=customExp[1];if(customExp[1])
this.enableExpiry();break;case 2:this._customExpChk.disabled=customExp[2];this.dateExpiry.disabled=customExp[2];break;}}
break;case"OPTIONS_isFrFlagged":var chk=this._dataStore.get_property("OPTIONS_isFrFlagged");var posAdStatus=jQuery.data(document.body,"AWIjobStatus");if(chk){if(this.isSJAD=="True"&&posAdStatus==4){if(this.dateActive){$.datepicker._disableDatepicker(this.dateActive);}}}
break;default:break;}},onSuccess:function(result,userContext,methodName){switch(methodName){case"upslidsf":case"upsocpnsf":userContext._updateSummary=false;if(result){if(result.PostingSummaryData){userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result.PostingSummaryData);if(result.PostingSummaryData.LocationSummaryDetails!=null){userContext.modifyRegions(result.PostingSummaryData.LocationSummaryDetails);}}
if(result.EnhancementDatas){userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);userContext._dataStore.set_property("initCAN");}}
break;default:break;}},onFailure:function(result,userContext,methodName){switch(methodName){case"upslidsf":case"upsocpnsf":userContext._updateSummary=false;break;default:break;}},enableExpiry:function(){if(this._customExpChk.checked==true){$('#divPostingExpiryDate').show();}
else{$('#divPostingExpiryDate').hide();}},launchBrowseList:function(event){event.preventDefault();var me=this.instance;var type=this.value.type;var index=this.value.index;var headerText=null;if(me._modal==null){var modalElem=jQuery.data(document.body,"BrowseListModal");if(modalElem.id!=null){me._modal=$find(modalElem.id);}
else{me._modal=$find(modalElem._id);}}
var strURL="";if(type=="region"){strURL=String.format(me._browseListUrl,"loc");self.SearchAreaSelectionData=function(){return me._regionCache;};headerText=me.headerMessages[0];strURL=strURL+"&plg="+me.plgID;}
else{var regid=me.lookUpCountryID(index);strURL=String.format(me._browseListUrl,"cat");strURL=strURL+"&conid="+regid;strURL=strURL+"&plg="+me.plgID;if(me.catAWILimit!=null){strURL=strURL+"&mCat="+me.catAWILimit;}
self.SearchAreaSelectionData=function(){return me._categoryCache[regid].Categories;};headerText=me.headerMessages[1];}
if(me._isAreaWide)
strURL=strURL+"&inv=awi";self.SearchAreaCallBack=function(obj,isUpdate,isLocation){me._modal.hideDialog();if(isUpdate){me.browseListCallBack(obj,isLocation);}};me._modal.showDialog();var frameElement=null;if(me._modal._boxContent&&me._modal._boxContent[0]){var pelem=me._modal._boxContent[0];if(pelem.childNodes.length>0){for(var index=0;index<pelem.childNodes.length;index++){if(pelem.childNodes[index].tagName=="IFRAME"){frameElement=pelem.childNodes[index];break;}
if(pelem.childNodes[index].tagName=="STRONG"){var tempframe=$(pelem.childNodes[index]).find("IFRAME");if(tempframe[0]!=null){frameElement=tempframe[0];break;}}}
if(frameElement)frameElement.src=strURL;$(pelem).find(".box-content-header-text h2").text(headerText);if(type!="region"){$(pelem).find(".blist-iframe").addClass("blist-iframe-occupation");$(pelem).css("height","352px");}}}
else{me._modal.get_element().getElementsByTagName("iframe")[0].src=strURL;}},launchRegionsModal:function(event){event.preventDefault();var me=this.instance;var strRef=this.value;if(me._modalRegions==null){var modalRegionsElem=jQuery.data(document.body,"RegionsHelpModal");if(modalRegionsElem.id!=null){me._modalRegions=$find(modalRegionsElem.id);}
else{me._modalRegions=$find(modalRegionsElem._id);}}
self.closeRegionsDialog=function(){me._modalRegions.hideDialog();};me._modalRegions.showDialog();var frameElement=null;if(me._modalRegions._boxContent&&me._modalRegions._boxContent[0]){var pelem=me._modalRegions._boxContent[0];if(pelem.childNodes.length>0){$(pelem).find(".box-content-header-text h2").text(me.headerMessages[2]);for(var index=0;index<pelem.childNodes.length;index++){if(pelem.childNodes[index].tagName=="IFRAME"){frameElement=pelem.childNodes[index];break;}}
if(frameElement)frameElement.src=strRef;}}
else{me._modalRegions.get_element().getElementsByTagName("iframe")[0].src=strRef;me._modalRegions.get_element().getElementsByTagName("h2")[0].innerHtml=me.headerMessages[2];}},modifyRegions:function(regionData){if(!this._isAreaWide){for(var i=0;i<regionData.length;i++){var summaryData=regionData[i].LocationSummary;if(summaryData.Key in this._regionCache){var temp=summaryData.MessageText.split("<br />");this._regionCache[summaryData.Key].text=temp[0];this._regionCache[summaryData.Key].cost=this.costMessages[summaryData.PriceFlag];}}}
else{if(regionData.length>0){var summaryData=regionData[0].LocationSummary;var j=0;for(var p in this._regionCache){if(j==0){this._regionCache[p].cost=this.costMessages[summaryData.PriceFlag];}
else{this._regionCache[p].cost=this.costMessages[3];}
j++;}}}
this.fillRegions();},fillRegions:function(){var region_head=null;if(this.isGovt=="False"){region_head=[this.UIMessages[4],this.UIMessages[5],""];}
else{region_head=[this.UIMessages[4],""];}
var locations=[];for(property in this._regionCache){var itm=[];itm.push(this._regionCache[property].text);if(this.isGovt=="False"){itm.push(this._regionCache[property].cost);}
else{itm.push("");}
itm.push(this._regionCache[property].lid);itm.push(this._regionCache[property].cid);locations.push(itm);}
var colGrp=this.generateTableColumns();var tblhead=this.generateTableHeader(region_head,locations,this._tableTypes[0]);var tblbody=this.generateTableBody(region_head,locations,this._tableTypes[0]);$('.regionTable').children().remove();$('.regionTable').append(colGrp).append(tblhead).append(tblbody);if(this.getPropertyCount(this._regionCache)>0){$('.regionTable').show();this.hideRegionPicker(true);}
else{$('.regionTable').hide();this.hideRegionPicker(false);}},fillOccupations:function(){var occn_head=[this.UIMessages[6],this.UIMessages[7]];var i=1;if(this.getPropertyCount(this._categoryCache)>0){var listLi=$('ol.searchOrderedList').children();if(listLi.length>1){$('ol.searchOrderedList').children('li').not(':first-child').remove();}
for(property in this._categoryCache){var temp="cat"+i;var chkElem=$get(temp);var tempLI=this.buildCategoriesMarkUp(i,property);$('ol.searchOrderedList').append(tempLI);var baseSel=String.format(this._categoryBaseSelector,temp);var tblbody=this.generateCategoryTableBody(occn_head,this._categoryCache[property].Categories,this._tableTypes[1],this._categoryCache[property].countryid);var colGrp=this.generateCategoryTableColumns();$(baseSel+"> div.sSearchRight > .categoryTable").children().remove();$(baseSel+"> div.sSearchRight > .categoryTable").append(colGrp);$(baseSel+"> div.sSearchRight > .categoryTable").append(tblbody);if(this.getPropertyCount(this._categoryCache[property].Categories)>0){$(baseSel+"> div.sSearchRight > .categoryTable").show();this.hideCategoryPicker(true,baseSel);}
else{$(baseSel+"> div.sSearchRight > .categoryTable").hide();this.hideCategoryPicker(false,baseSel);}
i++;}
var innerTables=$("#categoryHolder .innerTable");$.each(innerTables,function(){var $parentCell=$(this).parent().prev("td");if($(this).height()<$parentCell.height()){var parentHeight=$parentCell.height();var cellPadding=parseInt($parentCell.css("padding-top").replace("px",""));cellPadding+=parseInt($parentCell.css("padding-bottom").replace("px",""));$(this).css("height",(parentHeight+cellPadding)+"px");}
else{$(this).css("height","auto");}});}
else{$('li#cat1').remove();}},generateCategoryTableBody:function(header,content,tbltype,countryid){var tbdy=document.createElement("TBODY");var tr=document.createElement("TR");var th1=document.createElement("TH");var thSpan1=document.createElement("SPAN");thSpan1.appendChild(document.createTextNode(header[0]));th1.appendChild(thSpan1);tr.appendChild(th1);var th2=document.createElement("TH");var thSpan2=document.createElement("SPAN");thSpan2.appendChild(document.createTextNode(header[1]));th2.appendChild(thSpan2);tr.appendChild(th2);tbdy.appendChild(tr);for(var property in content){var tr=document.createElement("TR");var td1=document.createElement("TD");td1.style.padding="7px 10px 7px 10px";td1.appendChild(document.createTextNode(content[property].text));var occn=content[property].Occupations;var childt1=this.createDOMElement("TABLE","","innerTable");childt1.style.tableLayout="fixed";childt1.style.borderCollapse="collapse";var colGrp=document.createElement("COLGROUP");var col1=document.createElement("COL");var col2=document.createElement("COL");if(!$isIE())
col1.setAttribute("width","197");else
col1.setAttribute("width","177");col2.setAttribute("width","");colGrp.appendChild(col1);colGrp.appendChild(col2);childt1.appendChild(colGrp);var childtb1=document.createElement("TBODY");for(var p in occn){var childtr1=document.createElement("TR");var childtd1=document.createElement("TD");var childtd2=document.createElement("TD");childtd1.appendChild(document.createTextNode(occn[p].text));var anc=document.createElement("A");anc.className="removeSearchItem";$addHandlers(anc,{click:this.removeItemFromGrid},{instance:this,context:tbltype,pkey:occn[p].occid,ckey:occn[p].catid,mkey:countryid});childtd2.appendChild(anc);childtd1.style.borderLeftStyle="none";childtd1.style.padding="7px 10px 7px 10px";childtd2.setAttribute("class","removeTD");childtd2.style.borderRightStyle="none";childtd2.style.padding="7px 8px 7px 8px;"
childtr1.appendChild(childtd1);childtr1.appendChild(childtd2);childtb1.appendChild(childtr1);childt1.appendChild(childtb1);}
var rowLength=childt1.rows.length;var lastRow=childt1.rows[rowLength-1];var cellLength=lastRow.cells.length;for(var i=0;i<cellLength;i++){lastRow.cells[i].style.borderBottomStyle="none";}
var td2=document.createElement("TD");td2.appendChild(childt1);tr.appendChild(td1);tr.appendChild(td2);tbdy.appendChild(tr);}
return tbdy;},generateCategoryTableColumns:function(){var colGrp=document.createElement("COLGROUP");var col1=document.createElement("COL");var col2=document.createElement("COL");col1.setAttribute("width","280");col2.setAttribute("width","230");colGrp.appendChild(col1);colGrp.appendChild(col2);return colGrp;},generateTableBody:function(header,content,tbltype){var tbdy=document.createElement("TBODY");var itemCount=2;if(this.isGovt=="True")itemCount=1;for(var i=0;i<content.length;i++){var tr=document.createElement("TR");for(var j=0;j<itemCount;j++){var td=document.createElement("TD");td.appendChild(document.createTextNode(content[i][j]));tr.appendChild(td);}
var td=document.createElement("TD");var anc=document.createElement("A");anc.className="removeSearchItem";$addHandlers(anc,{click:this.removeItemFromGrid},{instance:this,context:tbltype,pkey:content[i][2],mkey:content[i][3]});td.setAttribute("class","removeTD");td.style.padding="3px 0 3px 8px;"
td.appendChild(anc);tr.appendChild(td);tbdy.appendChild(tr);}
return tbdy;},generateTableColumns:function(){var colGrp=document.createElement("COLGROUP");var col1=document.createElement("COL");var col2=document.createElement("COL");var col3=document.createElement("COL");col1.setAttribute("width","280");if(this.isGovt=="True"){col2.setAttribute("width","36");}
else{col2.setAttribute("width","197");}
col3.setAttribute("width","33");colGrp.appendChild(col1);colGrp.appendChild(col2);colGrp.appendChild(col3);return colGrp;},generateTableHeader:function(header,content,tbltype){var thd=document.createElement("THEAD");var tr=document.createElement("TR");for(var i=0;i<header.length-1;i++){var th=document.createElement("TH");var thSpan=document.createElement("SPAN");thSpan.appendChild(document.createTextNode(header[i]));if(i==header.length-2){th.setAttribute("colSpan","2");}
th.appendChild(thSpan);tr.appendChild(th);}
thd.appendChild(tr)
return thd;},generateRegionCache:function(contents){var country_id=0;for(var i=0;i<contents.length;i++){if(this.isLGRAN!="true")
country_id=contents[i].CountryId;var cacheItem={lid:contents[i].LocationId,cid:country_id,text:contents[i].DisplayText,cost:this.costMessages[contents[i].PriceFlag]};this._regionCache[contents[i].LocationId]=cacheItem;this._countryLookUp[contents[i].LocationId]=contents[i].CountryId;}},generateCategoryCache:function(contents){var ckey1=0;for(var i=0;i<contents.length;i++){if(this.isLGRAN!="true")
ckey1=contents[i].CountryId;var cacheItem1={countryid:ckey1,Categories:{}};for(var j=0;j<contents[i].Categories.length;j++){var ckey2=contents[i].Categories[j].Category;var cacheitem2={catid:contents[i].Categories[j].Category,text:contents[i].Categories[j].DisplayText,Occupations:{}};for(var k=0;k<contents[i].Categories[j].Occupations.length;k++){var ckey3=contents[i].Categories[j].Occupations[k].Occupation;var cacheitem3={catid:contents[i].Categories[j].Occupations[k].Category,occid:contents[i].Categories[j].Occupations[k].Occupation,text:contents[i].Categories[j].Occupations[k].DisplayText};cacheitem2.Occupations[ckey3]=cacheitem3;}
cacheItem1.Categories[ckey2]=cacheitem2;}
this._categoryCache[ckey1]=cacheItem1;}},isCountryinRegionCache:function(cntid){var flag=false;for(var p in this._regionCache){if(this._regionCache[p].cid==cntid){flag=true;break;}}
return flag;},hideRegionPicker:function(isHidden){if(isHidden==true||this._isGeo==false){$('div.regionPicker > input').hide();$('a#btnAddRegion').hide();$('a.addAnotherLink').show();$('a#blistRegion').hide();$('span.regionOR').hide();}
else{$('div.regionPicker > input').show();$('a#btnAddRegion').show().css('display','inline-block');$('a.addAnotherLink').hide();$('a#blistRegion').show();$('span.regionOR').show();}},hideCategoryPicker:function(isHidden,catselector){if(isHidden){$(catselector+"> div#catRight > div#categorySelector > input").hide();$(catselector+"> div#catRight > div#categorySelector > a.addCatButton").hide();$(catselector+"> div#catRight > div#categorySelector > a.addAnotherCat").show();$(catselector+"> div#catRight > div#categorySelector > span.catOR").hide();$(catselector+"> div#catRight > div#categorySelector > a.blistCategory").hide();}
else{$(catselector+"> div#catRight > div#categorySelector > input").show();$(catselector+"> div#catRight > div#categorySelector > a.addCatButton").show().css("display","inline-block");$(catselector+"> div#catRight > div#categorySelector > a.addAnotherCat").hide();$(catselector+"> div#catRight > div#categorySelector > span.catOR").show();$(catselector+"> div#catRight > div#categorySelector > a.blistCategory").show();}},setCategoriesViews:function(catselector){},removeItemFromGrid:function(){var me=this.instance;var country_id=this.mkey;var cat_index=null;var adjustCatView=false;var paintRegion=false;var paintCat=false;if(this.context=="region"){if(this.pkey in me._regionCache){delete me._regionCache[this.pkey];paintRegion=true;}
if(!me.isCountryinRegionCache(country_id)){if(country_id in me._categoryCache){delete me._categoryCache[country_id];paintCat=true;adjustCatView=true;}}}
else if(this.context=="occupation"){if(country_id in me._categoryCache){var cat_id=this.ckey;var occ_id=this.pkey;delete me._categoryCache[country_id].Categories[cat_id].Occupations[occ_id];if(me.getPropertyCount(me._categoryCache[country_id].Categories[cat_id].Occupations)<=0){delete me._categoryCache[country_id].Categories[cat_id];if(me.getPropertyCount(me._categoryCache[country_id].Categories)<=0){delete me._categoryCache[country_id];me._categoryCache[country_id]={countryid:country_id,Categories:{}};adjustCatView=true;}}
paintCat=true;}}
if(paintRegion){me.fillRegions();if(me.getPropertyCount(me._regionCache)<=0){me.hideRegionPicker(false);$('#regionHolder').hide();}
me._updateSummary=true;me._dataStore.set_property("selectedLocations",me._regionCache);}
if(paintCat){me.fillOccupations();me._updateSummary=true;me._dataStore.set_property("selectedCategories",me._categoryCache);}},showRegionsAddLayer:function(event){event.preventDefault();this.hideRegionPicker(false);},addSelectedRegion:function(event){event.preventDefault();var txtbox=$('div.regionPicker > input')[0];var result=jQuery.data(txtbox,"selection");if(result!=undefined){var location_id=result.ID;var location_text=result.Text;var country_id=result.Data.ID;var country_abb=result.Data.Data;var loadCategories=false;if(location_id in this._regionCache){}
else{var cacheItem={lid:location_id,cid:country_id,text:location_text,cost:""};this._regionCache[location_id]=cacheItem;this._countryLookUp[location_id]=country_id;if(!this.isCountryinCategoryCache(country_id)){this._categoryCache[country_id]={countryid:country_id,Categories:{}};loadCategories=true;}}}
this.fillRegions();if(loadCategories){this.fillOccupations();this._updateSummary=true;this._dataStore.set_property("selectedCategories",this._categoryCache);}
this._updateSummary=true;this._dataStore.set_property("selectedLocations",this._regionCache);var temp=jQuery.data(txtbox,"WaterMark");if(temp){txtbox.value=temp.m;$(txtbox).addClass("waterMarktxt");}else{txtbox.value="";}},addSelectedCategory:function(event){event.preventDefault();var index=this.value;var me=this.instance;var renderView=false;var defaultLimit=3;var elemid="cat"+index;var base=String.format(me._categoryBaseSelector,elemid);var txtBox=$(base+"> div#catRight > div#categorySelector > input")
var result=jQuery.data(txtBox[0],"selection");if(result!=undefined){var txtSelected=result.Text.replace(/(\r\n|\n|\r)/gm,"");result.Text=txtSelected;if(txtBox[0].value==result.Text){var countryid=jQuery.data(txtBox[0],"countryid");countryid=countryid*1;if(me.isCountryinRegionCache(countryid)){if(me.catAWILimit!=null&&me._isAreaWide==true&&me._categoryCache[countryid].Categories[result.Data.ID]==null){var cat_count=me.getPropertyCount(me._categoryCache[countryid].Categories);if(cat_count>=(me.catAWILimit*1)){$('#erAWICat').show();me.hideCategoryPicker(true,base);var temp=jQuery.data(txtBox[0],"WaterMark");if(temp){txtBox[0].value=temp.m;$(txtBox[0]).addClass("waterMarktxt");}
else{txtBox[0].value="";}
return;}
else{$('#erAWICat').hide();}}
var cacheItem1={countryid:countryid,Categories:{}};var cacheItem2={catid:result.Data.ID,text:result.Data.TextEncoded,Occupations:{}};var cacheItem3={catid:result.Data.ID,occid:result.ID,text:result.Data.Data};if(me._categoryCache[countryid]==undefined){cacheItem2.Occupations[result.ID]=cacheItem3;cacheItem1.Categories[result.Data.ID]=cacheItem2;me._categoryCache[countryid]=cacheItem1;renderView=true;}
if(me._categoryCache[countryid].Categories[result.Data.ID]==undefined){cacheItem2.Occupations[result.ID]=cacheItem3;me._categoryCache[countryid].Categories[result.Data.ID]=cacheItem2;renderView=true;}
else if(me._categoryCache[countryid].Categories[result.Data.ID].Occupations[result.ID]==undefined){if(me._occLimit[countryid]!=null)
defaultLimit=me._occLimit[countryid];else
defaultLimit=3;if(me.getPropertyCount(me._categoryCache[countryid].Categories[result.Data.ID].Occupations)<defaultLimit){me._categoryCache[countryid].Categories[result.Data.ID].Occupations[result.ID]=cacheItem3;renderView=true;}}
if(renderView){me.fillOccupations();me.hideCategoryPicker(true,base);me._updateSummary=true;me._dataStore.set_property("selectedCategories",me._categoryCache);}}
else{me.hideCategoryPicker(false,base);}}}
var txtHolder=txtBox[0];var temp=jQuery.data(txtHolder,"WaterMark");if(temp){txtHolder.value=temp.m;$(txtHolder).addClass("waterMarktxt");}else{txtHolder.value="";}},getPropertyCount:function(obj){var i=0;for(var prop in obj){i++;}
return i;},showCategoryAddLayer:function(event){event.preventDefault();var index=this.value;var me=this.instance;var elemid="cat"+index;var base=String.format(me._categoryBaseSelector,elemid);me.hideCategoryPicker(false,base);},lookUpCountryID:function(index){var i=0;for(property in this._categoryCache){if(index==i){return(this._categoryCache[property].countryid);}
i++;}},lookUpIndex:function(countryID){var i=1;for(property in this._categoryCache){if(property==countryID)
return i;i++;}
return null;},isCountryinCategoryCache:function(countryid){if(countryid in this._categoryCache){return true;}
else{return false;}},browseListCallBack:function(objSel,isLocation){if(isLocation=="true"){var loadCategories=false;for(var r in objSel){if(r in this._regionCache){}
else{var cntid=objSel[r].cid*1;var cacheItem={lid:r,cid:cntid,text:objSel[r].text,cost:""};this._regionCache[r]=cacheItem;this._countryLookUp[r]=cntid;if(!this.isCountryinCategoryCache(cntid)){this._categoryCache[cntid]={countryid:cntid,Categories:{}};loadCategories=true;}}}
this.fillRegions();if(loadCategories){this._updateSummary=true;this._dataStore.set_property("selectedCategories",this._categoryCache);if(this.isGovt=="True"){this.fillOccupations();}}
this._updateSummary=true;this._dataStore.set_property("selectedLocations",this._regionCache);}
else{var idx=objSel.countryid*1;if(this.isCountryinRegionCache(idx)){this._categoryCache[idx]={countryid:idx,Categories:{}};if(idx in this._categoryCache){for(var index in objSel.Categories){if(index in this._categoryCache[idx].Categories){this._categoryCache[idx].Categories[index].Occupations={};for(var k in objSel.Categories[index].Occupations){var cacheItem3={catid:index,occid:k,text:objSel.Categories[index].Occupations[k].text};this._categoryCache[idx].Categories[index].Occupations[k]=cacheItem3;}}
else{var cacheItem2={catid:index,text:objSel.Categories[index].text,Occupations:{}};for(var k in objSel.Categories[index].Occupations){var cacheItem3={catid:index,occid:k,text:objSel.Categories[index].Occupations[k].text};cacheItem2.Occupations[k]=cacheItem3;this._categoryCache[idx].Categories[index]=cacheItem2;}}}}
else{var cacheItem1={countryid:idx,Categories:{}};for(var p1 in objSel.Categories){var cacheItem2={catid:p1,text:objSel.Categories[p1].text,Occupations:{}};for(p2 in objSel.Categories[p1].Occupations){var cacheItem3={catid:p1,occid:p2,text:objSel.Categories[p1].Occupations[p2].text};cacheItem2.Occupations[p2]=cacheItem3;}
cacheItem1.Categories[p1]=cacheItem2;}
this._categoryCache[idx]=cacheItem1;}
this.fillOccupations();this._updateSummary=true;this._dataStore.set_property("selectedCategories",this._categoryCache);}}},AutoCompleteResult:function(event,result){jQuery.data(event.target,"selection",result);if(result!=undefined&&result!=null){var p_node=event.target.parentNode;if(p_node!=null&&p_node.className!=null){if(p_node.className=="regionPicker"){jQuery.data(document.body,"ACRegion",true);}
else if(p_node.className=="categoryPicker"){jQuery.data(document.body,"ACCategory",true);}}}},ClearInput:function(event,result){var temp=jQuery.data(event.target,"WaterMark");if(event.target.value==temp.m){event.target.value="";jQuery.data(event.target,"selection",null);$(event.target).removeClass("waterMarktxt");}},AddWaterMark:function(event,result){var temp=jQuery.data(event.target,"WaterMark");if(temp){if(event.target.value==""){$(event.target).addClass("waterMarktxt");event.target.value=temp.m;}}},buildCategoriesMarkUp:function(idx,countryid){var mainLI=document.createElement("LI");var elem_id="cat"+idx;mainLI.setAttribute("id",elem_id);if(this.isOccupationSectionHidden=="true"){mainLI.style.display="none";}
var lDiv=this.createDOMElement("DIV","catLeft","sSearchLeft");var lspan1=this.createDOMElement("SPAN","lblSearchCategory","");lspan1.innerHTML=this.UIMessages[8];var lspan2=this.createDOMElement("SPAN","","required");lspan2.innerHTML=" *";lDiv.appendChild(lspan1);lDiv.appendChild(lspan2);var rDiv=this.createDOMElement("DIV","catRight","sSearchRight");var introTxt=this.createDOMElement("SPAN","","introText");if(this._occLimit[countryid]!=null){introTxt.innerHTML=String.format(this.occupationMsg[0],this._occLimit[countryid]);}
else{introTxt.innerHTML=this.occupationMsg[0];}
var tbl=this.createDOMElement("TABLE","categoryHolder","categoryTable");tbl.setAttribute("style","display:none");var selDiv=this.createDOMElement("DIV","categorySelector","categoryPicker");selDiv.setAttribute("style","display:block");var ipt=this.createDOMElement("INPUT","","input-text-long");ipt.setAttribute("type","text");ipt.value=this.catExample;$(ipt).addClass("waterMarktxt");var payload_ac=null;if(this._isAreaWide==true||this.isLGRAN=="true"){var lgid=this.plgID*1;payload_ac={q:"",g:lgid,wfh:this._isWorkatHome};}
else{payload_ac={q:"",c:countryid,wfh:this._isWorkatHome};}
$(ipt).mautocomplete({"getDataEndpoint":this._occupationendPoint,"isCustomEndPoint":true,"customData":payload_ac,"customQf":"q","pgContext":"Job+Posting+Options","ctrlType":"Posting+Options:Search+Occupation:Type+Ahead"});$(ipt).bind("result",this.AutoCompleteResult);$(ipt).bind("focus",this.ClearInput);$(ipt).bind("blur",this.AddWaterMark);var wMarkData={m:this.catExample,type:"cat"};jQuery.data(ipt,"WaterMark",wMarkData);jQuery.data(ipt,"countryid",countryid);var anc1=this.createDOMElement("A","btnAddCategory","redux-button btn-primary-small addCatButton");var span1=this.createDOMElement("SPAN","ts1","button-left");var span2=this.createDOMElement("SPAN","ts2","button-right");var span3=this.createDOMElement("SPAN","ts3","button-text");span3.innerHTML=this.UIMessages[0];anc1.href="#";$addHandlers(anc1,{click:this.addSelectedCategory},{instance:this,value:idx});span2.appendChild(span3);span1.appendChild(span2);anc1.appendChild(span1);var orSpan=this.createDOMElement("SPAN","","catOR");orSpan.innerHTML=" "+this.UIMessages[1]+" ";var anc2=this.createDOMElement("A","idListCategory","blistCategory");anc2.innerHTML=this.UIMessages[2];anc2.href="#";$addHandlers(anc2,{click:this.launchBrowseList},{instance:this,value:{type:this._tableTypes[1],index:idx-1}});var anc3=this.createDOMElement("A","btnAddAnotherCategory","addAnotherCat");anc3.innerHTML=this.UIMessages[3];anc3.href="#";$addHandlers(anc3,{click:this.showCategoryAddLayer},{instance:this,value:idx});selDiv.appendChild(ipt);selDiv.appendChild(anc1);selDiv.appendChild(orSpan);selDiv.appendChild(anc2);selDiv.appendChild(anc3);rDiv.appendChild(introTxt);rDiv.appendChild(tbl);rDiv.appendChild(selDiv);if(this._isAreaWide&&this.catAWILimit!=null){var erDiv=this.createDOMElement("DIV","erAWICat","catEr");erDiv.innerHTML=String.format(this.UIMessages[10],this.catAWILimit);erDiv.style.display="none";rDiv.appendChild(erDiv);}
else if(!this._isAreaWide){var cnt=this.getPropertyCount(this._categoryCache[countryid].Categories);if(cnt>1){var erDiv=this.createDOMElement("DIV","erAWICat"+idx,"catEr");erDiv.innerHTML=this.UIMessages[11];rDiv.appendChild(erDiv);}}
mainLI.appendChild(lDiv);mainLI.appendChild(rDiv);return mainLI;},createDOMElement:function(elemType,elemid,elemclass){var temp=document.createElement(elemType);temp.setAttribute("id",elemid);temp.className=elemclass;return temp;},setDateAccess:function(){var posAdStatus=jQuery.data(document.body,"AWIjobStatus");var query=window.location.search.substring(1);var tempVars=query.split("&");var isEdit=false;for(var i=0;i<tempVars.length;i++){var pair=tempVars[i].split("=");if(pair[0]=="edit"&&(pair[1]=="true"||pair[1]=="True")){isEdit=true;}}
if(isEdit){if(this.isSJAD=="True"){if(posAdStatus==3||posAdStatus==4){this.dateActive.disabled=false;}
else{this.dateActive.disabled=true;}}}}}
Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter.registerClass('Monster.Client.Behavior.JobPosting.SearchAreaCreateAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter=function(element){Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter.initializeBase(this,[element]);this._postingTable=null;this._postingsCache={};this.createProperty("encryptedPostingID");this.createProperty("actionMessages");this.createProperty("doneBtn");this.createProperty("plgID");this.createProperty("isWFH");this.createProperty("dateBox");this.createProperty("dateBoxExpiry");this.createProperty("localFormat");this.createProperty("isSJAD");this.createProperty("headerMessages");this.createProperty("defSelect");this.createProperty("locExample");this.createProperty("catExample");this.createProperty("isGeo");this.createProperty("isExpEnabled");this.createProperty("pendingMsg");this.createProperty("hideCategories");this.createProperty("defaultOccupationMsg");this._blistLocation=null;this._blistcategory=null;this._folder=null;this._addAnother=null;this._btnDone=null;this._btnCancel=null;this._browseListUrl="JobLocationCategoriesBrowser.aspx?type={0}";this._locInput=null;this._catInput=null;this._defaultdate=null;this._defaultExpdate=null;this._actionsEnum=[];this._deleteKey=null;this._isWorkatHome=false;this._locationendPoint="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/sl";this._occupationendPoint="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/spf";this._modal=null;this._isflaggedJob=false;this._categoryDiv=null;this._defaultOccpnGroupId="11";this._defaultOccpnId="11892"
this._defaultCustomExp=null;this._customExpElement=null;}
Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}},initOnDemand:function(){this.registerDataProperty("OPTIONS_defaultPostingData");this.registerDataProperty("OPTIONS_defaultActiveDate");this.registerDataProperty("OPTIONS_defaultExpiryDate");this.registerDataProperty("OPTIONS_defaultCustomExpiry");this.registerDataProperty("OPTIONS_FolderId");this.registerDataProperty("OPTIONS_isFrFlagged");this._webService=EBiz.Services.JPW.JobPostingOptionsService;this._locationendPoint=String.format(this._locationendPoint,window.location.hostname);this._occupationendPoint=String.format(this._occupationendPoint,window.location.hostname);this._isWorkatHome=(this.isWFH=="True");DATE_FORMAT_MONS=this.localFormat;},initHandlers:function(element,event,context){event.preventDefault();},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case"OPTIONS_defaultPostingData":var postingDatas=this._dataStore.get_property("OPTIONS_defaultPostingData");this.clearPostings();for(var i=0;i<postingDatas.length;i++){var currentPostingData=postingDatas[i];this.addPostingToCache(currentPostingData);}
this.generatePostingTable();this.initializeSearchPanel();this._dataStore.set_property("hideExpiryLabel",true);break;case"OPTIONS_defaultActiveDate":var dt_active=this._dataStore.get_property("OPTIONS_defaultActiveDate");if(dt_active)
this._defaultdate=dt_active;break;case"OPTIONS_defaultExpiryDate":var dt_expiry=this._dataStore.get_property("OPTIONS_defaultExpiryDate");if(dt_expiry)
this._defaultExpdate=dt_expiry;break;case"OPTIONS_defaultCustomExpiry":this._defaultCustomExp=this._dataStore.get_property("OPTIONS_defaultCustomExpiry");break;case"OPTIONS_FolderId":this._folder=this._dataStore.get_property("OPTIONS_FolderId")*1;break;case"OPTIONS_isFrFlagged":var chk=this._dataStore.get_property("OPTIONS_isFrFlagged");if(chk)
this._isflaggedJob=true;break;default:break;}},clearPostings:function(){},addPostingToCache:function(item){if(this._postingsCache[item.PrePostPositionAdId]==undefined){var ckey=item.PrePostPositionAdId;var cacheItem={ppid:item.PrePostPositionAdId,eid:item.EncryptedAdId,lid:item.LocationId,countryid:item.CountryId,actions:[],category:item.Occupations.Category,text:item.Occupations.DisplayText,ocpn:{},dateExp:item.DateExpires,datePost:item.DatePosted,area:item.SearchArea,status:item.Status,isDate:item.IsDatePickerEnabled,customExp:item.CustomExpiry};for(var i=0;i<item.AvailableActions.length;i++){cacheItem.actions.push(item.AvailableActions[i]);}
for(var i=0;i<item.Occupations.Occupations.length;i++){var temp=item.Occupations.Occupations[i];var occItem={catid:temp.Category,occid:temp.Occupation,text:temp.DisplayText};cacheItem.ocpn[temp.Occupation]=occItem;}
if(this._postingsCache[ckey]==undefined){this._postingsCache[ckey]=cacheItem;}}},generatePostingTable:function(){$('#searchPostingTable tr.dataRow').remove();for(var p in this._postingsCache){var tblRow=this.generateTableRow(this._postingsCache[p].area,this._postingsCache[p].text,this._postingsCache[p].dateExp,this._postingsCache[p].status,this._postingsCache[p].actions,this._postingsCache[p].ppid,this._postingsCache[p].countryid);$('#searchPostingTable tr:last').after(tblRow);}},generateTableRow:function(region,category,dateExp,status,actions,pkey,cid){var tr=document.createElement("TR");tr.className="dataRow";var td1=document.createElement("TD");var anc1=document.createElement("A");anc1.innerHTML=region;anc1.href="#";$addHandlers(anc1,{click:this.actionInvoke},{instance:this,value:pkey});jQuery.data(anc1,"countryid",cid);td1.appendChild(anc1);var td2=document.createElement("TD");if(this.hideCategories!="true"){var anc=document.createElement("A");anc.innerHTML=category;anc.href="#";$addHandlers(anc,{click:this.actionInvoke},{instance:this,value:pkey});jQuery.data(anc,"countryid",cid);td2.appendChild(anc);}
var td3=document.createElement("TD");if(dateExp.getMonth){td3.innerHTML=$returnDateWithFormat(dateExp);}
else{td3.innerHTML=dateExp;}
var td4=document.createElement("TD");td4.innerHTML=status;var td5=document.createElement("TD");var selBox=document.createElement("SELECT");var newOption=new Option();newOption.text=this.defSelect;newOption.value="N";selBox.options[0]=newOption;for(var i=0;i<actions.length;i++){var newOption=new Option();newOption.text=this.actionMessages[actions[i]];newOption.value=actions[i];selBox.options[i+1]=newOption;}
$addHandlers(selBox,{change:this.actionInvoke},{instance:this,value:pkey});td5.appendChild(selBox);tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);return tr;},actionInvoke:function(event){event.preventDefault();var me=this.instance;var key_ppid=this.value;var posting_id=me.encryptedPostingID;var index=0;if(event.target.tagName=="A"||event.target.tagName=="a"){index=Presenters.JPW.DTO.AdActionTypes.Change;}
else{index=event.target.options[event.target.selectedIndex].value;event.target.selectedIndex=0;}
if(index!="N"){index=index*1;switch(index){case Presenters.JPW.DTO.AdActionTypes.Add:break;case Presenters.JPW.DTO.AdActionTypes.Change:me.editPosting(key_ppid);break;case Presenters.JPW.DTO.AdActionTypes.Expire:case Presenters.JPW.DTO.AdActionTypes.Refresh:case Presenters.JPW.DTO.AdActionTypes.Renew:case Presenters.JPW.DTO.AdActionTypes.Reset:var eV=new Presenters.JPW.DTO.EditView();eV.Id=key_ppid;eV.Action=index;me.callServer("update",[posting_id,me._folder,eV]);break;case Presenters.JPW.DTO.AdActionTypes.Delete:if(index==Presenters.JPW.DTO.AdActionTypes.Delete){me._deleteKey=key_ppid;}
if(me.getPropertyCount(me._postingsCache)<=1){me.callServer("rlp",[posting_id,me._folder,key_ppid]);}
else{var eV=new Presenters.JPW.DTO.EditView();eV.Id=key_ppid;eV.Action=index;me.callServer("update",[posting_id,me._folder,eV]);}
break;default:break;}}},deletePosting:function(arg,m,f,store){},onSuccess:function(result,userContext,methodName){if(userContext.processWebServiceErrorList(result))return;userContext.showPostingsView(false);if(result.ErrorDatas!=null&&result.ErrorDatas.length===1&&result.ErrorDatas[0].WSErrorType==Presenters.Base.Data.WSErrorType.ErrorJobWizardContext){userContext._dataStore.set_property("TriggerJobWizardContextError");return;}
switch(methodName){case"modify":userContext.callServer("summary",[userContext.encryptedPostingID,userContext._folder]);if(result.EnhancementDatas!=null){userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);userContext._dataStore.set_property("initCAN");}
if(result.PostingData!=null){userContext.changePostingCache(result.PostingData,false);userContext.generatePostingTable();}
break;case"update":userContext.callServer("summary",[userContext.encryptedPostingID,userContext._folder]);if(result.EnhancementDatas!=null){userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);userContext._dataStore.set_property("initCAN");}
if(result.PostingData!=null){userContext.changePostingCache(result.PostingData,false);userContext.generatePostingTable();}
else{userContext.removefromCache(userContext._deleteKey);userContext._deleteKey=null;userContext.generatePostingTable();}
break;case"newjm":if(result.EnhancementDatas!=null){userContext._dataStore.set_property("OPTIONS_defaultEnhancementData",result.EnhancementDatas);userContext._dataStore.set_property("initCAN");}
if(result.PostingData!=null){userContext.callServer("summary",[userContext.encryptedPostingID,userContext._folder]);userContext.changePostingCache(result.PostingData,true);userContext.generatePostingTable();}
break;case"rlp":$('#searchPostingTable tr.dataRow').remove();userContext._postingsCache={};userContext._dataStore.set_property("hideExpiryLabel",false);userContext._deleteKey=null;if(result!=null){userContext._dataStore.set_property("FillPostingOptionsData",result);}
break;case"summary":userContext._dataStore.set_property("OPTIONS_defaultSummaryData",result);break;default:break;}},OnFailure:function(result,userContext,methodName){userContext.showPostingsView(false);switch(methodName){case"modify":break;case"newjm":break;default:break;}},enableExpiry:function(){if(this._customExpElement.checked==true){$('#expiryDateHolder').show();}
else{$('#expiryDateHolder').hide();}},initializeSearchPanel:function(){this._blistLocation=$get('blistEditLoc');this._blistcategory=$get('blistEditCat');this._locInput=$get('editLocation');this._catInput=$get('editCat');this._addAnother=$get('addAnotherEditRow');this._btnDone=this.doneBtn;this._btnCancel=$('div#addSearchPanel > div.btnPanel > div.linksText > a#cancelBtn')[0];this._categoryDiv=$get('categoryDiv');if(this.isSJAD=="True"){$('#datePickerHolder').show();}
else{$('#datePickerHolder').hide();}
var customExp=this._defaultCustomExp;this._customExpElement=$get('chkCustomEditExpiry');$('#expiryDateHolder').hide();if(customExp!=null&&customExp[0]!=null){if(customExp[0]==true){$('#chkExpiryEditWrapper').show();$addHandlers(this._customExpElement,{click:this.enableExpiry},this);}
else{$('#chkExpiryEditWrapper').hide();}}
$.datepicker._attachDatepicker(this.dateBox,{dateFormat:this.localFormat});$.datepicker._attachDatepicker(this.dateBoxExpiry,{dateFormat:this.localFormat});$addHandlers(this._blistLocation,{click:this.launchBrowseList},{instance:this,value:null,data:"region"});$addHandlers(this._blistcategory,{click:this.launchBrowseList},{instance:this,value:null,data:"category"});$addHandlers(this._addAnother,{click:function(event){event.preventDefault();this.showPostingsView(true);}},this);$addHandlers(this._btnDone,{click:this.addPosting},this);$addHandlers(this._btnCancel,{click:function(event){event.preventDefault();this.showPostingsView(false);}},this);jQuery.data(this._locInput,"adapter",this);jQuery.data(this._catInput,"adapter",this);var payload_ac={q:"",plg:this.plgID*1};if(this.isGeo=="true"){$(this._locInput).mautocomplete({"getDataEndpoint":this._locationendPoint,"isCustomEndPoint":true,"customData":payload_ac,"customQf":"q","pgContext":"Job+Posting+Options","ctrlType":"Posting+Options:Search+Location:Type+Ahead"});$(this._locInput).bind("result",this.AutoCompleteResult);}
$(this._locInput).bind("focus",this.ClearInput);$(this._locInput).bind("blur",this.AddWaterMark);var wMarkData={m:this.locExample,type:"loc"};jQuery.data(this._locInput,"WaterMark",wMarkData);$(this._catInput).bind("focus",this.ClearInput);$(this._catInput).bind("blur",this.AddWaterMark);jQuery.data(this._catInput,"WaterMark",{m:this.catExample,type:"cat"});this._catInput.disabled=true;},AutoCompleteResult:function(event,result){var me=jQuery.data(event.target,"adapter");var prev_txt_cid=jQuery.data(me._locInput,"countryid");if(event.target==me._locInput){var regionSel={cid:result.Data.ID,lid:result.ID,text:""};jQuery.data(event.target,"selected_region",regionSel);if(prev_txt_cid!=result.Data.ID){jQuery.data(me._catInput,"selected_category",null);jQuery.data(event.target,"countryid",result.Data.ID);}
me._catInput.disabled=false;$(me._catInput).unautocomplete();var payload_ac={q:"",c:result.Data.ID,wfh:me._isWorkatHome};$(me._catInput).mautocomplete({"getDataEndpoint":me._occupationendPoint,"isCustomEndPoint":true,"customData":payload_ac,"customQf":"q","pgContext":"Job+Posting+Options","ctrlType":"Posting+Options:Search+Occupation:Type+Ahead"});$(me._catInput).bind("result",me.AutoCompleteResult);if(prev_txt_cid!=result.Data.ID){me._catInput.value=me.catExample;$(me._catInput).addClass("waterMarktxt");$('.btnPanel button').removeClass('btn-primary-large').addClass('btn-disabled-large');}
else{$('.btnPanel button').removeClass('btn-disabled-large').addClass('btn-primary-large');}
jQuery.data(me._catInput,"countryid",result.Data.ID);jQuery.data(document.body,"ACRegion",true);}
if(event.target==me._catInput){var categorySel={catid:result.Data.ID,Occupations:{}};categorySel.Occupations[result.ID]={occid:result.ID,text:result.Data.Data};jQuery.data(event.target,"selected_category",categorySel);$(me._catInput).removeClass("waterMarktxt");$('.btnPanel button').removeClass('btn-disabled-large').addClass('btn-primary-large');jQuery.data(document.body,"ACCategory",true);}},ClearInput:function(event,result){var temp=jQuery.data(event.target,"WaterMark");if(event.target.value==temp.m){event.target.value="";jQuery.data(event.target,"selection",null);$(event.target).removeClass("waterMarktxt");}},AddWaterMark:function(event,result){var me=jQuery.data(event.target,"adapter");var cat=jQuery.data(me._catInput,"selected_category");var loc=jQuery.data(me._locInput,"selected_region");var temp=jQuery.data(event.target,"WaterMark");if(temp){if(event.target.value==""){$(event.target).addClass("waterMarktxt");event.target.value=temp.m;jQuery.data(me._catInput,"selected_category",null);me._catInput.value=me.catExample;$('.btnPanel button').removeClass('btn-primary-large').addClass('btn-disabled-large');$(me._catInput).addClass("waterMarktxt");}}
if((this.hideCategories!="true"&&cat==null)||loc==null){$('.btnPanel button').removeClass('btn-primary-large').addClass('btn-disabled-large');}},launchBrowseList:function(event){event.preventDefault();var me=this.instance;var tp=this.data;var launch_type=this.value;var strURL="";var cid=null;var headerText=null;if(me._modal==null){var modalElem=jQuery.data(document.body,"BrowseListModal");if(modalElem.id!=null){me._modal=$find(modalElem.id);}
else{me._modal=$find(modalElem._id);}}
if(launch_type==null){cid=jQuery.data(me._locInput,"countryid");}
else{cid=jQuery.data(event.target,"countryid");}
if(tp=="region"){strURL=String.format(me._browseListUrl,"loc");strURL=strURL+"&flow=edit";self.SearchAreaSelectionData=null;headerText=me.headerMessages[0];strURL=strURL+"&plg="+me.plgID;}
else{if(cid!=null){strURL=String.format(me._browseListUrl,"cat");strURL=strURL+"&conid="+cid+"&flow=edit";strURL=strURL+"&plg="+me.plgID;}
else{strURL="#";return;}
self.SearchAreaSelectionData=null;headerText=me.headerMessages[1];}
self.SearchAreaCallBack=function(obj,isUpdate,isLocation){me._modal.hideDialog();if(isUpdate){me.browseListCallBack(obj,isLocation,launch_type);}};me._modal.showDialog();if(tp!="region"){$("#reduxDialog_active .box-content").css("height","352px");$("#reduxDialog_active iframe").css("height","319px");}
var frameElement=null;if(me._modal._boxContent&&me._modal._boxContent[0]){var pelem=me._modal._boxContent[0];if(pelem.childNodes.length>0){for(var index=0;index<pelem.childNodes.length;index++){if(pelem.childNodes[index].tagName=="IFRAME"){frameElement=pelem.childNodes[index];break;}}
if(frameElement)frameElement.src=strURL;}
$(pelem).find(".box-content-header-text h2").text(headerText);}
else{me._modal.get_element().getElementsByTagName("iframe")[0].src=strURL;}},browseListCallBack:function(objSel,isLocation,context){if(context==null){if(isLocation=="true"){var prev_txt_cid=jQuery.data(this._locInput,"countryid");for(var index in objSel){var regionSel={cid:objSel[index].cid*1,lid:index,text:objSel[index].text};this._locInput.value=regionSel.text;jQuery.data(this._locInput,"selected_region",regionSel);if(prev_txt_cid!=regionSel.cid){jQuery.data(this._locInput,"countryid",regionSel.cid);jQuery.data(this._catInput,"selected_category",null);this._catInput.value="";$(this._catInput).addClass("waterMarktxt");this._catInput.value=this.catExample;}
this._catInput.disabled=false;$(this._locInput).removeClass("waterMarktxt");if(this.hideCategories=="true"){$('.btnPanel button').removeClass('btn-disabled-large').addClass('btn-primary-large');}}}
else{for(var index in objSel.Categories){var categorySel={catid:index,Occupations:{}};this._catInput.value=objSel.Categories[index].text;for(var k in objSel.Categories[index].Occupations){categorySel.Occupations[k]={occid:k,text:objSel.Categories[index].Occupations[k].text};}}
jQuery.data(this._catInput,"selected_category",categorySel);$('.btnPanel button').removeClass('btn-disabled-large').addClass('btn-primary-large');$(this._catInput).removeClass("waterMarktxt");}}},showPostingsView:function(isShow){if(isShow){this._locInput.value=this.locExample;$(this._locInput).addClass("waterMarktxt");this._catInput.value=this.catExample;$(this._catInput).addClass("waterMarktxt");if(this.hideCategories=="true"){this._categoryDiv.style.display="none";}
if(this._defaultdate!=null){this.dateBox.value=$returnDateWithFormat($getLocalFromUTCDate_j(this._defaultdate));}
else{this.dateBox.value="";}
if(this._defaultExpdate!=null){this.dateBoxExpiry.value=$returnDateWithFormat($getLocalFromUTCDate_j(this._defaultExpdate));}
else{this.dateBoxExpiry.value="";}
jQuery.data(this._locInput,"selected_region",null);jQuery.data(this._catInput,"selected_category",null);jQuery.data(this._locInput,"countryid",null);jQuery.data(this._btnDone,"pkey",null);this._addAnother.style.display="none";this.dateBox.disabled=false;this.dateBoxExpiry.disabled=false;$.datepicker._enableDatepicker(this.dateBox);$.datepicker._enableDatepicker(this.dateBoxExpiry);$('#addSearchPanel').show();}
else{this._locInput.value=this.locExample;$(this._locInput).addClass("waterMarktxt");this._catInput.value=this.catExample;$(this._catInput).addClass("waterMarktxt");jQuery.data(this._btnDone,"pkey",null);this._addAnother.style.display="";$('#addSearchPanel').hide();}
if(this.isGeo=="false"){this._locInput.disabled=true;}},addPosting:function(event){event.preventDefault();var reg=jQuery.data(this._locInput,"selected_region");var cat;if(this.hideCategories=="true"){var defaultOccpn={occid:this._defaultOccpnId,text:this.defaultOccupationMsg}
var defaultOccupations={11982:defaultOccpn}
cat={catid:this._defaultOccpnGroupId,Occupations:defaultOccupations};}
else{cat=jQuery.data(this._catInput,"selected_category");}
var key=jQuery.data(this._btnDone,"pkey");var pid=this.encryptedPostingID;var lid=null;var dt="";var dateActive=null;var dateExpiry=null;var occn=[];if(cat!=null&&reg!=null){lid=reg.lid;if(this.isSJAD=="True"){dt=$getParsedDate(this.dateBox);}
else{dt=new Date();}
dateActive=$getUTCFromLocalDate_j(dt);dt="";if(this._defaultCustomExp!=null&&this._defaultCustomExp[0]!=null&&this._customExpElement!=null){if(this._defaultCustomExp[0]==true&&this._customExpElement.checked==true){dt=$getParsedDate(this.dateBoxExpiry);}
else{dt=new Date();}}
else{dt=new Date();}
dateExpiry=$getUTCFromLocalDate_j(dt);for(var property in cat.Occupations){occn.push({Category:cat.catid,Occupation:property});}
var eV=new Presenters.JPW.DTO.EditView();eV.Lid=lid;eV.Ocpns=occn;eV.Active=dateActive;eV.Expiry=dateExpiry;eV.IsCustomExpiry=this._customExpElement.checked==true?true:false;if(key!=null){key=key*1;eV.Id=key;this.callServer("modify",[pid,this._folder,eV]);}
else{this.callServer("newjm",[pid,this._folder,eV]);}
this._addAnother.style.display="";$('.btnPanel button').removeClass('btn-primary-large').addClass('btn-disabled-large');}},editPosting:function(key){this.showPostingsView(true);var countryid=this._postingsCache[key].countryid;jQuery.data(this._btnDone,"pkey",key);this._locInput.value=this._postingsCache[key].area;this._catInput.value=this._postingsCache[key].text;if(this._postingsCache[key].datePost){this.dateBox.value=$returnDateWithFormat($getLocalFromUTCDate_j(this._postingsCache[key].datePost));}
if(this._postingsCache[key].dateExp){this.dateBoxExpiry.value=$returnDateWithFormat($getLocalFromUTCDate_j(this._postingsCache[key].dateExp));}
if(this._postingsCache[key].isDate!=null&&this._postingsCache[key].isDate==false){$.datepicker._disableDatepicker(this.dateBox);}
else{$.datepicker._enableDatepicker(this.dateBox);}
var customExp=this._postingsCache[key].customExp;this._customExpElement=$get('chkCustomEditExpiry');if(customExp[0]==true){$('#chkExpiryEditWrapper').show();$('#expiryDateHolder').hide();$addHandlers(this._customExpElement,{click:this.enableExpiry},this);this._customExpElement.checked=customExp[1]==true?true:false;this._customExpElement.disabled=customExp[2]==true?true:false;this.dateBoxExpiry.disabled=customExp[2]==true?true:false;if(customExp[1])
$('#expiryDateHolder').show();else
$('#expiryDateHolder').hide();}
else{$('#chkExpiryEditWrapper').hide();$('#expiryDateHolder').hide();$.datepicker._disableDatepicker(this.dateBoxExpiry);}
if(this._isflaggedJob){if(this._postingsCache[key].status==this.pendingMsg){$.datepicker._disableDatepicker(this.dateBox);}
else{$.datepicker._enableDatepicker(this.dateBox);}}
$(this._locInput).removeClass("waterMarktxt");$(this._catInput).removeClass("waterMarktxt");this._catInput.disabled=false;var regionSel={cid:countryid,lid:this._postingsCache[key].lid,text:this._postingsCache[key].area};var categorySel={catid:this._postingsCache[key].category,Occupations:this._postingsCache[key].ocpn};jQuery.data(this._locInput,"countryid",countryid);jQuery.data(this._locInput,"selected_region",regionSel);jQuery.data(this._catInput,"selected_category",categorySel);$('.btnPanel button').removeClass('btn-disabled-large').addClass('btn-primary-large');},changePostingCache:function(item,isNew){var key=item.PrePostPositionAdId;if(key in this._postingsCache){this._postingsCache[key].ppid=key;this._postingsCache[key].eid=item.EncryptedAdId;this._postingsCache[key].lid=item.LocationId;this._postingsCache[key].countryid=item.CountryId;this._postingsCache[key].actions=[];this._postingsCache[key].category=item.Occupations.Category;this._postingsCache[key].text=item.Occupations.DisplayText;this._postingsCache[key].ocpn={};this._postingsCache[key].dateExp=item.DateExpires;this._postingsCache[key].datePost=item.DatePosted;this._postingsCache[key].area=item.SearchArea;this._postingsCache[key].status=item.Status;this._postingsCache[key].isDate=item.IsDatePickerEnabled;this._postingsCache[key].customExp=item.CustomExpiry;for(var i=0;i<item.AvailableActions.length;i++){this._postingsCache[key].actions.push(item.AvailableActions[i]);}
for(var i=0;i<item.Occupations.Occupations.length;i++){var temp=item.Occupations.Occupations[i];var occItem={catid:temp.Category,occid:temp.Occupation,text:temp.DisplayText};this._postingsCache[key].ocpn[temp.Occupation]=occItem;}}
else{if(isNew){var ckey=item.PrePostPositionAdId;var cacheItem={ppid:item.PrePostPositionAdId,eid:item.EncryptedAdId,lid:item.LocationId,countryid:item.CountryId,actions:[],category:item.Occupations.Category,text:item.Occupations.DisplayText,ocpn:{},dateExp:item.DateExpires,datePost:item.DatePosted,area:item.SearchArea,status:item.Status,isDate:item.IsDatePickerEnabled,customExp:item.CustomExpiry};for(var i=0;i<item.AvailableActions.length;i++){cacheItem.actions.push(item.AvailableActions[i]);}
for(var i=0;i<item.Occupations.Occupations.length;i++){var temp=item.Occupations.Occupations[i];var occItem={catid:temp.Category,occid:temp.Occupation,text:temp.DisplayText};cacheItem.ocpn[temp.Occupation]=occItem;}
if(this._postingsCache[ckey]==undefined){this._postingsCache[ckey]=cacheItem;}}}},removefromCache:function(key){if(this._postingsCache[key]!=undefined)
delete this._postingsCache[key];},getPropertyCount:function(objCheck){var i=0;for(var property in objCheck){i++;}
return i;}}
Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter.registerClass('Monster.Client.Behavior.JobPosting.SearchAreaEditAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

Type.registerNamespace('Monster.Client.Behavior.JobPosting');Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter=function(element){Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter.initializeBase(this,[element]);this._tableTypes=["region","occupation"];this._regionCache={};this._countryLookUp={};this._abvLookUp={};this._locationendPoint="http://{0}/jpw/Services/JPW/JobPostingOptionsService.asmx/sl";this._regionsPage="http://{0}/jpw/jobs/regions.aspx";this._isGeo=true;this.createProperty("plgID");this.createProperty("isGeo");this.createProperty("tbLocation");}
Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter.prototype={initialize:function(){Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter.callBaseMethod(this,'initialize');this.initOnDemand();},initOnDemand:function(){this._webService=EBiz.Services.JPW.JobPostingOptionsService;this._isGeo=(this.isGeo=="true");this._locationendPoint=String.format(this._locationendPoint,window.location.hostname);this._regionsPage=String.format(this._regionsPage,window.location.hostname);var payload_ac={q:"",plg:this.plgID*1};$(".tbLocation").mautocomplete({"getDataEndpoint":this._locationendPoint,"isCustomEndPoint":true,"customData":payload_ac,"customQf":"q"});}}
Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter.registerClass('Monster.Client.Behavior.JobPosting.CreateQRCodeAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;

