/* global var for card scanning */ Fse.busCardScanImgName = ''; // SECURITY Fse.handleUnauthorized = function() { $.mobile.changePage("#fse-login-page", { reverse: true }); location.reload(true); } Fse.loginActionURL = function() { var hostName = window.location.hostname; hostName = hostName.toLowerCase(); if (hostName.indexOf("dev.fsenablers.com") != -1) { var loginActionURL = 'http://dev.fsenablers.com/fse/z_appsMaster/mobileapps/crm/actions/actLoginJson.cfm'; } else { var loginActionURL = 'https://www.appslibrary.com/mobileapps/crm/actions/actLoginJson.cfm'; } return loginActionURL; } Fse.submitLogin = function() { document.frmLogin.loginAction.value = 'login'; $('#frmLogin').validate(); if ( !$('#frmLogin').valid() ) { return false; } /* var hostName = window.location.hostname; hostName = hostName.toLowerCase(); if (hostName.indexOf("dev.fsenablers.com") != -1) { var loginActionURL = 'http://dev.fsenablers.com/fse/z_appsMaster/mobileapps/crm/actions/actLoginJson.cfm'; } else { var loginActionURL = 'https://www.appslibrary.com/mobileapps/crm/actions/actLoginJson.cfm'; } */ var loginActionURL = Fse.loginActionURL(); /* Step 1: reset the user CF session. failing to do so can under certain circumstances cause user initialization issues. better to start fresh each time user hits submit. Step 2: get the new session cfid and token information. Step 3: set email username cookie for later login attempts. Step 4: login */ fnSessionResetCallback = function() { fnSessionGetCallback = function(data,status,request) { var frmV1 = request.getResponseHeader("cfid"); var frmV2 = request.getResponseHeader("cftoken"); //var frmUsername = document.frmLogin.username.value; //var frmPassword = document.frmLogin.password.value; //var frmUsername = document.frmLogin.username.value.replace("#","xpoundsignx"); //var frmPassword = document.frmLogin.password.value.replace("#","xpoundsignx"); var frmUsername = encodeURIComponent(document.frmLogin.username.value); var frmPassword = encodeURIComponent(document.frmLogin.password.value); var frmAppname = document.frmLogin.appname.value; var frmFSEvariant = document.frmLogin.FSEvariant.value; fnCookiesetCallback = function() { // uses JSON call to support switch to SSL when hosted on appslibrary.com domain $.getJSON(loginActionURL+'?view=act-login-json&loginAction=login&username='+frmUsername+'&password='+frmPassword+'&v1='+frmV1+'&v2='+frmV2+'&appname='+frmAppname+'&FSEvariant='+frmFSEvariant, function(loginResults) { eval(loginResults.clientScript); }).error(function(jqXHR, textStatus, errorThrown) { alert('Oops! Error with login call...'); } ); } // set username as cookie, then complete login Fse.serverRequest( 'index.cfm?view=set-user-cookie&username=' + frmUsername, undefined, undefined, fnCookiesetCallback ); } Fse.serverRequest( 'index.cfm?view=retrieve-session-identity', undefined, undefined, fnSessionGetCallback ); } Fse.serverRequest( 'index.cfm?view=reset-user-session', undefined, undefined, fnSessionResetCallback ); } Fse.requestPassword = function() { var frmUsername = encodeURIComponent(document.frmLogin.username.value); var frmPassword = encodeURIComponent(document.frmLogin.password.value); var frmAppname = document.frmLogin.appname.value; var frmFSEvariant = document.frmLogin.FSEvariant.value; if (document.frmLogin.username.value == '') { //document.frmLogin.username.focus(); Fse.alert('Password Help','Please enter your email address.'); return false; } else { document.frmLogin.loginAction.value = 'password'; var loginActionURL = Fse.loginActionURL(); $.getJSON(loginActionURL+'?view=act-login-json&loginAction=password&username='+frmUsername+'&password='+frmPassword+'&appname='+frmAppname+'&FSEvariant='+frmFSEvariant, function(loginResults) { eval(loginResults.clientScript); }).error(function(jqXHR, textStatus, errorThrown) { alert('Oops! Error with login call...'); } ); } } Fse.logOut = function() { Fse.emptyPages(); Fse.uploadItemCount = 0; document.frmLogin.loginAction.value = 'logout'; var fnCallback = function() { //$.mobile.changePage("#fse-login-page", { reverse: true, transition: 'slide' }); /* original - truncated scroll */ //$.mobile.changePage("#fse-login-page", { transition: 'fade', changeHash: false }); /* hit drop down, login page shows */ //$.mobile.changePage("#fse-login-page", { reverse: true, transition: 'none' }); /* truncated scroll */ //$.mobile.changePage("#fse-login-page", { reverse: false, transition: 'none' }); /* truncated scroll */ //$.mobile.changePage("#fse-login-page"); /* login page shows */ $.mobile.changePage("#fse-login-page", { reverse: true, transition: 'slide', changeHash: false }); /* */ } Fse.serverRequest( 'index.cfm?do=act-login', undefined, undefined, fnCallback, 'frmLogin', 'post' ); } // VOICE Fse.showVoiceCommand = function() { Fse.setTitle('Voice Command'); $("#main-menu-collapsible").addClass('main-menu-hide'); $("#footer-master-page").addClass('footer-bar-hide'); var callBack = function() { //$("#voic-cmd-results-socket").html('
Hi, what can I help you with?
CRM Assist
'); } Fse.emptyPages('generic'); Fse.loadSocket('reset','index.cfm?app=voic&view=page-voic-search', undefined, callBack); } Fse.submitVoiceCommand = function() { var fnCallback = function(data,status,request) { var speakCallback = function() { eval(request.getResponseHeader("FSECommandHandler")); } if (request.getResponseHeader("FSEVoiceResponse") > '') { if (navigator["userAgent"].indexOf('FSE:native=true') >= 0 ) { if( window["FSEAndroid"] ) { speakString( request.getResponseHeader("FSEVoiceResponse"), speakCallback ); } else { FSEAPI.voice.speak({ text: request.getResponseHeader("FSEVoiceResponse"), // List of voices at http://dragonmobile.nuancemobiledeveloper.com/public/index.php?task=supportedLanguages voice: "Samantha" // Defaults to Samantha. Tom option. }, speakCallback); } } else { alert(request.getResponseHeader("FSEVoiceResponse")); speakCallback(); } } else { speakCallback(); } } Fse.serverRequest('index.cfm?app=voic&view=voic-cmd-process','voic-cmd-results-socket',undefined,fnCallback,'frmSrchVoice','get','force'); document.getElementById('goFocusPointVoicSrch').focus(); window.scrollTo(0,0); } Fse.justSayIt = function(sayWhat) { if (navigator["userAgent"].indexOf('FSE:native=true') >= 0 ) { FSEAPI.voice.speak({ text: sayWhat, voice: "Samantha" }); } else { alert(sayWhat); } } // PRODUCTS Fse.submitProdSearch = function( stPage, skuId ) { document.frmsrchprd.upc.value = ''; if ( document.frmsrchprd.keyWord.value == '' && ( document.frmsrchprd.mfrKeyword == undefined || document.frmsrchprd.mfrKeyword.value == '') && ( document.frmsrchprd.favProductsChkbx == undefined || !document.frmsrchprd.favProductsChkbx.checked) && ( document.frmsrchprd.focusProductsChkbx == undefined || !document.frmsrchprd.focusProductsChkbx.checked) && ( document.frmsrchprd.dotProductsChkbx == undefined || !document.frmsrchprd.dotProductsChkbx.checked) && ( document.frmsrchprd.fsrProductsChkbx == undefined || !document.frmsrchprd.fsrProductsChkbx.checked) && ( document.frmsrchprd.plProductsChkbx == undefined || !document.frmsrchprd.plProductsChkbx.checked) && ( document.frmsrchprd.affiliationId == undefined || document.frmsrchprd.affiliationId.selectedIndex == 0) && ( document.frmsrchprd.customerId == undefined || document.frmsrchprd.customerId.selectedIndex == 0) && ( document.frmsrchprd.prodId == undefined || document.frmsrchprd.prodId.selectedIndex == 0) && ( document.frmsrchprd.categoryId == undefined || document.frmsrchprd.categoryId.selectedIndex == 0) && ( document.frmsrchprd.oprProgram == undefined || document.frmsrchprd.oprProgram.selectedIndex == 0) && ( document.frmsrchprd.mfrId == undefined || document.frmsrchprd.mfrId.selectedIndex == 0 ) && ( document.frmsrchprd.brandId == undefined || document.frmsrchprd.brandId.selectedIndex == 0 ) && ( document.frmsrchprd.MFRID == undefined || document.frmsrchprd.MFRID.value == '' ) ) { $('#prd-search-results-socket').html('

provide additional search criteria
to view results

'); //Fse.toggleFilterDisplay('prd-filter-selections','close'); //Fse.serverRequest('index.cfm?app=prd&view=prd-selected-criteria', 'prd-search-criteria-dsp-socket', undefined, undefined, 'frmsrchprd', 'get', 'force'); $('#prd-search-criteria-dsp-socket').html(''); } else { if (stPage == 1) { $('#prd-search-results-socket').html(''); } var callBack = function() { if (stPage == 1) { Fse.serverRequest('index.cfm?app=prd&view=search-criteria', 'prd-search-criteria-dsp-socket', undefined, undefined, 'frmsrchprd', 'get', 'force'); } window.scrollTo(0,0); } Fse.serverRequest('index.cfm?app=prd&view=search-results&pg='+stPage,'prd-search-results-socket',undefined,callBack,'frmsrchprd','get','force'); } } Fse.clearPrdSrchFrm = function(submitForm) { if (submitForm == undefined) { submitForm = false; } if(document.frmsrchprd.keyWord) { document.frmsrchprd.keyWord.value = '' }; if(document.frmsrchprd.mfrKeyword) { document.frmsrchprd.mfrKeyword.value = '' }; $("#favProductsChkbx").attr("checked",false).checkboxradio("refresh"); $("#focusProductsChkbx").attr("checked",false).checkboxradio("refresh"); $("#dotProductsChkbx").attr("checked",false).checkboxradio("refresh"); $("#fsrProductsChkbx").attr("checked",false).checkboxradio("refresh"); $("#plProductsChkbx").attr("checked",false).checkboxradio("refresh"); $("#showDiscontinuedChkbx").attr("checked",false).checkboxradio("refresh"); if( document.frmsrchprd.affiliationId ) { document.frmsrchprd.affiliationId.selectedIndex=0; $('#affiliationId').selectmenu('refresh'); } if( document.frmsrchprd.customerId ) { document.frmsrchprd.customerId.selectedIndex=0; $('#customerId').selectmenu('refresh'); } if( document.frmsrchprd.prodId) { document.frmsrchprd.prodId.selectedIndex=0; $('#prodId').selectmenu('refresh'); } if( document.frmsrchprd.categoryId) { document.frmsrchprd.categoryId.selectedIndex=0; $('#categoryId').selectmenu('refresh'); } if( document.frmsrchprd.oprProgram) { document.frmsrchprd.oprProgram.selectedIndex=0; $('#oprProgram').selectmenu('refresh'); } if( document.frmsrchprd.mfrId) { document.frmsrchprd.mfrId.selectedIndex=0; $('#mfrId').selectmenu('refresh'); } if( document.frmsrchprd.MFRID) { Fse.clrAutoSrchById("af-mfr-prdsrch"); } if( document.frmsrchprd.brandId) { document.frmsrchprd.brandId.selectedIndex=0; $('#brandId').selectmenu('refresh'); } if( document.frmsrchprd.favCat) { document.frmsrchprd.favCat.selectedIndex=0; $('#favCat').selectmenu('refresh'); $('#pc-fav-cats').hide(); } if( document.frmsrchprd.tradeChannel ) { document.frmsrchprd.tradeChannel.selectedIndex=0; $('#tradeChannel').selectmenu('refresh'); } if (submitForm) { Fse.submitProdSearch(1); } } Fse.submitUPCSearch = function( upcValue ) { // scan from prod search form Fse.clearPrdSrchFrm(); document.frmsrchprd.upc.value = upcValue; var callBack = function() { document.getElementById('gofocuspointprdsrch').focus(); window.scrollTo(0,0); Fse.toggleFilterDisplay('prd-filter-selections','close'); //Fse.serverRequest('index.cfm?app=prd&view=prd-selected-criteria', 'prd-search-criteria-dsp-socket', undefined, undefined, 'frmsrchprd', 'get', 'force'); $('#prd-search-criteria-dsp-socket').html(''); } Fse.serverRequest('index.cfm?app=prd&view=search-results','prd-search-results-socket',undefined,callBack,'frmsrchprd','get','force'); } Fse.captureUPCScan = function( upcValue ) { // scan from main menu tools area Fse.loadSocket('page-prdsrch-socket','index.cfm?app=prd&view=page-prd-search&upc='+upcValue,'force');Fse.toggleMainMenu(); } Fse.showProdImage = function(skuid,fileId,loadMode) { if (fileId == undefined) { fileId = '' }; Fse.serverRequest('index.cfm?app=prd&view=prd-photos&skuid='+skuid+'&fileId='+fileId, 'photos-socket', undefined, undefined, undefined, undefined, loadMode); } Fse.showRelatedRecipes = function(sku,page,mfrid) { if (page==undefined) { page='1' }; Fse.serverRequest( 'index.cfm?app=prd&view=prd-recipes&sku='+sku+'&pg='+page+'&mfrid='+mfrid, 'recipes-socket' ); } Fse.showRecipeDetail = function(recipeId) { var callBack = function() { Fse.hideShow('recipes-socket','recipe-detail-socket'); } Fse.serverRequest( 'index.cfm?app=prd&view=prd-recipe-detail&recid='+recipeId, 'recipe-detail-socket', undefined, callBack ); } // ACCOUNTS Fse.submitAcctSearch = function( stPage ) { var setCriteriaDisplay = function() { if (stPage == 1) { Fse.serverRequest('index.cfm?app=acct&view=search-criteria', 'acct-search-criteria-dsp-socket', undefined, undefined, 'frmsrchacct', 'get', 'force'); } window.scrollTo(0,0); } /* if ( !document.frmsrchacct.nearMe.checked && !document.frmsrchacct.myRelationships.checked && !document.frmsrchacct.myFavorites.checked && document.frmsrchacct.keyWord.value == '' && ( !document.frmsrchacct.contractStatus || document.frmsrchacct.contractStatus.selectedIndex == 0) && ( !document.frmsrchacct.myOpenERFs || !document.frmsrchacct.myOpenERFs.checked ) && ( !document.frmsrchacct.oprListId || document.frmsrchacct.oprListId.selectedIndex == 0) && ( !document.frmsrchacct.lastInteractionDays || document.frmsrchacct.lastInteractionDays.selectedIndex == 0) ) { setCriteriaDisplay(); $('#acct-search-results-socket').html('

..provide additional search criteria
to view results

'); */ if (1==2) { // min criteria check now handled server side } else { if (stPage == 1) { $('#acct-search-results-socket').html(''); } if (document.frmsrchacct.nearMe.checked) { if (document.frmsrchacct.zipcode.value == '') { var callBack = function(zip,latLong) { document.frmsrchacct.zipcode.value=zip; document.frmsrchacct.latLong.value=latLong; document.frmsrchacct.sortOrder.selectedIndex=2; $('#sortOrder').selectmenu('refresh'); Fse.serverRequest('index.cfm?app=acct&view=search-results&pg='+stPage,'acct-search-results-socket',undefined,setCriteriaDisplay,'frmsrchacct','get','force'); //document.getElementById('gofocuspointacctsrch').focus(); } Fse.getCurrentZipcode(callBack); } else { Fse.serverRequest('index.cfm?app=acct&view=search-results&pg='+stPage,'acct-search-results-socket',undefined,setCriteriaDisplay,'frmsrchacct','get','force'); //document.getElementById('gofocuspointacctsrch').focus(); } } else { if (document.frmsrchacct.sortOrder.selectedIndex == 2) { document.frmsrchacct.sortOrder.selectedIndex=0; $('#sortOrder').selectmenu('refresh'); } document.frmsrchacct.zipcode.value=''; document.frmsrchacct.latLong.value=''; Fse.serverRequest('index.cfm?app=acct&view=search-results&pg='+stPage,'acct-search-results-socket',undefined,setCriteriaDisplay,'frmsrchacct','get','force'); //document.getElementById('gofocuspointacctsrch').focus(); } } } Fse.clearAcctSrchFrm = function(submitForm) { if (submitForm == undefined) { submitForm = false; } if(document.frmsrchacct.keyWord) { document.frmsrchacct.keyWord.value = '' }; $("#myRelationships").attr("checked",false).checkboxradio("refresh"); $("#myOpenERFs").attr("checked",false).checkboxradio("refresh"); $("#nearMe").attr("checked",false).checkboxradio("refresh"); $("#myFavorites").attr("checked",false).checkboxradio("refresh"); if( document.frmsrchacct.terScope ) { document.frmsrchacct.terScope.selectedIndex=0; $('#terScope').selectmenu('refresh'); } if( document.frmsrchacct.contractStatus ) { document.frmsrchacct.contractStatus.selectedIndex=0; $('#contractStatus').selectmenu('refresh'); } if( document.frmsrchacct.sortOrder ) { document.frmsrchacct.sortOrder.selectedIndex=0; $('#sortOrder').selectmenu('refresh'); } if( document.frmsrchacct.oprListId ) { document.frmsrchacct.oprListId.selectedIndex=0; $('#oprListId').selectmenu('refresh'); } if( document.frmsrchacct.lastInteractionDays ) { document.frmsrchacct.lastInteractionDays.selectedIndex=0; $('#lastInteractionDays').selectmenu('refresh'); } if( document.frmsrchacct.gpoAffiliationId ) { document.frmsrchacct.gpoAffiliationId.selectedIndex=0; $('#gpoAffiliationId').selectmenu('refresh'); } if( document.frmsrchacct.cmcAffiliationId ) { document.frmsrchacct.cmcAffiliationId.selectedIndex=0; $('#cmcAffiliationId').selectmenu('refresh'); } $("#partnerType-all").prop("checked",true); $("#priority-all").prop("checked",true); $("#priority-ap").prop("checked",false); $("#priority-a").prop("checked",false); $("#priority-b").prop("checked",false); $("#priority-c").prop("checked",false); $("#priority-d").prop("checked",false); if (submitForm) { Fse.submitAcctSearch(1); } } Fse.showCallDetail = function( callId ) { var fnCallback = function() { Fse.hideShow('socket-acct-call-list','socket-acct-call-detail'); Fse.initDrawCanvas('canvasSignature', 'canvasDiv'); } Fse.serverRequest('index.cfm?app=acct&view=acct-call-detail&id='+callId,'socket-acct-call-detail',undefined,fnCallback); } Fse.showAcctDetail = function( partnerIdType, pagerPress ) { var _partnerIdType = partnerIdType.split('|'); if ( pagerPress == undefined ) { pagerPress = false; } if (pagerPress) { var socketId = 'current'; } else { var socketId = 'next'; } var fnCallBack = function() { //addressStr = $('#map_canvas').attr( 'FSE:address' ); //Fse.mapAddress( addressStr ); //Fse.getDirections( addressStr ); } Fse.dirtyRecentActivity(); Fse.loadSocket(socketId,'index.cfm?app=acct&view=page-acct-detail&partnerid='+_partnerIdType[0]+'&partnertype='+_partnerIdType[1]); } Fse.showOppDetail = function( oppId ) { var fnCallback = function() { Fse.hideShow('socket-acct-opp-list','socket-acct-opp-detail'); //window.scrollTo(0,$('#socket-acct-opp-detail').offset().top); } Fse.serverRequest('index.cfm?app=acct&view=acct-opp-detail&id='+oppId,'socket-acct-opp-detail',undefined,fnCallback); } Fse.showOrderHistoryOBSOLETE = function( partnerId, pgNum ) { Fse.serverRequest('index.cfm?app=acct&view=acct-order-history&partnerid='+partnerId+'&pg='+pgNum, 'order-history-socket', undefined, undefined, 'frmOrdFilter', 'get', 'force'); } Fse.showOrderDetailOBSOLETE = function( orderId ) { var callBack = function() { Fse.hideShow('order-history-socket','order-detail-socket'); } Fse.serverRequest('index.cfm?app=acct&view=acct-order-detail&orderid='+orderId,'order-detail-socket',undefined,callBack); } Fse.getAcctPresentations = function(skuId,stPage) { Fse.serverRequest('index.cfm?app=prd&view=prd-acct-presentation-results&skuid='+skuId+'&pg='+stPage,'acct-presentation-results',undefined,undefined,'frmPresFilter','get','force'); document.getElementById('goFocusPointPresFilter').focus(); } Fse.getAcctCalls = function(stPage,goTop) { if (goTop==undefined) { goTop = true; } var callBack = function() { if (goTop) { window.scrollTo(0,$('#socket-acct-call-list').offset().top); } } Fse.serverRequest('index.cfm?app=acct&view=acct-sales-call-results&pg='+stPage,'acct-sales-call-results',undefined,callBack,'frmCallFilter','get','force'); } // new generic version of Fse.showAccountNotes Fse.showPartnerNotes = function( partnerType, partnerId, pageNum ) { if (pageNum==undefined) { pageNum = '1' }; var callBack = function() { Fse.scrollTo(($("#div-partner-notes-"+partnerType+partnerId).offset().top)-100); } if (document.getElementById('frmNoteFilter-'+partnerType+partnerId) !==null) { Fse.serverRequest('index.cfm?app=notes&view=partner-notes&partnerid='+partnerId+'&partnertype='+partnerType+'&pg='+pageNum, 'partner-notes-'+partnerType+partnerId, undefined, callBack, 'frmNoteFilter-'+partnerType+partnerId, 'GET', 'force') } else { Fse.serverRequest('index.cfm?app=notes&view=partner-notes&partnerid='+partnerId+'&partnertype='+partnerType+'&pg='+pageNum, 'partner-notes-'+partnerType+partnerId, undefined, callBack, undefined, undefined, 'force') } } Fse.refreshAcctNotesCallback = function( partnerType, partnerId, postId ) { var callBack1 = function() { Fse.ajaxRequest( { urlString: 'index.cfm?app=acct&view=acct-profile-summary&partnerid='+partnerId+'&partnertype='+partnerType, socketId: 'profile-summary-'+partnerType+partnerId, loadMode: 'force', callBack: callBack2 }); } var callBack2 = function() { Fse.showPage(); } Fse.ajaxRequest( { urlString: 'index.cfm?app=notes&view=partner-notes&partnertype='+partnerType+'&partnerid='+partnerId, socketId: 'partner-notes-'+partnerType+partnerId, loadMode: 'force', callBack: callBack1 }); } Fse.refreshPartnerNotesCallback = function( partnerType, partnerId, postId ) { Fse.ajaxRequest( { socketId: 'partner-notes-'+partnerType+partnerId, loadMode: 'refresh' }); Fse.showPage(); } Fse.acctCaptionSubmit = function(partnerType,partnerId) { fnCallBack = function() { $('#btn-caption-save').addClass('ui-disabled'); Fse.ajaxRequest({ socketId: 'profile-summary-'+partnerType+partnerId, loadMode: 'refresh' }) } Fse.serverRequest('index.cfm?app=acct&do=acct-update-caption', undefined, undefined, fnCallBack, 'frmCaption'+partnerType+partnerId, 'post'); document.getElementById('goFocusPointCaption').focus(); } // OBJECTIVES Fse.loadObjectiveList = function( groupId ) { var fnCallback = function() { window.location.hash='grp-header-'+groupId; } Fse.serverRequest('index.cfm?app=obj&view=obj-group-list&grp='+groupId, 'socket-obj-list-'+groupId, undefined, fnCallback, 'frmSrchObj', 'get'); } Fse.showObjDetail = function( grpId, objId, repId ) { var fnCallback = function() { Fse.hideShow('socket-obj-list-'+grpId,'socket-obj-detail-'+grpId); //window.location.hash='grp-header-'+grpId; } Fse.serverRequest('index.cfm?app=obj&view=obj-call-detail&objid='+objId+'&grpid='+grpId+'&repId='+repId,'socket-obj-detail-'+grpId,undefined,fnCallback,'frmSrchObj','get'); } // HOME Fse.setTitle = function(titleText) { if (titleText == undefined) { titleText = $('#main-title-bar').attr('FSE:apptitle'); }; if ( window.getComputedStyle(document.getElementById('responsive-state-info'), null).getPropertyValue('width') == '0px' ) { $('#main-title-bar').html(titleText); } } Fse.goHome = function() { Fse.nextPageNum = 1; $('#main-menu-div').trigger('expand'); $("#main-menu-collapsible").removeClass('main-menu-hide'); $("#right-panel").addClass('main-menu-hide'); Fse.setTitle(); } Fse.hideHome = function() { $('#main-menu-div').trigger('expand'); $("#main-menu-collapsible").addClass('main-menu-hide'); $("#right-panel").removeClass('main-menu-hide'); } Fse.loadRecentActivity = function() { var _socketId = 'recent-activity-socket-' + Fse.getResponsiveState(); if ( $('[id='+_socketId+']').length == 0 ) { _socketId = 'recent-activity-socket' // old school } Fse.serverRequest('index.cfm?view=home-recent-activity',_socketId,undefined,undefined,undefined,undefined,'force'); } Fse.dirtyRecentActivity = function() { var _socketId = 'recent-activity-div-' + Fse.getResponsiveState(); if ( $('[id='+_socketId+']').length == 0 ) { _socketId = 'recent-activity-div' // old school } $('#'+_socketId).attr('FSE:lazyLoaded', 'false'); } Fse.loadMyAlerts = function(loadMode) { if (loadMode==undefined) { loadMode = 'now'; } // now or conditional (now if open, diry socket of collapsed) var _socketId = 'my-alerts-socket-' + Fse.getResponsiveState(); var _divId = 'my-alerts-div-' + Fse.getResponsiveState(); if (loadMode=='now' || !$('#'+_divId).hasClass('ui-collapsible-collapsed')) { Fse.serverRequest('index.cfm?view=home-my-alerts',_socketId,undefined,undefined,undefined,undefined,'force'); } else { Fse.dirtyMyAlerts(); } } Fse.dirtyMyAlerts = function() { var _socketId = 'my-alerts-div-' + Fse.getResponsiveState(); $('#'+_socketId).attr('FSE:lazyLoaded', 'false'); } Fse.toggleMainMenu = function(restoreContent, showOverride) { // if page has modal class, disable home button. makes page more modal-like if you can't get home. if ( $("#"+Fse.currentPageSocket).find(".detail-pg-banner-modal").length > 0 ) { return false; } if (restoreContent == undefined) { restoreContent = false }; if (showOverride == undefined) { showOverride = false }; if ($("#main-menu-collapsible").hasClass('main-menu-hide') || showOverride == true) { if (!$("#main-menu-collapsible").hasClass('main-menu-hide')) { // if user already on main menu and hits home btn again, then expand the main menu options $('#main-menu-div').trigger('expand'); //give a visual clue that they are on home page already by hiding and fading back in $("#main-menu-collapsible").hide(); $("#main-menu-collapsible").fadeIn(); $("#main-menu-collapsible").attr("style",""); } $("#footer-master-page").removeClass('footer-bar-hide'); $("#main-menu-collapsible").removeClass('main-menu-hide'); window.scrollTo(0,0); $("#right-panel").addClass('main-menu-hide'); Fse.setTitle(); } else { $("#main-menu-collapsible").addClass('main-menu-hide'); // if toggling from header bar, restore right panel, otherwise, let loadsocket do it to reduce screen flash if (restoreContent) { $("#right-panel").removeClass('main-menu-hide'); } $("#footer-master-page").addClass('footer-bar-hide'); } } Fse.mainMenuShowing = function() { return !$("#main-menu-collapsible").hasClass('main-menu-hide'); } Fse.loadMainMenu = function(fnCallback) { Fse.serverRequest('index.cfm?view=home-main-navigation','main-navigation-socket','fse-master-page',fnCallback,undefined,undefined,'force'); } //CONTACTS Fse.submitContactSearch = function( stPage ) { var _conType = document.frmsrchcont.contactType[document.frmsrchcont.contactType.selectedIndex].value; if ( ( _conType != 'STF' && _conType != 'BROSTF' ) && ( document.frmsrchcont.keyWord == undefined || document.frmsrchcont.keyWord.value == '') && ( document.frmsrchcont.companyKeyword == undefined || document.frmsrchcont.companyKeyword.value == '') && ( document.frmsrchcont.territoryId == undefined || document.frmsrchcont.territoryId.selectedIndex == 0) ) { $('#cont-search-results-socket').html('

provide additional search criteria
to view results

'); $('#cont-search-criteria-dsp-socket').html(''); Fse.serverRequest('index.cfm?app=cont&view=search-results&savesettingsonly=true',undefined,undefined,undefined,'frmsrchcont','get','force'); window.scrollTo(0,0); return false; } if (stPage == 1) { $('#cont-search-results-socket').html(''); } var callBack = function() { if (stPage == 1) { Fse.serverRequest('index.cfm?app=cont&view=search-criteria', 'cont-search-criteria-dsp-socket', undefined, undefined, 'frmsrchcont', 'get', 'force'); } window.scrollTo(0,0); if (document.frmsrchcont.startsWith) { document.frmsrchcont.startsWith.value = ''; } } Fse.serverRequest('index.cfm?app=cont&view=search-results&pg='+stPage,'cont-search-results-socket',undefined,callBack,'frmsrchcont','get','force'); } Fse.clearContSrchFrm = function(submitForm) { if(submitForm == undefined) { submitForm = false; } if(document.frmsrchcont.keyWord) { document.frmsrchcont.keyWord.value = '' }; if(document.frmsrchcont.companyKeyword) { document.frmsrchcont.companyKeyword.value = '' }; /*if( document.frmsrchcont.contactType ) { document.frmsrchcont.contactType.selectedIndex=0; $('#contactType').selectmenu('refresh'); }*/ $("#contactType option").each(function(i){ if ($(this).val() == 'STF') { document.frmsrchcont.contactType.selectedIndex=i; $('#contactType').selectmenu('refresh'); } }); if( document.frmsrchcont.territoryId ) { document.frmsrchcont.territoryId.selectedIndex=0; $('#territoryId').selectmenu('refresh'); } if (submitForm) { Fse.submitContactSearch(1); } } Fse.contactDelete = function(contactId,token,partnerId) { var callBack = function() { Fse.ajaxRequest( { socketId: 'acct-contacts'+partnerId, loadMode: 'refresh', callBack: function(){Fse.showPage();} } ); } Fse.ajaxRequest( { urlString: "index.cfm?app=cont&do=contact-delete&contactId="+contactId+"&tk="+token, reqType: "post", callBack: callBack }); } // MAPPING Fse.nearbyLocations = function(latitude,longitude,zipcode,nearbySocket,callBack,partnerId,partnerType) { // new version of Fse.mapNearBy if (!partnerId) { partnerId = '?' }; if (!partnerType) { partnerType = '?' }; var fnCallback = function(data,status,request) { //alert(request.getResponseHeader("FSEnearby-locations")); //return true; var placesStr = request.getResponseHeader("FSEnearby-locations"); if (callBack) { callBack( placesStr ); } } Fse.serverRequest('index.cfm?app=map&view=nearby-locations&lat='+latitude+'&lng='+longitude+'&zipcode='+zipcode+'&partnerId='+partnerId+'&partnerType='+partnerType,nearbySocket,undefined,fnCallback,undefined,undefined,'force'); } Fse.showNearMe_archive021217 = function(mapSocket,nearSocket) { var s = document.getElementById(mapSocket); s.contentDocument.documentElement.innerHTML="
loading...
"; s.contentDocument.close(); var fnCallback = function( _zipcode, _latlon ) { var _arLatLon = _latlon.split(','); var fnNearCallback = function(places) { places = encodeURIComponent(places); document.getElementById(mapSocket).src='about:blank';document.getElementById(mapSocket).src='index.cfm?app=map&view=location-map&lat='+_arLatLon[0]+'&lng='+_arLatLon[1]+'&mapPlaces='+places; } Fse.nearbyLocations( _arLatLon[0],_arLatLon[1],_zipcode,nearSocket,fnNearCallback ); } Fse.getCurrentZipcode(fnCallback); } Fse.showNearMe = function(mapSocket,nearSocket) { var s = document.getElementById(mapSocket); s.contentDocument.documentElement.innerHTML="
loading...
"; s.contentDocument.close(); var fnCallback = function( _lat, _lon, _zipcode ) { var fnNearCallback = function(places) { places = encodeURIComponent(places); document.getElementById(mapSocket).src='about:blank';document.getElementById(mapSocket).src='index.cfm?app=map&view=location-map&lat='+_lat+'&lng='+_lon+'&mapPlaces='+places; } Fse.nearbyLocations( _lat,_lon,_zipcode,nearSocket,fnNearCallback ); } Fse.getCurrentLocation(fnCallback,true); } Fse.showNearAcct = function(mapSocket,nearSocket,addressString,partnerId,partnerType) { var s = document.getElementById(mapSocket); s.contentDocument.documentElement.innerHTML="
loading...
"; s.contentDocument.close(); var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': addressString }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var _latitude = results[0].geometry.location.lat(); var _longitude = results[0].geometry.location.lng(); var fnNearCallback = function(places) { places = encodeURIComponent(places); document.getElementById(mapSocket).src='about:blank';document.getElementById(mapSocket).src='index.cfm?app=map&view=location-map&lat='+_latitude+'&lng='+_longitude+'&partnerId='+partnerId+'&partnerType='+partnerType+'&mapPlaces='+places; } $("#"+nearSocket).empty(); Fse.nearbyLocations( _latitude,_longitude,undefined,nearSocket,fnNearCallback,partnerId,partnerType ); } else { alert("Unable to locate address at this time: " + status); } }); } Fse.showAcctDirections = function(mapSocket,dirSocket,destAddress) { // this builds the map in the ifrmae var fnCallback = function( _zipcode, _latlon ) { var _arLatLon = _latlon.split(','); document.getElementById(mapSocket).src='about:blank';document.getElementById(mapSocket).src='index.cfm?app=map&view=location-directions&lat='+_arLatLon[0]+'&lng='+_arLatLon[1]+'&destAddress='+destAddress; Fse.showAcctDirectionsSteps(dirSocket,_arLatLon[0],_arLatLon[1],destAddress); } Fse.getCurrentZipcode(fnCallback); } Fse.showAcctDirectionsSteps = function(dirSocket,lat,lng,destAddress) { // this builds directions steps in div. did it iframe step and updated parent but // styling didn't carry through. directions doesn't appear to have memory leaks, so ok to do here var acctDirectionsService = new google.maps.DirectionsService(); var acctDirectionsDisplay = new google.maps.DirectionsRenderer(); acctDirectionsDisplay.setPanel(document.getElementById(dirSocket)); var request = { origin: new google.maps.LatLng(lat,lng), destination: destAddress, travelMode: google.maps.TravelMode.DRIVING }; acctDirectionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { $("#"+dirSocket).empty(); acctDirectionsDisplay.setDirections(response); } else { alert('Could not get directions: '+status); } }); } Fse.getCurrentZipcode_Save101216 = function(callBack) { $.mobile.showPageLoadingMsg(); var callBackCalled = false; // was calling callback multiple times with watch logic var updateLocation = navigator.geolocation.watchPosition(function(pos){ var latVal = pos.coords.latitude; var longVal = pos.coords.longitude; var point = new google.maps.LatLng(latVal, longVal); new google.maps.Geocoder().geocode({'latLng': point}, function (res, status) { var zip = res[0].formatted_address.match(/,\s\w{2}\s(\d{5})/); $.mobile.hidePageLoadingMsg(); navigator.geolocation.clearWatch(updateLocation); updateLocation = null; point = null; if (callBack && !callBackCalled) { callBack(zip[1],latVal+','+longVal); callBackCalled = true; } }); }); } Fse.getCurrentZipcode = function(callBack) { /* scrum 18487 - near me not working. as of iOS 10, had to move this function to a secured iframe. */ document.getElementById('location-services').contentWindow.Fse.getCurrentZipcode(callBack); } Fse.getCurrentLocation = function(callBack,includeZipCode) { /* scrum 18487 - near me not working. as of iOS 10, had to move this function to a secured iframe. */ //document.getElementById('location-services').contentWindow.Fse.getCurrentLocation(callBack,includeZipCode); var fnFirstRoundCallback = function() { document.getElementById('location-services').contentWindow.Fse.getCurrentLocation(callBack,includeZipCode); } document.getElementById('location-services').contentWindow.Fse.getCurrentLocation(fnFirstRoundCallback,false); } Fse.resizeMap = function(iframeId, mapSize) { if ( mapSize == 'large' ) { var headerHeight = $('#home-header').height(); $('#'+iframeId).attr('FSE:smallMapHeight',$('#'+iframeId).height()); window.scrollTo(0,0); document.getElementById(iframeId).contentWindow.initLocationMap('0'); $('#'+iframeId).css('position', 'absolute'); $('#'+iframeId).css('left', '0px'); $('#'+iframeId).css('top', headerHeight+'px'); $('#'+iframeId).css('height', $(window).height()-headerHeight+'px'); document.getElementById(iframeId).contentWindow.initLocationMap(); document.getElementById(iframeId).contentWindow.Fse.setAccountMapOptions({gestureHandling: 'greedy', zoomControl: true, streetViewControl: true, mapTypeControl: true}); $('#'+iframeId+'-large-options').show(); } else { var reducedHeight = $('#'+iframeId).attr('FSE:smallMapHeight'); if (document.getElementById(iframeId) && document.getElementById(iframeId).contentWindow._accountMap) { document.getElementById(iframeId).contentWindow.initLocationMap(reducedHeight); // order important - resize iframe contents first document.getElementById(iframeId).contentWindow.Fse.setAccountMapOptions({gestureHandling: 'cooperative', zoomControl: false, streetViewControl: false, mapTypeControl: false}); } $('#'+iframeId).css('position', 'relative'); $('#'+iframeId).css('left', '0px'); $('#'+iframeId).css('top', '0px'); $('#'+iframeId).css('height', reducedHeight+'px'); $('#'+iframeId+'-large-options').hide(); } } // BAR CODE SCANNING Fse.submitBarcodeUPC = function(upc) { var partnerId = document.frmScan.partnerid.value; var partnerType = document.frmScan.partnertype.value; document.frmScan.upc.value = upc; var callBack = function() { Fse.serverRequest('index.cfm?app=acct&view=competitive-intel&partnerid='+partnerId+'&partnerType='+partnerType, 'competitive-socket', undefined, undefined, undefined, undefined, 'force') } Fse.serverRequest('index.cfm?app=acct&do=upload-UPC-scan', undefined, undefined, callBack, 'frmScan', 'post'); } Fse.updateBarcodeUPC = function(formID) { var partnerId = document.frmScan.partnerid.value; var partnerType = document.frmScan.partnertype.value; var callBack = function() { Fse.serverRequest('index.cfm?app=acct&view=competitive-intel&partnerid='+partnerId+'&partnerType='+partnerType, 'competitive-socket', undefined, undefined, undefined, undefined, 'force') } Fse.serverRequest('index.cfm?app=acct&do=update-UPC-scan&partnerid='+partnerId+'&partnerType='+partnerType, undefined, undefined, callBack, formID, 'post'); } /* BUSINESS CARD SCNNING */ Fse.busCardUploadSuccess = function() { // partnertype and id are embedded in the scan file image name. image file name stored in global var Fse.busCardScanImgName. // For example: BCARD_OPR_1234_3434 where the business card is being scanned for operator 1234. var nameParts = Fse.busCardScanImgName.split("_"); var _partnerType = nameParts[1]; var _partnerId = nameParts[2]; Fse.updateUploadStatus(-1); Fse.showPopupDialog('index.cfm?app=cont&view=form-contact-update&contactid=0&partnerid='+_partnerId+'&partnertype='+_partnerType+'&scanimage='+Fse.busCardScanImgName) } // PHOTO UPLOADING Fse.updateUploadStatus = function(incrementAmount) { Fse.uploadItemCount = Fse.uploadItemCount + incrementAmount; if (Fse.uploadItemCount < 0 ) { Fse.uploadItemCount = 0 } if (Fse.uploadItemCount == 0 ) { $('.upload-status').hide(); } else { if (Fse.uploadItemCount == 1) { var _message = 'Uploading'; } else { var _message = 'Uploading'; } $('.upload-status').text(_message); $('.upload-status').show(); } } Fse.photoUploadSuccess = function() { Fse.updateUploadStatus(-1); Fse.loadSocket( 'current', undefined, 'refresh'); } Fse.deletePhoto = function(subjectId,subjectType) { var callBack = function() { Fse.loadSocket( 'current', undefined, 'refresh'); } if (confirm('Delete photo?')) { Fse.serverRequest('index.cfm?app=photo&do=delete-photo&subjectId='+subjectId+'&subjecttype='+subjectType, undefined, undefined, callBack, undefined, 'POST'); } } Fse.acctPhotoUploadSuccess = function() { //alert('Photo Uploaded!'); Fse.updateUploadStatus(-1); Fse.acctLoadPhotosSocket(); }; Fse.acctLoadPhotosSocket = function() { Fse.updateUploadStatus(0); var partnerId = $('#photos-socket').attr('FSE:partnerid'); var partnerType = $('#photos-socket').attr('FSE:partnertype'); /*if ($('#photos-socket').attr('FSE:lazyLoaded') != 'true') {*/ /*if ($('#photos-socket').attr('FSE:page-url') == undefined) { Fse.acctShowPhoto(partnerId, partnerType); }*/ Fse.acctShowPhoto(partnerId, partnerType,undefined,'force'); } Fse.acctShowPhoto = function(partnerId,partnerType,fileId,loadMode) { if (fileId == undefined) { fileId = '' }; var fnCallBack = function() { window.scrollTo(0, $("#"+partnerId+partnerType+"-photos").offset().top); } Fse.serverRequest('index.cfm?app=acct&view=acct-photos&partnerId='+partnerId+'&partnerType='+partnerType+'&fileId='+fileId, 'photos-socket', undefined, fnCallBack, undefined, undefined, loadMode); } Fse.acctDeletePhoto = function(partnerId,partnerType,fileId) { if (confirm('Delete Photo?')) { var callBack = function() { Fse.acctShowPhoto(partnerId, partnerType, undefined, 'force'); Fse.ajaxRequest({ socketId: 'profile-summary-'+partnerType+partnerId, loadMode: 'refresh' }) } Fse.serverRequest('index.cfm?app=acct&do=delete-photo&partnerId='+partnerId+'&partnerType='+partnerType+'&fileId='+fileId, undefined, undefined, callBack, undefined, 'post'); } } // MISC Fse.toggleFilterDisplay = function(appCode, openCloseState) { var filterDisplayId = appCode + '-filter-selections'; var iconDisplayId = appCode + '-srch-fltr-icon'; /* based on current state, what would icon be after being toggled */ if ( $('#'+filterDisplayId).is(":visible") ) { //var _toggledIcon = '▼'; /* down */ var _toggledIcon = '+'; /* down */ } else { var _toggledIcon = '▲'; /* up */ var _toggledIcon = '-'; /* up */ } if (openCloseState == 'open' && !$('#'+filterDisplayId).is(":visible")) { $('#'+filterDisplayId).fadeToggle('slow'); //$('#'+iconDisplayId).html('▲'); $('#'+iconDisplayId).html('-'); } else if (openCloseState == 'close' && $('#'+filterDisplayId).is(":visible")) { $('#'+filterDisplayId).fadeToggle('slow'); //$('#'+iconDisplayId).html('▼'); $('#'+iconDisplayId).html('+'); } else if (openCloseState == undefined) { $('#'+filterDisplayId).fadeToggle('slow'); $('#'+iconDisplayId).html(_toggledIcon); } } Fse.getResponsiveState = function() { if ( window.getComputedStyle(document.getElementById('responsive-state-info'), null).getPropertyValue('width') == '0px' ) { return 'phone'; } else { return 'tablet'; } } Fse.getDeviceType = function() { if ( window.getComputedStyle(document.getElementById('responsive-state-info'), null).getPropertyValue('width') == '0px' ) { return 'phone'; } else { return 'tablet'; } } Fse.generalSearchSelection = function() { var _selection = $('#genSearchSelection').val(); var _typ = _selection.split("|")[0]; var _val = _selection.split("|")[1]; if (_typ == 'PRD') { Fse.emptyPages('generic',true); Fse.setTitle('Products'); Fse.loadSocket( 'reset', 'index.cfm?app=prd&view=page-prd-detail&skuid='+_val+'&back=home&nonav=true'); if($('#main-menu-collapsible').is(':visible')){Fse.toggleMainMenu();} } else if (_typ == 'OPR' || _typ == 'CDR') { Fse.emptyPages('generic',true); Fse.setTitle('Accounts'); Fse.loadSocket('reset','index.cfm?app=acct&view=page-acct-detail&partnerid='+_val+'&partnertype='+_typ+'&back=home&nonav=true'); if($('#main-menu-collapsible').is(':visible')){Fse.toggleMainMenu();} } else if (_typ == 'CON') { Fse.emptyPages('generic',true); Fse.setTitle('Contacts'); Fse.loadSocket( 'reset', 'index.cfm?app=cont&view=page-contact-detail&id='+_val+'&back=home&nonav=true' ); if($('#main-menu-collapsible').is(':visible')){Fse.toggleMainMenu();} } $("#genSearchInput").val(""); } // SALES CALLS Fse.createInteraction = function(partnerId,partnerType) { var fnCallback = function(data,status,request) { var newIntId = request.getResponseHeader("FSEnewinteractionid"); if (newIntId != '0') { Fse.dirtyPage('current'); Fse.loadSocket( 'next', 'index.cfm?app=calls&view=page-call-detail&partnerid='+partnerId+'&partnertype='+partnerType+'&interactionid='+newIntId, 'force' ); } else { alert('Unable to create new call.'); } } Fse.serverRequest('index.cfm?app=calls&view=create-sales-call&partnerid='+partnerId+'&partnertype='+partnerType, undefined, undefined, fnCallback ); } // favorites Fse.favSet = function(subjectId,subjectType,subjectOid,subjectOtype) { if (!subjectOid) { subjectOid = ''; } if (!subjectOtype) { subjectOtype = ''; } if ($('.fav-'+subjectId).attr('src') == 'images/ico-toolbar-favorite-on.png') { $('.fav-'+subjectId).attr('src','images/ico-toolbar-favorite.png'); var _act = 'del'; } else { $('.fav-'+subjectId).attr('src','images/ico-toolbar-favorite-on.png'); var _act = 'add'; } //Fse.serverRequest('index.cfm?view=set-favorite&subjectid='+subjectId+'&subjecttype='+subjectType+'&favAction='+_act); Fse.ajaxRequest( { urlString:'index.cfm?view=set-favorite&subjectid='+subjectId+'&subjecttype='+subjectType+'&favAction='+_act+'&subjectoid='+subjectOid+'&subjectotype='+subjectOtype, showLoading: false } ); } // DOCUMENTS Fse.docActions = function(docType,docId,docOid,docOtyp,favOption) { if (!docOid) { docOid = ''; } if (!docOtyp) { docOtyp = ''; } if (!favOption) { favOption = 'on'; } Fse.showPopupDialog("index.cfm?app=docs&view=doc-actions&doctype="+docType+"&docid="+docId+"&docoid="+docOid+"&docotyp="+docOtyp+"&favOption="+favOption); } Fse.docEmail = function(docType,docId,docOid,docOtyp) { Fse.closePopupDialog(); setTimeout(function() { Fse.showPopupDialog("index.cfm?app=docs&view=form-doc-email&doctype="+docType+"&docid="+docId+"&docoid="+docOid+"&docotyp="+docOtyp); }, 200); } Fse.submitDocEmail = function() { var callBack = function(data,status,request) { var _error = request.getResponseHeader("x-fse-emailerror"); if (_error == '') { alert('Email sent!'); Fse.closePopupDialog(); } else { alert(_error); } } Fse.serverRequest('index.cfm?app=docs&do=email-item', undefined, undefined, callBack, 'frmShareItem', 'POST'); } Fse.videoEmail = function(vidId,vidOid,vidOtyp) { Fse.closePopupDialog(); setTimeout(function() { Fse.showPopupDialog("index.cfm?app=prd&view=form-vid-email&vidid="+vidId+"&vidoid="+vidOid+"&vidotyp="+vidOtyp); }, 200); } Fse.submitVidEmail = function() { var callBack = function(data,status,request) { var _error = request.getResponseHeader("x-fse-emailerror"); if (_error == '') { alert('Email sent!'); Fse.closePopupDialog(); } else { alert(_error); } } Fse.serverRequest('index.cfm?app=prd&do=email-item-vid', undefined, undefined, callBack, 'frmShareItem', 'POST'); } Fse.submitDocSearch = function( stPage ) { var criterRequired = false; if ( document.frmsrchdocs.keyWord.value == '' && ( document.frmsrchdocs.catId == undefined || document.frmsrchdocs.catId.selectedIndex == 0) && ( document.frmsrchdocs.myFavorites == undefined || document.frmsrchdocs.myFavorites.checked == false) && criterRequired ) { $('#docs-search-results-socket').html('

provide additional search criteria
to view results

'); Fse.toggleFilterDisplay('doc-filter-selections','close'); $('#docs-search-criteria-dsp-socket').html(''); } else { if (stPage == 1) { $('#docs-search-results-socket').html(''); } var callBack = function() { if (stPage == 1) { Fse.serverRequest('index.cfm?app=docs&view=search-criteria', 'docs-search-criteria-dsp-socket', undefined, undefined, 'frmsrchdocs', 'get', 'force'); } window.scrollTo(0,0); } Fse.serverRequest('index.cfm?app=docs&view=search-results&pg='+stPage,'docs-search-results-socket',undefined,callBack,'frmsrchdocs','get','force'); } } Fse.clearDocSearch = function() { if(document.frmsrchdocs.keyWord) { document.frmsrchdocs.keyWord.value = '' }; if(document.frmsrchdocs.myFavorites) { $("#myFavorites").attr("checked",false).checkboxradio("refresh") }; if( document.frmsrchdocs.catId ) { document.frmsrchdocs.catId.selectedIndex=0; $('#catId').selectmenu('refresh'); } if(document.frmsrchdocs.docFilters) { var field = document.frmsrchdocs.docFilters; for (i = 0; i < field.length; i++) { field[i].checked = false; } } Fse.submitDocSearch(1); } Fse.promptNewBroSalesCall = function( partnerId, partnerType ) { if (!mainMenuOrigin) { var mainMenuOrigin = false; } var _mainMenuOrigin = Fse.onHomePage(); Fse.showPopupDialog('index.cfm?app=calls&view=form-prompt-new-bro-call&mainMenuOrigin=' + _mainMenuOrigin + '&partnerid=' + partnerId + '&partnertype=' + partnerType, 300); }