
var winp;var loaded=false;var jstore;var jgrid;Ext.onReady(function(){Ext.BLANK_IMAGE_URL='extjs/resources/images/default/s.gif';Ext.QuickTips.init();Ext.apply(Ext.QuickTips.getQuickTip(),{Delay:65000,True:true,animate:true,trackMouse:true});var xuid=new Ext.form.TextField({allowBlank:false,name:'uid',id:'uid',width:200,renderTo:'uidx',enableKeyEvents:true,maskRe:/^[a-zA-Z0-9 -*$._]$/,listeners:{render:function(c){Ext.QuickTips.register({target:c.getEl(),text:"Enter Your UserName Here"});},invalid:function(f,m){var mm=m.toUpperCase();Ext.getCmp('nek').getEl().mask(ReplaceAll(mm,'THIS','USERNAME '),'x-mask-loading');setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},2000);},specialkey:function(f,e){if(e.getKey()==13){Ext.getCmp('pwd').focus();}}}});var xpwd=new Ext.form.TextField({allowBlank:false,name:'pwd',id:'pwd',width:200,renderTo:'pwdx',enableKeyEvents:true,inputType:'password',maskRe:/^[a-zA-Z0-9 -*@$._]$/,listeners:{render:function(c){Ext.QuickTips.register({target:c.getEl(),text:'Enter Your Password Here'});},invalid:function(f,m){var mm=m.toUpperCase();Ext.getCmp('nek').getEl().mask(ReplaceAll(mm,'THIS','PASSWORD '),'x-mask-loading');setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},2000);},specialkey:function(f,e){if(e.getKey()==13){logger();}}}});var logb=new Ext.Button({text:"Login",id:'logbd',tooltip:'Login to the System',disabled:false,iconCls:'icon-user',renderTo:'logdivz',handler:logger});var edtb=new Ext.Button({text:"Edit Login",tooltip:'*** Pls. Enter First your Valid Username and Password*** Edit Login Info such as Username,Password and Email',disabled:false,iconCls:'icon-edit',renderTo:'edtdivz',handler:editlog});var loader=Ext.get('mainlog');loader.dom.innerHTML='';jstore=new Ext.data.Store({url:'joboutxml.cfm',method:'GET',baseParams:{seeks:""},reader:new Ext.data.XmlReader({record:'t5',id:'',totalRecords:"recCount"},['job','tot'])});jgrid=new Ext.grid.GridPanel({id:'jgrid',store:jstore,renderTo:'jobgrid',columns:[new Ext.grid.RowNumberer(),{id:'pos',header:'Position (click to apply)',width:120,align:'left',sortable:false,menuDisabled:true,dataIndex:'job',renderer:function(v){return"<font color=green onMouseOver=this.style.cursor='pointer'>"+v+"</font>";}},{id:'tot',header:'No. of Opening',width:30,sortable:false,menuDisabled:true,dataIndex:'tot'}],stripeRows:true,width:590,height:315,enableColumnMove:false,frame:false,border:false,enableColumnResize:false,autoScroll:true,viewConfig:{forceFit:true},listeners:{beforeedit:function(e){},rowclick:function(grid,rowIndex,e){var xxx=Ext.getCmp('jgrid').getStore().getAt(rowIndex).get('job');xpopup('jws_vwjb.cfm?job='+xxx,'rec1','550','550');}}});jstore.load();var tab1={id:'tab-1',html:'<iframe frameborder="0" width="100%" height="100%" src="aboutus.html"></iframe>',bodyStyle:'padding:0px 0px 0px 0px',title:'<img  src="about.gif">About Us',viewConfig:{layout:'fit'},listeners:'',autoScroll:true}
var tab2={id:'tab-2',contentEl:'jobgrid',bodyStyle:'padding:0px 0px 0px 0px',title:'<img src=mic.gif>Job Openings',autoScroll:false}
var tab3={id:'tab-3',html:'<iframe frameborder="0" width="100%" height="100%" src="contact.html"></iframe>',bodyStyle:'padding:0px 0px 0px 0px',title:'<img src=phone.gif >Contact Us',viewConfig:{layout:'fit'},autoScroll:true}
mainTabPanel=new Ext.TabPanel({id:'nek',renderTo:'mainlog',region:'center',width:608,height:362,margins:'0 0 0 0',defaults:{autoScroll:true},activeTab:0,items:[tab1,tab2,tab3]});function do_play(){var ows=Ext.get('mediaPlayer');ows.stop();}
function playstop(){}
function do_contact(){}
function msgx(){if(!loaded){Ext.example.msg('','Loading Jobs please wait...');loaded=true;}}
function showResultz(btn){document.form1.uid.focus();return false;}
function showResult(btn){if(btn=="yes"){document.form1.submit();}else{return false;}}});String.prototype.flip=function(){splitter=this.split("");revtext=splitter.reverse();reversed=revtext.join("");return reversed;}
function logger(){if(Ext.getCmp('uid').getValue()===""||Ext.getCmp('pwd').getValue()===""){Ext.Msg.alert('<font color=red>JWS</font>','USERNAME AND PASSWORD ARE REQUIRED FIELDS!<br>PLEASE TRY AGAIN.');}else{Ext.getCmp('nek').getEl().mask('<font color=red><b>LOGGING IN.. PLS WAIT!</b></font>','x-mask-loading');setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},50000);Ext.Ajax.request({url:'log_val.cfm?uid='+Ext.getCmp('uid').getRawValue()+'&pwd='+Ext.getCmp('pwd').getRawValue(),method:'GET',success:function(responseObject){var xymsg=xTrim(responseObject.responseText);if(xymsg=="USER SUCCESSFULLY LOGGED!"){document.location='xinside.cfm';}else{setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},100);Ext.Msg.alert('<font color=red>JWS</font>','USERNAME AND PASSWORD INCORRECT!<br>PLEASE TRY AGAIN.');}},failure:function(){setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},100);Ext.Msg.alert('Status','Unable to connect to Server. Call HELPDESK @local 1968 and look for Ms.Kerlie Kabingue for Help.');}});}}
function editlog(){if(Ext.getCmp('uid').getValue()===""||Ext.getCmp('pwd').getValue()===""){Ext.Msg.alert('<font color=red>JWS</font>','USERNAME AND PASSWORD ARE REQUIRED FIELDS FOR EDITING LOGIN INFO!<br>PLEASE TRY AGAIN.');}else{var cfile='change_user.cfm?uid='+Ext.getCmp('uid').getRawValue()+'&pwd='+Ext.getCmp('pwd').getRawValue();var xbt='<iframe width="100%" bgcolor="##ffffff" height="100%" src="'+cfile+'" frameborder="0"></iframe>';if(!winp){winp=new Ext.Window({id:'winen',title:'<FONT COLOR=WHITE>Change User Name</FONT>',width:710,height:470,resizable:false,closable:false,modal:true,layout:'fit',autoScroll:true,bodyStyle:'background:#ffffff',iconCls:'bogus',buttons:[{text:'Close',handler:function(){winp.hide();}}]});winp.html=xbt;winp.show();Ext.get(winp.body.id).update(xbt);}else{winp.html=xbt;winp.show();Ext.get(winp.body.id).update(xbt);}}}
function forgot(){Ext.form.Field.prototype.msgTarget='side';var wforgot=new Ext.Window({title:'Retrieve Password',id:'wforgot_id',resizable:false,closable:false,plain:false,modal:true,height:160,width:480,animateTarget:'4g',autoScroll:true,animeEl:'4g',iconCls:'',layout:'fit',items:[new Ext.FormPanel({id:'frmforgot',labelWidth:140,url:'xforgot.cfm',method:'POST',frame:true,bodyStyle:'padding:5px 5px 0',width:250,defaults:{width:250},items:[{xtype:'textfield',fieldLabel:'Company Email',id:'xeml',name:'xeml',allowBlank:false,enableKeyEvents:true,vtype:'email',listeners:{invalid:function(f,m){var mm=m;bbarstat(ReplaceAll(mm,'This ','EMAIL '),'',2000,'lbr');setTimeout(function(){Ext.getCmp('nek').getEl().unmask();},2000);},specialkey:function(f,e){if(e.getKey()==13){jumper(Ext.getCmp('frmenroll').items.itemAt(1),e)}}}},{xtype:'textfield',fieldLabel:'SSS No.',id:'xsss',name:'xsss',allowBlank:false,enableKeyEvents:true,minLength:10,maxLength:10,maskRe:/^[0-9]$/,listeners:{invalid:function(f,m){var mm=m+' And format should be (8313483888)';bbarstat(ReplaceAll(mm,'This ','SSS '),'',2000,'lbr');},specialkey:function(f,e){if(e.getKey()==13){Ext.getCmp('frmforgotsave').focus();e.stopEvent();}}}}],buttons:[{text:'Retrieve',id:'frmforgotsave',iconCls:'',handler:function(){if(Ext.getCmp('frmforgot').getForm().isValid()){var fp=Ext.getCmp('frmforgot');Ext.getCmp('frmforgot').getForm().submit({waitMsg:'Retrieving.. Pls Wait! ',success:function(fp,o){alert(o.result.file);wforgot.destroy();},failure:function(fp,o){alert(o.result.file);}});}}},{text:'Clear Entry',iconCls:'',handler:function(){Ext.getCmp('frmforgot').getForm().reset()}}]})],listeners:{show:function(window){},hide:function(window){}},bbar:new Ext.StatusBar({defaultText:'',id:'lbr',items:['-',{text:'Close',iconCls:'icon-close',tooltip:'Close',handler:function(){wforgot.destroy();}},'-']})});wforgot.show();}
function getPass(){alert(Ext.getCmp('xeml').getValue().flip());}
function xpopup(url,ctitle,w,h)
{if(w!=""){var ww=w;}else{var ww=screen.width;}
if(h!=""){var hh=h;}else{var hh=screen.height;}
if(h!=""&&w!=""){var left=parseInt((screen.availWidth/2)-(ww/2));var top=parseInt((screen.availHeight/2)-(hh/2));}else{var left=0;var top=0;}
var params='width='+ww+', height='+hh;params+=', top='+top+',left='+left
params+=', resizable=1'
params+=', scrollbars=1'
params+=', menubar=0'
params+=', menubar=no';newwin=window.open(url,ctitle,params);if(window.focus){newwin.focus()}
return false;}
