var collab_name;var collab_deadline;var collab_freq;var gridLines,gridheight,gridwidth;var rstore;function get_radio_value(b){for(var a=0;a<b.items.length;a++){if(b.items.items[a].checked){return b.items.items[a].inputValue}}}function layout_onready_2(){try{var a=_gat._getTracker("UA-10105808-1");a._trackPageview()}catch(b){}setTimeout(function(){try{Ext.get("loading").remove();Ext.get("loading-mask").fadeOut({remove:true})}catch(d){}},0.25);Ext.QuickTips.init();try{Ext.apply(Ext.EventObject,{within:navigator.userAgent.match(/firefox\/((\d+\.)+\d+)/i)[1]>=3.5?function(g,j,d){try{if(g){var f=this[j?"getRelatedTarget":"getTarget"]();return f&&((d?(f==Ext.getDom(g)):false)||Ext.fly(g).contains(f))}}catch(h){}return false}:function(f,g,d){if(f){var e=this[g?"getRelatedTarget":"getTarget"]();return e&&((d?(e==Ext.getDom(f)):false)||Ext.fly(f).contains(e))}return false}})}catch(c){}if(Ext.isIE||Ext.isIE6||Ext.isIE7||Ext.isIE8){winW=document.body.offsetWidth-16;winH=document.body.offsetHeight+150}else{winW=window.innerWidth;winH=window.innerHeight-6}gridheight=Math.max(300,(winH-150));gridwidth=Math.max(300,winW);try{Ext.apply(Ext.EventObject,{within:navigator.userAgent.match(/firefox\/((\d+\.)+\d+)/i)[1]>=3.5?function(g,j,d){try{if(g){var f=this[j?"getRelatedTarget":"getTarget"]();return f&&((d?(f==Ext.getDom(g)):false)||Ext.fly(g).contains(f))}}catch(h){}return false}:function(f,g,d){if(f){var e=this[g?"getRelatedTarget":"getTarget"]();return e&&((d?(e==Ext.getDom(f)):false)||Ext.fly(f).contains(e))}return false}})}catch(c){}Ext.state.Manager.setProvider(new Ext.state.CookieProvider())}function layout_onready_1(){Ext.override(Ext.ToolTip,{adjustPosition:function(r,n){var q=r;var v=n;var p=Ext.get(document.body);var t=p.getScroll();var o=p.getWidth()-5;var j=p.getHeight()-20;var e=t.left+5;var k=t.left+o;var s=t.top+5;var g=t.top+j;var m=this.body.getTextWidth();if(this.title){m=Math.max(m,this.header.child("span").getTextWidth(this.title))}m+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr");var f=this.getInnerHeight()+this.getFrameHeight()+this.body.getPadding("tb");if(r+m>k){r=k-m}if(n+f>g){n=g-f}if(r<e){r=e}if(n<s){n=s}var u=this.targetXY[1],l=this.getSize().height;if(this.constrainPosition&&n<=u&&(n+l)>=u){n=u-l-5}return{x:r,y:n}}});Ext.QuickTips.init();Ext.state.Manager.setProvider(new Ext.state.CookieProvider());var a=(roles=="paiduser")?"Renew My Subscription":"Subscribe Now";var b=new Ext.menu.Menu({cls:"dod-menu",id:"utilmenu",items:[{text:"Add Titles From Master Library",handler:function(){window.location=jd_select},id:"menu_act_ml"},{text:"Create New Blank Job Description",id:"menu_act_new",handler:function(){AddBlankHandler()}},{text:"View Collaboration Status Details",id:"menu_act_colab_detail",handler:function(){window.location=jd_collaborate}},{text:"Restore Deleted Descriptions",id:"menu_act_undel",handler:function(){window.location=jd_undel}},"-",{text:"Manage Your Account",handler:function(){window.location=us_edituser}},{text:"Manage Your Contact List",handler:function(){AddressBookDetail()}},{text:"Edit Collaboration Email Content",handler:function(){window.location=jd_eml}},"-",{text:a,handler:function(){if(roles=="paiduser"){window.location=us_anrenew}else{BuyOptionsHandler("",0)}}},"-",{text:"Logout",handler:function(){window.location=logout}}],listeners:{afterrender:function(g){try{g.tip=new Ext.ToolTip({target:g.getEl().getAttribute("id"),delegate:".x-menu-item",trackMouse:false,renderTo:document.body,text:"",title:"",listeners:{beforeshow:function f(j){var e=g.findById(j.triggerElement.id);if(!e.initialConfig.qtip){return false}j.body.dom.innerHTML=e.initialConfig.qtip}}})}catch(h){}}}});var d=new Ext.menu.Menu({cls:"dod-menu",id:"jdmenu",items:[{text:"Edit",id:"menu_edit_edit",handler:function(){EditHandler()}},{text:"Preview",id:"menu_edit_preview",handler:function(){RPreviewHandler()}},{text:"Duplicate",id:"menu_edit_dup",handler:function(){DuplicateHandler()}},{text:"Collaborate",id:"menu_edit_collab",handler:function(){CollaborateHandler()}},{text:"Output",id:"menu_edit_out",handler:function(){OutputHandler()}},{text:"Delete",id:"menu_edit_del",handler:function(){DeleteHandler()}}],listeners:{afterrender:function(g){try{g.tip=new Ext.ToolTip({target:g.getEl().getAttribute("id"),delegate:".x-menu-item",trackMouse:false,renderTo:document.body,text:"",title:"",listeners:{beforeshow:function f(j){var e=g.findById(j.triggerElement.id);if(!e.initialConfig.qtip){return false}j.body.dom.innerHTML=e.initialConfig.qtip}}})}catch(h){}}}});var c=new Ext.menu.Menu({cls:"dod-menu",id:"helpmenu",items:[{text:"Online Manual",handler:function(){if(helpvector==""){helpvector=server_addr+"help/toc.html"}window.open(helpvector)}},"-",{text:"Video Tutorial",handler:function(){if(roles=="paiduser"){window.open("http://jesap.com/dbdvideoonlinetutorial.html")}else{window.open("http://jesap.com/dbdvideogettingstarted.html")}}}]});menu_tb=new Ext.Toolbar({ctCls:"mainToolbar"});menu_tb.render("mainmenudiv");mylibrary=menu_tb.add("->",{text:"My Library",id:"tb_mylibrary",cls:"dod-menu",handler:function(){window.location=slash}},'&nbsp;<span class="bullet">&#8226;</span>&nbsp;',{text:"Job Description",id:"tb_jd",cls:"dod-menu",menu:d},'&nbsp;<span class="bullet">&#8226;</span>&nbsp;',{text:"Tools & Utilities",cls:"dod-menu",id:"tb_tools",menu:b},'&nbsp;<span class="bullet">&#8226;</span>&nbsp;',{text:"Help",cls:"dod-menu",id:"tb_help",menu:c});menu_tb.doLayout()}function BuyOptionsHandler(e,b){if(roles=="paiduser"){var a=new Ext.data.Connection();a.request({url:selectDoStuff,params:{action:"add",id:e},failure:function(h,g){if(g.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+g.response.status+" "+g.response.statusText)}if(g.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",g.result.errormsg)}},success:function(g,f){window.location=slash}})}else{if((jd_used==0)&&(b==1)){var a=new Ext.data.Connection();a.request({url:selectDoStuff,params:{action:"add",id:e},failure:function(h,g){if(g.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+g.response.status+" "+g.response.statusText)}if(g.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",g.result.errormsg)}},success:function(g,f){Ext.Msg.show({title:"Thank you",msg:"Thank you for trying DBDescriptions' free sample job description.",buttons:Ext.Msg.OK,minWidth:400,fn:function(h){window.location=slash}});Ext.MessageBox.buttonText.ok="Continue"}})}else{var d=new Ext.Panel({layout:"anchor",baseCls:"x-panel-PO",items:[{baseCls:"x-panel-PO",html:'<img src="'+server_addr+'dod_logo.gif" id="logo" allign="left" /><img src="'+server_addr+'js/authorizenet.png" id="anlogo" allign="right" /><br><p class="PurchaseOptHeader">Full Subscription Purchase</p><p class="PurchaseOpt">We are proud to offer unlimited job descriptions for businesses of all sizes.</p>'},{baseCls:"x-panel-PO",html:'<p class="PurchaseOptFooter">You have one free job description included with your trial. If you would like to access more than one job description, please purchase the unlimited subscription to begin working with your descriptions. Paid subscribers can store an unlimited number of job descriptions in their personal library, can collaborate electronically with others while working on job descriptions and position analysis questionnaires, can customize collaboration email content, and can recover previously deleted job descriptions.</p>'}]});var c="Job Description Subscription Purchase:.";win=new Ext.Window({layout:"fit",width:500,y:100,height:325,modal:true,title:c,items:d,buttons:[{text:"Subscibe Now",handler:function(){var f=new Ext.data.Connection();f.request({url:selectDoStuff,params:{action:"saveids",id:e},failure:function(h,g){if(g.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+g.response.status+" "+g.response.statusText)}if(g.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",g.result.errormsg)}},success:function(h,g){window.location=us_an}})}},{text:"Cancel",handler:function(){win.close();win=0}}]});win.show();win.doLayout()}}}function addToFavorites(){var a="DBDescriptions.com - Job Descriptions on Demand";url="http://www.dbdescriptions.com/dbd";if(window.sidebar){window.sidebar.addPanel(a,url,"")}else{if(window.external){window.external.AddFavorite(url,a)}else{if(window.opera&&window.print){return true}}}}function CollaborateHandler(){var a=gridR.getSelectionModel().getSelected();if(typeof(a)=="undefined"){Ext.Msg.alert("Error","No Job Description was selected");return}var b=new Ext.data.Connection();b.request({url:docolab,params:{id:a.data.id,action:"get"},success:function(d,c){collab_name=Ext.util.JSON.decode(d.responseText).data.cid;collab_deadline=Ext.util.JSON.decode(d.responseText).data.collaboratordeadline;collab_freq=Ext.util.JSON.decode(d.responseText).data.collaboratorremindfreq;if(collab_name!="-1"){Ext.MessageBox.buttonText.yes="Modify";Ext.MessageBox.buttonText.no="Cancel";Ext.MessageBox.buttonText.cancel="Help";Ext.Msg.show({title:"Replace existing collaboration request?",msg:Ext.util.JSON.decode(d.responseText).data.name+" has already been asked to provide collaboration assistance for the "+a.data.jobtitle+((a.data.jobcode!="")?(" ("+a.data.jobcode+")"):"")+" job description, with a response deadline of "+Ext.util.JSON.decode(d.responseText).data.collaboratordeadline+". To avoid the potential problem of multiple collaborators overwriting each others&#39; responses, only one collaboration request can be active at a time.<br><br>If you want to modify the current collaboration request or request that a different person collaborates on this job description, click the Modify button below.<br><br>If you want to leave the existing collaboration request alone without modifying it, click the Cancel button below.<br><br>If you want to view a detailed help topic on how collaboration requests work, click the Help button below.",buttons:Ext.Msg.YESNOCANCEL,minWidth:400,fn:function(e,f){if(e=="yes"){CollaborateHandlerDetail2()}else{if(e=="cancel"){window.open(server_addr+"help/collaboration_screen.html")}}},icon:Ext.MessageBox.QUESTION});Ext.MessageBox.buttonText.yes="Yes";Ext.MessageBox.buttonText.no="No";Ext.MessageBox.buttonText.cancel="Cancel"}else{CollaborateHandlerDetail2()}},failure:function(){Ext.Msg.alert("Error","Form load failed")}})}function CollaborateHandlerDetail2(){var e=new Ext.data.Store({url:arcollabemail,remoteSort:true,reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","first_name","last_name","email"])});e.setDefaultSort("id","ASC");e.load({params:{limit:9,start:0,sort:"last_name",dir:"ASC"}});var p="Double click left mouse button to edit.";var l=new Ext.ux.plugins.grid.CellToolTips([{field:"id",tpl:p},{field:"firsr_name",tpl:p},{field:"last_name",tpl:p},{field:"email",tpl:p}]);var o=Ext.data.Record.create(["id","first_name","last_name","email"]);var a=new Ext.form.TextField();var f=new Ext.form.TextField();var n=new Ext.form.TextField();var b=new Ext.grid.EditorGridPanel({frame:true,height:270,width:518,viewConfig:{forceFit:true},bodyStyle:"padding:1px;",clickstoEdit:"auto",stripeRows:true,trackMouseOver:false,store:e,columns:[{header:"ID",dataIndex:"id",hidden:true,width:50,sortable:true},{header:"First Name",dataIndex:"first_name",editor:a,width:125,sortable:true},{header:"Last Name",dataIndex:"last_name",editor:f,width:125,sortable:true},{header:"Email",dataIndex:"email",editor:n,width:200,sortable:true}],plugins:[new Ext.ux.grid.Search({mode:"remote",iconCls:false,dateFormat:"m/d/Y",minLength:2}),l],bbar:[new Ext.PagingToolbar({pageSize:9,store:e}),new Ext.Toolbar.Separator(),{text:"Remove",handler:function(){var r=b.getSelectionModel();if(r.hasSelection()){var q=r.selection.record;Ext.Msg.show({title:"Remove Contact",buttons:Ext.MessageBox.YESNO,msg:"Remove "+q.data.first_name+" "+q.data.last_name+"?",fn:function(s){if(s=="yes"){var t=new Ext.data.Connection();t.request({url:arcollabemail,params:{action:"delete",id:q.id},success:function(v,u){b.getStore().remove(q);b.getView().refresh()},failure:function(v,u){Ext.Msg.alert("Error","Unable to delete contact")}})}}})}}},new Ext.Toolbar.Separator(),{text:"Add",handler:function(){var q=new Ext.data.Connection();q.request({url:arcollabemail,params:{action:"insert"},success:function(t,s){var r=Ext.util.JSON.decode(t.responseText).insert_id;b.getStore().insert(b.getStore().getCount(),new o({id:r,first_name:"",last_name:"",email:""}));b.doLayout();e.reload();b.startEditing(b.getStore().getCount(),0)},failure:function(){Ext.Msg.alert("Error","Unable to Add Contact")}})}}],listeners:{afteredit:function(r){var q=new Ext.data.Connection();q.request({url:arcollabemail,params:{action:"update",id:r.record.id,field:r.field,value:r.value},success:function(t,s){r.record.commit()},failure:function(t,s){r.record.reject()}})}}});var h=gridR.getSelectionModel().getSelected();var k=new Ext.data.Store({url:arcollabemaildd,remoteSort:true,method:"post",reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","name",])});Ext.override(Ext.form.ComboBox,{setValue:function(q){if(this.store.getCount()==0){this.store.on("load",this.setValue.createDelegate(this,[q]),null,{single:true});return}var t=q;if(this.valueField){var s=this.findRecord(this.valueField,q);if(s){t=s.data[this.displayField]}else{if(this.valueNotFoundText!==undefined){t=this.valueNotFoundText}}}this.lastSelectionText=t;if(this.hiddenField){this.hiddenField.value=q}Ext.form.ComboBox.superclass.setValue.call(this,t);this.value=q}});var m=new Ext.form.ComboBox({fieldLabel:"Collaborator Name",hiddenName:"name",name:"name",width:300,store:k,displayField:"name",editable:false,loadingText:"Loading Contacts...",valueField:"id",mode:"remote",valueNotFoundText:"Name not found.",triggerAction:"all",emptyText:"Choose Name...",selectOnFocus:true,lastQuery:"",readonly:true,listeners:{beforequery:function(q){delete q.combo.lastQuery}}});k.load({params:{start:0}});m.setValue(collab_name);var g=new Date();g.setDate(g.getDate()+1);g.clearTime();Ext.DatePicker.prototype.minDate=g;Ext.form.DateField.prototype.minValue=g;Ext.override(Ext.DatePicker,{minDate:g});var d=new Ext.ux.form.DateTime({id:"deadline",hiddenName:"deadline",name:"deadline",readOnly:true,value:collab_deadline,dateFormat:"Y-m-d",timeFormat:"h:i A",fieldLabel:"  Deadline",width:100,anchor:"",timePosition:"below",timeConfig:{allowBlank:false},dateConfig:{allowBlank:false}});var c=new Ext.FormPanel({id:"status-form",modal:true,method:"POST",waitMsg:"Loading",region:"west",url:docolab,params:{id:h.data.id,action:"save"},buttonAlign:"center",border:true,bodyBorder:false,labelWidth:120,labelAlign:"right",title:" ",baseCls:"collabinviteswest",defaults:{selectOnFocus:true},items:[m,d,{xtype:"numberfield",fieldLabel:"Reminder Frequency (Days)",allowBlank:false,width:30,value:collab_freq,labelSeparator:"",vtypeText:"The from field should be the reminder frequence in days",id:"remind_freq"}],buttons:[{text:"Send",handler:function(){if(c.getForm().isValid()){c.getEl().mask();var q=new Ext.data.Connection();q.request({url:docolab,params:{id:h.data.id,action:"save",deadline:c.getForm().findField("deadline").getRawValue(),name:c.getForm().findField("name").getValue(),remind_freq:c.getForm().findField("remind_freq").getValue()},failure:function(s,r){if(r.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+r.response.status+" "+r.response.statusText)}if(r.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",r.result.errormsg)}},success:function(){Ext.Msg.alert("Collaboration","Your collaboration request has been submitted.")}});win.close();win=0;gridR.getStore().reload()}else{Ext.Msg.alert("Error","There is a problem. Please check your data.")}}},{text:"Cancel",handler:function(){win.close();win=0;gridR.getStore().reload()}},{text:"Clear",handler:function(){c.getForm().findField("name").setValue("");c.getForm().findField("deadline").setValue("");c.getForm().findField("remind_freq").setValue(0);var q=new Ext.data.Connection();q.request({url:docolab,params:{id:h.data.id,action:"clear"},failure:function(s,r){if(r.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+r.response.status+" "+r.response.statusText)}if(r.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",r.result.errormsg)}}});win.close();win=0;gridR.getStore().reload()}},{text:"Help",handler:function(){window.open(server_addr+"help/collaboration_screen.html")}}]});var j=new Ext.Panel({layout:"border",items:[{region:"west",title:"",baseCls:"collabinvitewest",width:450,items:[{region:"north",baseCls:"collabinvitenwest",html:'<img src=server_addr+"dod_logo.gif" id="collablogo" allign="left" /><div class="collabwestheader">Ready to collaborate?</div><div class="collabwesttext">Now that you\'ve added job descriptions to your library you can collaborate with your peers to customize them. Just add contacts and then select who you want to work with, establish deadlines and reminder prompts.</div></center>'},{region:"center",items:[c]}]},{region:"center",title:"",items:[{region:"north",autoScroll:false,title:"",bodyBorder:false,border:false,html:'<div class="collabcenterheader">Add/Create Contacts</div><div class="collabcentertext">Customize your <i>DBDescriptions</i>&trade; contact list quickly and easily by clicking the "Add" button to add a new contact or by double-clicking existing contact data to edit it.</div>'},{region:"center",autoScroll:false,bodyBorder:false,border:false,items:[b]}]}]});if(collab_name!="-1"){}win=new Ext.Window({layout:"fit",width:985,height:416,modal:true,title:"Job Description Collaboration options for "+h.data.jobtitle+((h.data.jobcode!="")?(" ("+h.data.jobcode+")"):""),items:[j]});win.show()}function gotonewuser(){window.location=us_newuser}function dologin(a,c){if(a!="0"){if(c=="0"){window.location="/dbd/"}else{var b=new Ext.Panel({layout:"anchor",baseCls:"x-panel-PO",items:[{baseCls:"x-panel-PO",html:'<img src="'+server_addr+'dod_logo.gif" id="logo" allign="left" /><img src="'+server_addr+'js/authorizenet.png" id="anlogo" allign="right" /><br><p class="PurchaseOptHeader">Subscription Renewal</p>'},{baseCls:"x-panel-PO",html:'<p class="PurchaseOptFooter">Please click on the Renew Now button to renew your subscription. You will be taken to Authorize.net. Thank you.</p>'}]});win=new Ext.Window({layout:"fit",width:316,y:100,height:300,modal:true,title:"Job Description Subscription Renew:",items:b,buttons:[{text:"Renew Now",handler:function(){window.location=us_anrenew}}]});win.show();win.doLayout()}}else{Ext.Msg.alert("Error","There is a problem with your login.Please contact support.")}}function index_onready(){try{var b=_gat._getTracker("UA-10105808-1");b._trackPageview()}catch(c){}Ext.form.Field.prototype.msgTarget="side";var e=new Ext.form.TextField({id:"email",allowBlank:false,hideLabel:true,emptyText:"Enter Email Address",inputType:"textfield"});if(Ext.isIE){var a=new Ext.form.TextField({id:"password",emptyText:"Enter Password",allowBlank:false,hideLabel:true,inputType:"password"})}else{var a=new Ext.form.TextField({id:"password",emptyText:"Enter Password",allowBlank:false,hideLabel:true,inputType:"textfield",listeners:{focus:function(){document.getElementById("password").type="password";document.getElementById("password").style.type="password"}}})}var d=new Ext.FormPanel({labelWidth:0,baseCls:"login",title:"",bodyStyle:"padding:5px 5px 0; color: white;",width:160,defaults:{width:148},defaultType:"textfield",items:[e,a],buttons:[{text:"Sign In",type:"submit",id:"Submit",width:50,formBind:true,handler:function(){var f=d.getForm();if(f.isValid()){f.submit({waitMsg:"Logging In...",url:login,success:function(h,g){dologin(g.result.active,g.result.expired)},failure:function(g,h){Ext.Msg.alert("Error","There is a problem with your login.")}})}}},{text:"Forgot Password",type:"submit",id:"fpw",cls:"zzz",icon:"",handler:function(){var f=new Ext.data.Connection();f.request({waitMsg:"Finding Account...",url:lostpw,params:{user:e.getValue()},success:function(h,g){if(Ext.util.JSON.decode(h.responseText).success==false){Ext.Msg.alert("Error","Please enter your email address in the email box.")}else{Ext.Msg.alert("Success","Please check your email.")}},failure:function(h,g){Ext.Msg.alert("Error","There is a problem with your request. Please try again.")}})}}]});a.on("specialkey",function(h,g){if(g.getKey()==g.RETURN||g.getKey()==g.ENTER){var f=d.getForm();if(f.isValid()){f.submit({waitMsg:"Logging In...",url:login,success:function(j,k){dologin(k.result.active,k.result.expired)},failure:function(j,k){Ext.Msg.alert("Error","There is a problem with your login.")}})}}});d.render("logindiv")}function localCollaborateHandler(){CollaborateHandler()}function collab_detail_onready(){var c=gridheight+15;if(Ext.isIE||Ext.isIE6||Ext.isIE7||Ext.isIE8){c=c-8;gridwidth=gridwidth-50}var d=Math.floor((c-85)/22);helpvector=server_addr+"help/collaboration_status_screen.html";menu_tb.items.get("tb_mylibrary").enable();menu_tb.items.get("tb_jd").disable();menu_tb.items.get("tb_tools").disable();var b=new Ext.data.Store({url:collabRight,remoteSort:true,reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","jobtitle","jobcode","classification","notes","collaboratorfirstname","collaboratorlastname","collaboratoremail","collaboratorremindfreq","collaboratorurl","collaboratorsubmitted","collaboratordeadline","collaboratorpasscode","collaboratorstatus"])});var a=new Ext.grid.ColumnModel([{header:"ID",width:50,sortable:true,dataIndex:"id",hidden:true},{header:"Title",width:150,sortable:true,dataIndex:"jobtitle"},{header:"Job Code",width:50,sortable:true,dataIndex:"jobcode"},{header:"Classification",width:100,sortable:true,dataIndex:"classification"},{header:"Notes",width:100,sortable:true,dataIndex:"notes"},{header:"Collaborator First Name",width:50,sortable:true,dataIndex:"collaboratorfirstname"},{header:"Collaborator Last Name",width:50,sortable:true,dataIndex:"collaboratorlastname"},{header:"Collaborator Email",width:150,sortable:true,dataIndex:"collaboratoremail"},{header:"Reminder Frequency",width:70,sortable:true,dataIndex:"collaboratorremindfreq"},{header:"URL",width:100,sortable:true,dataIndex:"collaboratorurl",hidden:true},{header:"Submitted",width:60,sortable:true,dataIndex:"collaboratorsubmitted"},{header:"Deadline",width:60,sortable:true,dataIndex:"collaboratordeadline"},{header:"Password",width:100,sortable:true,dataIndex:"collaboratorpasscode",hidden:true},{header:"Status",width:50,sortable:true,dataIndex:"collaboratorstatus"}]);b.setDefaultSort("jobtitle","ASC");b.load({params:{limit:d,start:0,sort:"jobtitle",dir:"ASC"}});gridR=new Ext.grid.GridPanel({store:b,cm:a,viewConfig:{forceFit:true},width:gridwidth-70,height:c,el:"grid",trackMouseOver:false,stripeRows:true,singleSelect:true,trackMouseOver:false,title:"<center>Job Descriptions Collaboration</center>",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),bbar:[new Ext.PagingToolbar({pageSize:d,store:b}),new Ext.Toolbar.Separator(),{text:"Edit",tooltip:{text:"This button will allow you to invite others to assist in defining a Job Description.",autoHide:true},handler:function(){var e=gridR.getSelectionModel().getSelected();if(e){localCollaborateHandler()}}}],plugins:[new Ext.ux.grid.Search({mode:"remote",iconCls:false,dateFormat:"m/d/Y",minLength:2})]});gridR.on("rowdblclick",function(f,h,g){localCollaborateHandler()});gridR.on("rowclick",function(g,j,h){gridR.getSelectionModel().selectRow(j);var f=gridR.getSelectionModel().getSelected()});gridR.on("rowcontextmenu",function(g,k,j){gridR.getSelectionModel().selectRow(k);var f=gridR.getSelectionModel().getSelected();if(!g.contextMenu){g.contextMenu=new Ext.menu.Menu({id:"gridRtxMenu",items:[{text:"Edit",handler:function(){localCollaborateHandler()}}]})}j.stopEvent();var h=j.getXY();g.contextMenu.showAt(h)});gridR.render()}function email_layout_onready(){var b;var f;menu_tb.items.get("tb_mylibrary").enable();menu_tb.items.get("tb_jd").disable();menu_tb.items.get("tb_tools").disable();helpvector=server_addr+"help/edit_collaboration_email.html";var d=new Ext.form.HtmlEditor({labelSeparator:"",fieldLabel:"Email Subject",value:f,height:100,anchor:"98%"});var a=new Ext.form.HtmlEditor({labelSeparator:"",fieldLabel:"Email Body",value:b,height:200,anchor:"98%"});var e=new Ext.data.Connection();e.request({url:doemaillayout,params:{action:"get"},success:function(h,g){d.setValue(Ext.util.JSON.decode(h.responseText).esubject);a.setValue(Ext.util.JSON.decode(h.responseText).ebody)},failure:function(){Ext.Msg.alert("Error","Form load failed")}});var c=new Ext.form.FormPanel({title:"",applyTo:"div1",layout:"form",border:true,labelAlign:"top",width:800,autoHeight:true,frame:true,items:[d,a],buttons:[{text:"Save",tooltip:{text:"This will Save all email text.",autoHide:true},handler:function(){Ext.MessageBox.confirm("Save?","Are you sure you want to save all text?",function(g){if(g=="yes"){var h=new Ext.data.Connection();h.request({url:doemaillayout,params:{action:"save",ebody:a.getValue(),esubject:d.getValue()},failure:function(k,j){if(j.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+j.response.status+" "+j.response.statusText)}if(j.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",j.result.errormsg)}},success:function(k,j){Ext.Msg.alert("Success","Email text has been saved.")}})}})}},{text:"Close",tooltip:{text:"This will close the email editor without saving and return to the main page.",autoHide:true},handler:function(){Ext.MessageBox.confirm("Close?","Are you sure you want to close the editor, and return to the home page?",function(g){if(g=="yes"){window.location=slash}})}},{text:"Clear",tooltip:{text:"This will clear all email text.",autoHide:true},handler:function(){Ext.MessageBox.confirm("Clear?","Are you sure you want to clear all text?",function(g){if(g=="yes"){d.setValue("");a.setValue("")}})}},{text:"Default",tooltip:{text:"This will copy the default email text into the editor.",autoHide:true},handler:function(){Ext.MessageBox.confirm("Default?","Are you sure you want to default all text?",function(g){if(g=="yes"){var h=new Ext.data.Connection();h.request({url:doemaillayout,params:{action:"default"},success:function(k,j){d.setValue(Ext.util.JSON.decode(k.responseText).esubject);a.setValue(Ext.util.JSON.decode(k.responseText).ebody)},failure:function(k,j){if(j.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+j.response.status+" "+j.response.statusText)}if(j.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",j.result.errormsg)}}})}})}},{text:"Test",tooltip:{text:"This will send you a test email using the contents of the email editor.",autoHide:true},handler:function(){var g=new Ext.data.Connection();g.request({url:doemaillayout,params:{action:"test",ebody:a.getValue(),esubject:d.getValue()},failure:function(j,h){if(h.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+h.response.status+" "+h.response.statusText)}if(h.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",h.result.errormsg)}},success:function(j,h){Ext.Msg.alert("Success","Test email has been sent.")}})}}]})}var gridR,win;function RPreviewHandler(){var a=gridR.getSelectionModel().getSelections();if(a==""){Ext.Msg.alert("Error","No Job Description was selected")}Ext.each(a,function(b){var c=b.get("id");window.open(jd_htmlpv+c)},this)}function AddBlankHandler(){if(roles!="paiduser"){BuyOptionsHandler("",1)}else{var a=new Ext.data.Connection();a.request({url:selectDoStuff,params:{action:"blank"},failure:function(c,b){if(b.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+b.response.status+" "+b.response.statusText)}if(b.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",b.result.errormsg)}},success:function(c,b){rstore.reload()}})}}function DuplicateHandler(){var a=gridR.getSelectionModel().getSelections();if(a==""){Ext.Msg.alert("Error","No Job Description was selected")}else{if(roles!="paiduser"){BuyOptionsHandler("",1)}else{Ext.MessageBox.prompt("New Title","Please enter the new Job Description title:",function(b,d){if(b=="ok"){var c=new Ext.data.Connection();c.request({url:selectDoStuff,params:{action:"duplicate",id:a[0].data.id,title:d},failure:function(g,e){if(e.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+e.response.status+" "+e.response.statusText)}if(e.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",e.result.errormsg)}},success:function(f,e){rstore.reload()}})}})}}}function AddressBookDetail(){var c=new Ext.data.Store({url:arcollabemail,remoteSort:true,reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","first_name","last_name","email"])});c.setDefaultSort("last_name","ASC");c.load({params:{limit:9,start:0,sort:"last_name",dir:"ASC"}});var j="Double click left mouse button to edit.";var f=new Ext.ux.plugins.grid.CellToolTips([{field:"id",tpl:j},{field:"firsr_name",tpl:j},{field:"last_name",tpl:j},{field:"email",tpl:j}]);var h=Ext.data.Record.create(["id","first_name","last_name","email"]);var a=new Ext.form.TextField();var d=new Ext.form.TextField();var g=new Ext.form.TextField();var b=new Ext.grid.EditorGridPanel({frame:true,height:270,width:518,viewConfig:{forceFit:true},bodyStyle:"padding:1px;",clickstoEdit:1,stripeRows:true,trackMouseOver:false,store:c,columns:[{header:"ID",dataIndex:"id",hidden:true,width:50,sortable:true},{header:"First Name",dataIndex:"first_name",editor:a,width:125,sortable:true},{header:"Last Name",dataIndex:"last_name",editor:d,width:125,sortable:true},{header:"EMail",dataIndex:"email",editor:g,width:200,sortable:true}],plugins:[new Ext.ux.grid.Search({mode:"remote",iconCls:false,dateFormat:"m/d/Y",minLength:2}),f],bbar:[new Ext.PagingToolbar({pageSize:9,store:c}),new Ext.Toolbar.Separator(),{text:"Remove",handler:function(){var l=b.getSelectionModel();if(l.hasSelection()){var k=l.selection.record;Ext.Msg.show({title:"Remove Contact",buttons:Ext.MessageBox.YESNO,msg:"Remove "+k.data.first_name+" "+k.data.last_name+"?",fn:function(m){if(m=="yes"){var n=new Ext.data.Connection();n.request({url:arcollabemail,params:{action:"delete",id:k.id},success:function(p,o){b.getStore().remove(k);b.getView().refresh()},failure:function(p,o){Ext.Msg.alert("Error","Unable to delete contact")}})}}})}}},new Ext.Toolbar.Separator(),{text:"Add",handler:function(){var k=new Ext.data.Connection();k.request({url:arcollabemail,params:{action:"insert"},success:function(n,m){var l=Ext.util.JSON.decode(n.responseText).insert_id;b.getStore().insert(b.getStore().getCount(),new h({id:l,first_name:"",last_name:"",email:""}));b.doLayout();c.reload();b.startEditing(b.getStore().getCount(),0)},failure:function(){Ext.Msg.alert("Error","Unable to Add Contact")}})}}],listeners:{afteredit:function(l){var k=new Ext.data.Connection();k.request({url:arcollabemail,params:{action:"update",id:l.record.id,field:l.field,value:l.value},success:function(n,m){l.record.commit()},failure:function(n,m){l.record.reject()}})}}});var e=new Ext.Panel({layout:"border",region:"center",title:"",items:[{region:"north",autoScroll:false,title:"",bodyBorder:false,border:false,html:'<div class="collabcenterheader">Add/Create Contacts</div><div class="collabcentertext">Customize your <i>DBDescriptions</i>&trade; contact list by simply entering their first/last and email addresses. It really is that easy.</div>'},{region:"center",autoScroll:false,bodyBorder:false,border:false,items:[b]}]});win=new Ext.Window({layout:"fit",width:523,height:416,modal:true,title:"Manage Your Contact List",items:[e]});win.show()}function DeleteHandler(){var a=gridR.getSelectionModel().getSelections();if(a==""){Ext.Msg.alert("Error","No Job Description was selected")}else{Ext.MessageBox.confirm("Delete","Are you sure you want to delete this job description?",function(b){if(b=="yes"){var c=new Ext.data.Connection();c.request({url:selectDoStuff,params:{action:"delete",id:a[0].data.id},failure:function(e,d){if(d.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+d.response.status+" "+d.response.statusText)}if(d.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",d.result.errormsg)}},success:function(e,d){rstore.reload()}})}})}}function EditHandler(){var a=gridR.getSelectionModel().getSelections();if(a==""){Ext.Msg.alert("Error","No Job Description was selected")}else{Ext.each(a,function(b){var c=b.get("id");window.location=jd_editjd+c},this)}}function OutputHandler(){document.getElementById("datahold").value="output|";var a=gridR.getSelectionModel().getSelections();if(a==""){Ext.Msg.alert("Error","No Job Description was selected")}else{const_doc=(1<<0);const_rtf=(1<<1);const_txt=(1<<2);const_odt=(1<<3);const_pdf=(1<<4);const_html=(1<<5);const_email=(1<<14);const_dload=(1<<15);win=new Ext.Window({layout:"fit",width:400,height:300,modal:true,title:"Job Description output options",items:[{bodyStyle:"padding-right:5px;",items:{xtype:"fieldset",title:"",name:"options",autoHeight:true,defaultType:"checkbox",items:[{fieldLabel:"Output File Type",boxLabel:"Microsoft Word Document (.doc)",id:"doc",checked:((document.getElementById("outputoptions").value-0)&const_doc)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_doc):((document.getElementById("outputoptions").value-0)&(~const_doc))}},{fieldLabel:"",labelSeparator:"",boxLabel:"Rich Text Format (.rtf)",name:"rtf",checked:((document.getElementById("outputoptions").value-0)&const_rtf)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_rtf):((document.getElementById("outputoptions").value-0)&(~const_rtf))}},{fieldLabel:"",labelSeparator:"",boxLabel:"Plain Text (.txt)",name:"txt",checked:((document.getElementById("outputoptions").value-0)&const_txt)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_txt):((document.getElementById("outputoptions").value-0)&(~const_txt))}},{fieldLabel:" ",boxLabel:"Portable Document Format (.pdf)",name:"pdf",labelSeparator:"",checked:((document.getElementById("outputoptions").value-0)&const_pdf)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_pdf):((document.getElementById("outputoptions").value-0)&(~const_pdf))}},{fieldLabel:"",labelSeparator:"",boxLabel:"OpenOffice Document (.odt)",name:"odt",checked:((document.getElementById("outputoptions").value-0)&const_odt)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_odt):((document.getElementById("outputoptions").value-0)&(~const_odt))}},{fieldLabel:"",labelSeparator:"",boxLabel:"HyperText Markup Language (.html)",name:"html",checked:((document.getElementById("outputoptions").value-0)&const_html)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_html):((document.getElementById("outputoptions").value-0)&(~const_html))}},{fieldLabel:"Delivery Method",boxLabel:"Email Attachment",name:"email",checked:((document.getElementById("outputoptions").value-0)&const_email)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_email):((document.getElementById("outputoptions").value-0)&(~const_email))}},{fieldLabel:"",labelSeparator:"",boxLabel:"Download",name:"download",checked:((document.getElementById("outputoptions").value-0)&const_dload)?true:false,handler:function(){document.getElementById("outputoptions").value=(this.checked==true)?((document.getElementById("outputoptions").value-0)|const_dload):((document.getElementById("outputoptions").value-0)&(~const_dload))}}]}}],buttons:[{text:"OK",handler:function(){var c=gridR.getSelectionModel().getSelections();if((document.getElementById("outputoptions").value-0)&const_dload){Ext.each(c,function(d){var e=d.get("id");for(i=0;i<=5;i=i+1){if(document.getElementById("outputoptions").value&(1<<i)){window.open(jd_dljd+e+"-"+i)}}},this)}var b=new Ext.data.Connection();b.request({url:selectDoStuff,params:{action:"output",id:c[0].data.id,outputoptions:document.getElementById("outputoptions").value},failure:function(e,d){if(d.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+d.response.status+" "+d.response.statusText)}if(d.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",d.result.errormsg)}},success:function(e,d){Ext.Msg.alert("Output Selections","Your output request has been processed.")}});if((document.getElementById("outputoptions").value-0)&(const_email|const_dload)){win.close();win=0}else{Ext.Msg.alert("Output Error","No delivery method selected! Please select either Download or Email")}}},{text:"Cancel",handler:function(){win.close();win=0}}]});win.show();win.doLayout()}}function mylibrary_onready(){var b=gridheight+20;var c=Math.floor((b-85)/22);helpvector=server_addr+"help/my_library.html";document.getElementById("outputoptions").value=outputoptions;menu_tb.items.get("tb_mylibrary").enable();menu_tb.items.get("tb_jd").enable();menu_tb.items.get("tb_tools").enable();menu_tb.items.get("tb_help").enable();rstore=new Ext.data.Store({url:selectRight,remoteSort:true,reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","jobtitle","jobcode","classification","notes","tickleme","lastmodified","purchasedate"])});rstore.setDefaultSort("jobtitle","ASC");rstore.load({params:{limit:c,start:0,sort:"jobtitle",dir:"ASC"}});var a="Left mouse button selects a job.<br>Right mouse button displays a pop-up menu.";var e=new Ext.ux.plugins.grid.CellToolTips([{field:"jobtitle",tpl:a},{field:"jobcode",tpl:a},{field:"classification",tpl:a},{field:"notes",tpl:a},{field:"tickleme",tpl:a},{field:"lastmodified",tpl:a},{field:"purchasedate",tpl:a}]);gridR=new Ext.grid.GridPanel({store:rstore,cm:new Ext.grid.ColumnModel([{id:"id",header:"ID",width:50,sortable:true,dataIndex:"id",hidden:true},{header:"Title",width:200,sortable:true,dataIndex:"jobtitle"},{header:"Job Code",width:70,sortable:true,dataIndex:"jobcode"},{header:"Classification",width:100,sortable:true,dataIndex:"classification"},{header:"Internal Notes",width:100,sortable:true,dataIndex:"notes"},{header:"Reminder Date",width:80,sortable:true,dataIndex:"tickleme"},{header:"Last Modified",width:130,sortable:true,dataIndex:"lastmodified"},{header:"Purchase Date",width:130,sortable:true,dataIndex:"purchasedate"}]),viewConfig:{forceFit:true},width:gridwidth-70,height:b,el:"grid",singleSelect:true,stripeRows:true,title:"<center>My Library of Job Descriptions</center>",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),trackMouseOver:false,bbar:[new Ext.PagingToolbar({pageSize:c,store:rstore})],plugins:[new Ext.ux.grid.Search({mode:"remote",iconCls:false,dateFormat:"m/d/Y",minLength:2}),e]});gridR.on("rowclick",function(g,j,h){gridR.getSelectionModel().selectRow(j);var f=gridR.getSelectionModel().getSelected()});gridR.on("rowcontextmenu",function(f,j,h){if(!gridR.contextMenu){f.contextMenu=new Ext.menu.Menu({id:"gridCtxMenu",items:[{text:"Edit",handler:function(){EditHandler()}},{text:"Preview",handler:function(){RPreviewHandler()}},{text:"Duplicate",handler:function(){DuplicateHandler()}},{text:"Collaborate",handler:function(){CollaborateHandler()}},{text:"Output",handler:function(){OutputHandler()}},{text:"Delete",handler:function(){DeleteHandler()},qtip:"qt",toolTip:"tt"}]})}h.stopEvent();var g=h.getXY();gridR.contextMenu.showAt(g)});gridR.render();var d=new Ext.data.Connection();d.request({url:selectDoStuff,params:{action:"getusernote"},success:function(g,f){if(Ext.util.JSON.decode(g.responseText).title!=""){Ext.Msg.alert(Ext.util.JSON.decode(g.responseText).title,Ext.util.JSON.decode(g.responseText).body)}}})}var gridL,gridR,win;var rdata=[];var rstore=new Ext.data.SimpleStore({fields:[{name:"action2",type:"string"},"jobtitle","classification","masterid"],data:rdata});function buybut(){var a=rstore.getCount();if(a){var b="Do you want to add ";if(a==1){b+="this job description "}else{b+="these "+a+" job descriptions "}b+="to your library?";Ext.Msg.show({title:"Add to Library?",msg:b,buttons:{yes:true,no:true,cancel:false},fn:function(c){if(c=="yes"){var d="";rstore.each(function(e){d=d+e.data.masterid+"|"});BuyOptionsHandler(d,a)}}})}else{Ext.Msg.alert("Problem:","You dont have any job descriptions in your cart.")}}function select_onready(){var localgridheight;if(roles=="newuser"){menu_tb.items.get("tb_mylibrary").disable();localgridheight=gridheight-80;try{document.getElementById("select-inner-left").innerHTML='<div class="GSrightheader">My Library of Descriptions!<\div><span class="GSrighttext">Now that you&acute;ve added descriptions to your order just click the "add to my library" button and you&acute;re ready to save, print, share or customize each of your job descriptions.</span>';document.getElementById("top-left").innerHTML='<div class="GSleftheader">Get started with the master library!<\div><div class="GSlefttext">Welcome to DBDescriptions. Now you&acute;re ready to start previewing and adding job descriptions to your own library. You can sort the lists by clicking on the column you want to sort by. Once you see a description you want, simply click the right arrow to add it to your library. Have fun!</div>'}catch(e){}helpvector=server_addr+"help/getting_started.html"}else{localgridheight=gridheight-33;menu_tb.items.get("tb_mylibrary").enable();helpvector=server_addr+"help/toc.html"}document.getElementById("select-inner-right").innerHTML='<input type="image" id="atml-button" src="'+server_addr+'js/atml.png" onclick="buybut()"></input>';menu_tb.items.get("tb_jd").disable();menu_tb.items.get("tb_tools").disable();if(Ext.isIE||Ext.isIE6||Ext.isIE7||Ext.isIE8){localgridheight=localgridheight-16}var gridLines=Math.floor((localgridheight-85)/22);var lstore=new Ext.data.Store({url:selectLeft,remoteSort:true,reader:new Ext.data.JsonReader({root:"rows",id:"id",totalProperty:"results"},["id","jobtitle","classification","generaldescription",{name:"action1",type:"string"}])});lstore.setDefaultSort("jobtitle","ASC");lstore.load({params:{limit:gridLines,start:0,sort:"jobtitle",dir:"ASC"}});var raction=new Ext.ux.grid.RowActions({header:" ",actions:[{iconCls:"icon-add",tooltip:"Click to add description to shopping cart."}]});var laction=new Ext.ux.grid.RowActions({header:" ",actions:[{iconCls:"icon-delete",tooltip:"Click to remove description from shopping cart."}]});var sum_tpl="Summary: {generaldescription}";var cellTips=new Ext.ux.plugins.grid.CellToolTips([{field:"jobtitle",tpl:sum_tpl},{field:"classification",tpl:sum_tpl}]);gridL=new Ext.grid.GridPanel({store:lstore,cm:new Ext.grid.ColumnModel([{id:"id",header:"ID",sortable:true,dataIndex:"id",hidden:true},{header:"Title",sortable:true,dataIndex:"jobtitle",width:270},{header:"Classification",sortable:true,dataIndex:"classification",width:200},raction]),viewConfig:{forceFit:true},width:500,height:localgridheight,el:"grid-left",trackMouseOver:false,stripeRows:true,title:"<center>Master Library of Job Descriptions</center>",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),bbar:[new Ext.PagingToolbar({pageSize:gridLines,store:lstore})],plugins:[new Ext.ux.grid.Search({mode:"remote",iconCls:true,dateFormat:"m/d/Y",minLength:1}),raction,cellTips]});gridL.on("rowcontextmenu",function(gridl,rowIndex,e){e.stopEvent()});MyRRecordType=Ext.data.Record.create([{name:"action2",type:"string"},"jobtitle","classification","masterid"]);rstore.setDefaultSort("jobtitle","ASC");gridR=new Ext.grid.GridPanel({store:rstore,cm:new Ext.grid.ColumnModel([laction,{header:"Title",width:220,sortable:true,dataIndex:"jobtitle"},{header:"Classification",width:200,sortable:true,dataIndex:"classification"},{header:"Master ID",width:70,sortable:true,dataIndex:"masterid",hidden:true}]),viewConfig:{forceFit:true},width:gridwidth-570,height:localgridheight,el:"grid-right",singleSelect:true,stripeRows:true,trackMouseOver:false,title:"<center>There are 0 Job Descriptions in my shopping cart</center>",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),bbar:[{height:27}],plugins:[new Ext.ux.grid.Search({mode:"local",iconCls:false,dateFormat:"m/d/Y",minLength:1}),laction]});gridR.on("rowcontextmenu",function(gridl,rowIndex,e){e.stopEvent()});var conn=new Ext.data.Connection();conn.request({url:selectDoStuff,params:{action:"GetOld"},success:function(resp,opt){var returnobj=eval("("+resp.responseText+")");for(var i=0;i<returnobj.rows.length;i++){var myrrec=new MyRRecordType({jobtitle:returnobj.rows[i].jobtitle,classification:returnobj.rows[i].classification,masterid:returnobj.rows[i].id});rstore.add(myrrec)}}});gridL.render();gridR.render();laction.on({action:function(grid,record,action,row,col){rstore.remove(record);if(rstore.getCount()==1){gridR.setTitle("<center>There is "+rstore.getCount()+" Job Description in my shopping cart</center>")}else{gridR.setTitle("<center>There are "+rstore.getCount()+" Job Descriptions in my shopping cart</center>")}gridR.getView().refresh()}});raction.on({action:function(grid,record,action,row,col){var conn=new Ext.data.Connection();conn.request({url:selectDoStuff,params:{id:record.data.id,action:"check"},failure:function(f,a){if(a.failureType===Ext.form.Action.CONNECT_FAILURE){Ext.Msg.alert("Failure","Server reported: "+a.response.status+" "+a.response.statusText)}if(a.failureType===Ext.form.Action.SERVER_INVALID){Ext.Msg.alert("Warning",a.result.errormsg)}},success:function(resp,opt){var jdduplist=resp.responseText.split(":")[2].replace("}","");if(jdduplist.length){Ext.MessageBox.confirm("Want to continue?","<center>You have the following job descriptions in your library that<br>are derived from this master job description:<br><br>"+jdduplist+"<br><br>Are you sure you want to continue?</center>",function(btn){if(btn=="yes"){var myrrec=new MyRRecordType({jobtitle:record.data.jobtitle,classification:record.data.classification,masterid:record.data.id});rstore.add(myrrec)}})}else{var myrrec=new MyRRecordType({jobtitle:record.data.jobtitle,classification:record.data.classification,masterid:record.data.id});rstore.add(myrrec)}}})}});rstore.on("add",function(){if(rstore.getCount()==1){gridR.setTitle("<center>There is "+rstore.getCount()+" Job Description in my shopping cart</center>")}else{gridR.setTitle("<center>There are "+rstore.getCount()+" Job Descriptions in my shopping cart</center>")}})}function showhi(a){hi=new Ext.Window({title:"Helpful Info",width:300,autoHeight:true,modal:true,autoLoad:{url:gettooltip,params:{section:a},method:"Post"}}).show()}function showbottom(b){try{document.getElementById("div-info").innerHTML=b}catch(a){}}function radio(b,a){document.getElementById(b+"_master").value=a}function savedata(b,h){var g={};g.status=0;g.pathname=location.pathname;for(var e=0;e<=12;e++){tabpanel.activate(e)}tabpanel.activate(0);var d=Ext.query("SELECT");for(var e in d){g[d[e].name]=d[e].value}var f=Ext.query("TEXTAREA");for(var e in f){g[f[e].name]=f[e].value}var a=Ext.query("INPUT");for(var e in a){if(a[e].type=="text"){g[a[e].name]=a[e].value}if(a[e].type=="checkbox"){g[a[e].name]=a[e].checked?"on":""}if(a[e].type=="hidden"){if(a[e].name.match("_master")){var c=a[e].name.replace("_master","");g[c]=a[e].value}else{g[a[e].name]=a[e].value}}}g.tickleme=EdateField.getRawValue();Ext.Ajax.request({url:editjdsave,success:function(j){Ext.Msg.show({title:"Thank you",msg:"Your job description has been saved.",buttons:Ext.Msg.OK,fn:function(k){if(k=="ok"){if(h==true){window.location=slash}else{window.location.reload()}}}})},failure:function(){Ext.Msg.alert("Save Job Description","Problem. There has been a problem saving your changes.")},params:g})}function editjd_onready(){var c=gridheight-2;menu_tb.items.get("tb_jd").disable();menu_tb.items.get("tb_tools").disable();menu_tb.items.get("tb_mylibrary").disable();var d=gridwidth-86;if(Ext.isIE){var d=gridwidth-56}tabpanel=new Ext.ux.VerticalTabPanel({activeTab:13,tabPosition:"left",textAlign:"right",width:d,height:c-90,bodyBorder:false,tabWidth:240,border:false,defaults:{autoScroll:true},items:[{title:"General",iconCls:"edit-tab",id:"0",html:geneditcontent,tabbtext:"General"},{title:"Duties",iconCls:"edit-tab",id:"1",html:edreditcontent,tabbtext:"Duties",heading:'<div class="northtitleheader">Essential Duties And Responsibilities:</div><div class="northtitletext">List the position\'s essential or most important duties and responsibilities. <b>List only those functions that involve 10% or more of the positions time. List up to 25 functions, ordered from most to least important.</b> Include whether the functions are performed daily, weekly, monthly, annually, or at irregular intervals.</div>'},{title:"Fiscal Responsibilities",iconCls:"edit-tab",id:"2",html:fiscaleditcontent,tabbtext:"Fiscal Responsibilities",heading:'<div class="northtitleheader">Fiscal Responsibilities:</div><div class="northtitletext">Enter amounts in whole Dollars. Do not use Dollar sign, period or commas.</div>'},{title:"Supervisory Responsibilities",iconCls:"edit-tab",id:"3",html:supereditcontent},{title:"Education And Experience",iconCls:"edit-tab",id:"4",html:eaeeditcontent,heading:'<div class="northtitleheader">Education And Experience:</div><div class="northtitletext">Select the <b>minimum level of education and experience needed to successfully accomplish the essential duties of this position.</b> For supervisory positions, select the minimum levels of education, general experience and management experience needed to successfully accomplish the essential duties of this position.</div>'},{title:"Work Skills",iconCls:"edit-tab",id:"5",html:workeditcontent,heading:'<div class="northtitleheader">Work Skills</div><div class="northtitletext">Select the level of work skills needed for each of the following areas to successfully accomplish the essential duties of this position.</div>'},{title:"Certificates, Licenses, Registrations",iconCls:"edit-tab",id:"6",html:clreditcontent,heading:'<div class="northtitleheader">Certificates, Licenses, Registrations:</div><div class="northtitletext">List the licenses, certificates, or registrations that are required or preferred when performing the essential duties of this position. Be sure to differentiate between those that are required and those that are preferred.</div>'},{title:"Contacts With Public and Employees",iconCls:"edit-tab",id:"7",html:contacteditcontent},{title:"Machines, Equipment & Computers",iconCls:"edit-tab",id:"8",html:macheditcontent},{title:"Software Skills Required",iconCls:"edit-tab",id:"9",html:sweditcontent,heading:'<div class="northtitleheader">Software Skills Required:</div><div class="northtitletext">Please check the appropriate box(es) to indicate any software-related computer skills <b>required</b> for this position. If none are required, please place a check next to None at the bottom.</div>'},{title:"Physical Demands",iconCls:"edit-tab",id:"10",html:phyeditcontent},{title:"Work Environment",iconCls:"edit-tab",id:"11",html:workeeditcontent},{title:"Additional Information",iconCls:"edit-tab",id:"12",html:ainfoeditcontent,heading:'<div class="northtitleheader">Additional Information:</div><div class="northtitletext">Include any other information that will aid in the preparation of an accurate description of this position. Please limit your response to four or five written lines if possible.</div>'},{title:"Internal Notes",iconCls:"edit-tab",id:"13",html:notescontent,heading:'<div class="northtitleheader">Internal Notes:</div><div class="northtitletext">These notes are for internal use, and will not be included in the output.</div>'}]});tabpanel.on("tabchange",function(){if(tabpanel.getActiveTab().heading){showbottom(tabpanel.getActiveTab().heading)}else{showbottom('<div class="northtitleheader">'+tabpanel.getActiveTab().title+"</div>")}initInputHighlightScript()});var a=new Ext.Panel({renderTo:"editpanel",height:c,layout:"border",bodyBorder:false,border:false,hideBorders:true,items:[{region:"north",split:false,height:90,bodyBorder:false,border:false,title:"<center>Editing Title: "+jobtitle+" |  Last Modify Date: "+last_modify_date+"</center>",layout:"border",items:[{region:"west",autoScroll:false,width:240,title:"",id:"editjdheaderpanelw",bodyBorder:false,border:false,html:'<center><div id="edittitleheader"><b>Customize Descriptions</b></div><div id="edittitle">Just choose which elements you\'d like to customize from the list on the left.</div></center>'},{region:"center",autoScroll:false,bodyBorder:false,border:false,id:"editjdheaderpanelc",html:'<div id="div-info" class="edit-helpful-info"></div>'}]},{region:"center",bodyBorder:false,border:false,collapsible:false,split:false,autoScroll:false,items:[tabpanel]}]});new Ext.Button({applyTo:"editbut1",text:"Save and Continue Editing",bodyStyle:"padding:20px",handler:function(){savedata(true,false)}});new Ext.Button({applyTo:"editbut3",text:"Save and Exit",handler:function(){savedata(true,true)}});new Ext.Button({applyTo:"editbut5",text:"Cancel",handler:function(){Ext.Msg.show({title:"Abandon Changes?",msg:"Are you sure you want to abandon your changes?",buttons:{yes:true,no:true,cancel:false},fn:function(e){if(e=="yes"){window.location=slash}}})}});initInputHighlightScript();Ext.Ajax.request({url:getareadata,success:function(e){tabpanel.activate(6);document.getElementById("certlicregrequired").value=Ext.util.JSON.decode(e.responseText).certlicregrequired;document.getElementById("certlicregpreferred").value=Ext.util.JSON.decode(e.responseText).certlicregpreferred;tabpanel.activate(12);document.getElementById("additionalinfo").value=Ext.util.JSON.decode(e.responseText).additionalinfo;tabpanel.activate(0);document.getElementById("generaldescription").value=Ext.util.JSON.decode(e.responseText).generaldescription},failure:function(){Ext.Msg.alert("Save Job Description","Problem. There has been a problem loading your data, please refersh.")},params:{pathname:location.pathname}});var b=new Date().clearTime();Ext.DatePicker.prototype.minDate=b;Ext.form.DateField.prototype.minValue=b;Ext.override(Ext.DatePicker,{minDate:(new Date()).clearTime()});EdateField=new Ext.ux.form.DateTime({id:"tickleme",applyTo:"tickleme",hiddenName:"tickleme",name:"tickleme",readOnly:true,dateFormat:"Y-m-d",fieldLabel:"  Deadline",width:100,anchor:"",timePosition:"below",timeConfig:{hidden:true,allowBlank:true},dateConfig:{allowBlank:true,value:tickleme}});setTimeout("",1000)};