Loading your professional checklist...

🚨 24/7 Emergency Response: (301) 215-3191 | Professional Restoration Throughout DMV Region

Emergency Response Checklist

Professional emergency response protocol

āœ… Used by Emergency Responders & Insurance Professionals

šŸ“‹ Access This Checklist

šŸ–„ļø View Options

šŸ“„ Download Options

šŸ“¤ Share Options

🌐 Social Sharing

`); printWindow.document.close(); } // WhatsApp sharing with GHL integration async function shareViaWhatsApp() { if (!currentContactId) { showContactModal(() => shareViaWhatsApp()); return; } try { const checklistType = getUrlParameter('checklist') || 'water-emergency'; // Track WhatsApp share activity in GHL await window.GHL.trackActivity(currentContactId, 'WhatsApp Share', { checklistType: checklistType, shareMethod: 'whatsapp', timestamp: new Date().toISOString() }); const checklist = checklists[checklistType]; const text = encodeURIComponent(`🚨 Emergency Checklist: ${checklist.title}\\n\\nProfessional emergency response protocol used by first responders.\\n\\n${window.location.href}\\n\\nšŸ“ž 24/7 Emergency: (301) 215-3191`); window.open(`https://wa.me/?text=${text}`, '_blank'); showSuccessMessage('Emergency checklist shared via WhatsApp! Activity tracked in GHL.'); } catch (error) { console.error('WhatsApp sharing failed:', error); // Fallback to basic WhatsApp sharing without GHL tracking const checklistType = getUrlParameter('checklist') || 'water-emergency'; const checklist = checklists[checklistType]; const text = encodeURIComponent(`🚨 Emergency Checklist: ${checklist.title}\\n\\nProfessional emergency response protocol used by first responders.\\n\\n${window.location.href}\\n\\nšŸ“ž 24/7 Emergency: (301) 215-3191`); window.open(`https://wa.me/?text=${text}`, '_blank'); showSuccessMessage('Emergency checklist shared via WhatsApp!'); } } // GHL-Integrated Variables let currentContactId = null; let userContactData = null; // Show contact modal before any sharing action function showContactModal(callback = null) { document.getElementById('contactModal').style.display = 'flex'; if (callback) { window.modalCallback = callback; } } function closeContactModal() { document.getElementById('contactModal').style.display = 'none'; window.modalCallback = null; } // Handle contact form submission async function handleContactSubmit(event) { event.preventDefault(); const submitBtn = event.target.querySelector('.submit-btn'); const originalText = submitBtn.innerHTML; // Show loading state submitBtn.disabled = true; submitBtn.innerHTML = 'šŸ“” Connecting to GHL...'; submitBtn.classList.add('loading'); try { const formData = new FormData(event.target); const contactData = { firstName: formData.get('firstName'), lastName: formData.get('lastName'), email: formData.get('email'), phone: formData.get('phone'), emergencyContact: formData.get('emergencyContact'), smsConsent: formData.get('smsConsent') }; const checklistType = getUrlParameter('checklist') || 'water-emergency'; // Process through GHL const result = await window.GHL.processPDFAccess( contactData, checklistType, 'web_form' ); if (result.success) { currentContactId = result.contact.id; userContactData = contactData; // Store contact data locally for session sessionStorage.setItem('ghl_contact_id', currentContactId); sessionStorage.setItem('user_contact_data', JSON.stringify(userContactData)); // Success feedback submitBtn.innerHTML = 'āœ… Connected! Loading checklist...'; submitBtn.style.background = '#28a745'; // Close modal and execute callback if any setTimeout(() => { closeContactModal(); if (window.modalCallback) { window.modalCallback(); } else { // Default action: show success message showSuccessMessage('Contact saved! You now have access to the emergency checklist.'); } }, 1500); // Track checklist access await window.GHL.trackActivity(currentContactId, 'Checklist Access', { checklistType: checklistType, accessMethod: 'contact_form', timestamp: new Date().toISOString() }); // Create opportunity for new contacts if (result.isNewContact) { try { await window.GHL.createOpportunity(currentContactId, checklistType); console.log('Opportunity created for new contact in GHL'); } catch (error) { console.error('Failed to create opportunity:', error); } } // Trigger appropriate workflow automation try { const workflowId = window.GHL.getWorkflowIdForChecklist(checklistType); if (workflowId) { await window.GHL.triggerWorkflow(currentContactId, workflowId, { checklistType: checklistType, accessMethod: 'contact_form', isNewContact: result.isNewContact, timestamp: new Date().toISOString() }); console.log('GHL workflow triggered:', workflowId); } } catch (error) { console.error('Failed to trigger workflow:', error); } } else { throw new Error(result.error || 'Failed to connect to GHL'); } } catch (error) { console.error('Contact submission failed:', error); submitBtn.innerHTML = 'āŒ Connection failed. Please try again.'; submitBtn.style.background = '#dc3545'; setTimeout(() => { submitBtn.disabled = false; submitBtn.innerHTML = originalText; submitBtn.style.background = ''; submitBtn.classList.remove('loading'); }, 3000); } } // Enhanced SMS sharing through GHL async function shareViaSMS() { if (!currentContactId) { showContactModal(() => shareViaSMS()); return; } try { const checklistType = getUrlParameter('checklist') || 'water-emergency'; await window.GHL.shareViaGHL(currentContactId, 'sms', checklistType); showSuccessMessage('Emergency checklist sent via SMS through GHL!'); // Track sharing activity await window.GHL.trackActivity(currentContactId, 'SMS Share', { checklistType: checklistType, method: 'ghl_sms' }); } catch (error) { console.error('GHL SMS sharing failed:', error); // Fallback to device SMS const checklistType = getUrlParameter('checklist') || 'water-emergency'; const checklist = checklists[checklistType]; const text = encodeURIComponent(`🚨 Emergency Checklist: ${checklist.title}\\n\\n${window.location.href}\\n\\n24/7 Emergency: (301) 215-3191`); window.location.href = `sms:?body=${text}`; } } // Copy link to clipboard function copyLink() { navigator.clipboard.writeText(window.location.href).then(function() { // Show temporary success message const button = event.target; const originalText = button.innerHTML; button.innerHTML = 'āœ… Copied!'; button.style.background = '#28a745'; setTimeout(() => { button.innerHTML = originalText; button.style.background = '#6c757d'; }, 2000); }).catch(function() { // Fallback for older browsers const textArea = document.createElement('textarea'); textArea.value = window.location.href; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); alert('Link copied to clipboard!'); }); } // Enhanced email sharing through GHL async function shareViaEmail() { if (!currentContactId) { showContactModal(() => shareViaEmail()); return; } try { const checklistType = getUrlParameter('checklist') || 'water-emergency'; await window.GHL.shareViaGHL(currentContactId, 'email', checklistType); showSuccessMessage('Emergency checklist sent via email through GHL!'); // Track sharing activity await window.GHL.trackActivity(currentContactId, 'Email Share', { checklistType: checklistType, method: 'ghl_email' }); } catch (error) { console.error('GHL email sharing failed:', error); // Fallback to device email const checklistType = getUrlParameter('checklist') || 'water-emergency'; const checklist = checklists[checklistType]; const subject = encodeURIComponent(`Emergency Checklist: ${checklist.title}`); const body = encodeURIComponent(`Professional emergency checklist: ${window.location.href}`); window.location.href = `mailto:?subject=${subject}&body=${body}`; } } // Show success message function showSuccessMessage(message) { const notification = document.createElement('div'); notification.style.cssText = ` position: fixed; top: 20px; right: 20px; background: #28a745; color: white; padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 10001; font-weight: 600; max-width: 300px; `; notification.textContent = message; document.body.appendChild(notification); setTimeout(() => { notification.style.opacity = '0'; notification.style.transform = 'translateX(100%)'; setTimeout(() => { document.body.removeChild(notification); }, 300); }, 3000); } // Initialize page and check for existing contact document.addEventListener('DOMContentLoaded', function() { // Check if user already has contact info in session const storedContactId = sessionStorage.getItem('ghl_contact_id'); const storedContactData = sessionStorage.getItem('user_contact_data'); if (storedContactId && storedContactData) { currentContactId = storedContactId; userContactData = JSON.parse(storedContactData); console.log('Restored GHL contact session:', currentContactId); } // Enhanced analytics tracking if (currentContactId) { const checklistType = getUrlParameter('checklist') || 'water-emergency'; // Track detailed page view analytics window.GHL.trackActivity(currentContactId, 'Page View', { checklistType: checklistType, pageUrl: window.location.href, timestamp: new Date().toISOString(), userAgent: navigator.userAgent, referrer: document.referrer, screenResolution: `${screen.width}x${screen.height}`, viewportSize: `${window.innerWidth}x${window.innerHeight}`, isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), sessionStart: !sessionStorage.getItem('session_tracked') }); // Mark session as tracked if (!sessionStorage.getItem('session_tracked')) { sessionStorage.setItem('session_tracked', 'true'); // Track session start event window.GHL.trackActivity(currentContactId, 'Session Start', { checklistType: checklistType, entryPoint: document.referrer || 'Direct', timestamp: new Date().toISOString() }); } // Track engagement metrics trackEngagementMetrics(currentContactId, checklistType); } // Show contact modal for new visitors after 10 seconds if (!currentContactId) { setTimeout(() => { showContactModal(); }, 10000); } }); // Mobile-optimized SMS sharing with GHL integration async function shareViaText() { if (!currentContactId) { showContactModal(() => shareViaText()); return; } try { const checklistType = getUrlParameter('checklist') || 'water-emergency'; await window.GHL.shareViaGHL(currentContactId, 'sms', checklistType); showSuccessMessage('Emergency checklist sent via SMS through GHL!'); // Track sharing activity await window.GHL.trackActivity(currentContactId, 'Mobile SMS Share', { checklistType: checklistType, method: 'ghl_mobile_sms' }); } catch (error) { console.error('GHL mobile SMS sharing failed:', error); // Fallback to device SMS const checklistType = getUrlParameter('checklist') || 'water-emergency'; const checklist = checklists[checklistType]; const message = encodeURIComponent(`Emergency Checklist: ${checklist.title}\n\n${window.location.href}\n\nUsed by emergency responders & insurance professionals`); window.location.href = `sms:?body=${message}`; } } // Enhanced mobile detection and optimizations function initializeMobileOptimizations() { const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (isMobile) { // Add text sharing button for mobile const socialSharing = document.querySelector('.social-sharing'); if (socialSharing) { const textBtn = document.createElement('a'); textBtn.href = '#'; textBtn.className = 'social-btn text'; textBtn.onclick = shareViaText; textBtn.title = 'Share via Text'; textBtn.innerHTML = 'šŸ“±'; socialSharing.appendChild(textBtn); } // Optimize iframe loading for mobile const pdfFrame = document.getElementById('pdfFrame'); pdfFrame.addEventListener('load', () => { setTimeout(() => { // Add zoom controls for mobile addMobileZoomControls(); }, 1000); }); } } // Add mobile zoom controls function addMobileZoomControls() { const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (!isMobile) return; const pdfActions = document.querySelector('.pdf-actions'); const zoomControls = document.createElement('div'); zoomControls.className = 'zoom-controls'; zoomControls.style.cssText = 'display: flex; gap: 10px; margin-top: 10px;'; zoomControls.innerHTML = ` `; pdfActions.appendChild(zoomControls); } // Mobile zoom functionality function zoomPDF(action) { const pdfFrame = document.getElementById('pdfFrame'); const currentTransform = pdfFrame.style.transform || 'scale(1)'; let currentScale = parseFloat(currentTransform.match(/scale\(([^)]+)\)/)?.[1] || 1); switch(action) { case 'in': currentScale = Math.min(currentScale * 1.2, 3); break; case 'out': currentScale = Math.max(currentScale / 1.2, 0.5); break; case 'fit': currentScale = 1; break; } pdfFrame.style.transform = `scale(${currentScale})`; pdfFrame.style.transformOrigin = 'top left'; } // Initialize on page load document.addEventListener('DOMContentLoaded', () => { loadChecklist(); initializeMobileOptimizations(); }); // Enhanced GHL Lead Tracking and Analytics System function trackEngagementMetrics(contactId, checklistType) { let timeOnPage = 0; let scrollDepth = 0; let clickCount = 0; let interactionEvents = []; // Track time on page const timeTracker = setInterval(() => { timeOnPage += 1; // Send periodic engagement updates to GHL if (timeOnPage % 30 === 0) { // Every 30 seconds window.GHL.trackActivity(contactId, 'Engagement Update', { checklistType: checklistType, timeOnPage: timeOnPage, scrollDepth: scrollDepth, clickCount: clickCount, interactionEvents: interactionEvents.slice(-5), // Last 5 interactions timestamp: new Date().toISOString() }); } }, 1000); // Track scroll depth window.addEventListener('scroll', () => { const scrollPercent = Math.round((window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100); if (scrollPercent > scrollDepth) { scrollDepth = Math.min(scrollPercent, 100); // Track milestone scroll events if (scrollDepth >= 25 && !sessionStorage.getItem('scroll_25')) { sessionStorage.setItem('scroll_25', 'true'); window.GHL.trackActivity(contactId, 'Scroll Milestone', { checklistType: checklistType, milestone: '25%', timestamp: new Date().toISOString() }); } if (scrollDepth >= 50 && !sessionStorage.getItem('scroll_50')) { sessionStorage.setItem('scroll_50', 'true'); window.GHL.trackActivity(contactId, 'Scroll Milestone', { checklistType: checklistType, milestone: '50%', timestamp: new Date().toISOString() }); } if (scrollDepth >= 75 && !sessionStorage.getItem('scroll_75')) { sessionStorage.setItem('scroll_75', 'true'); window.GHL.trackActivity(contactId, 'Scroll Milestone', { checklistType: checklistType, milestone: '75%', timestamp: new Date().toISOString() }); } if (scrollDepth >= 100 && !sessionStorage.getItem('scroll_100')) { sessionStorage.setItem('scroll_100', 'true'); window.GHL.trackActivity(contactId, 'Scroll Complete', { checklistType: checklistType, milestone: '100%', timestamp: new Date().toISOString() }); } } }); // Track clicks and interactions document.addEventListener('click', (event) => { clickCount++; const clickedElement = event.target; const elementType = clickedElement.tagName.toLowerCase(); const elementClass = clickedElement.className; const elementText = clickedElement.textContent?.substring(0, 50) || ''; interactionEvents.push({ type: 'click', element: elementType, class: elementClass, text: elementText, timestamp: new Date().toISOString() }); // Track important button clicks if (clickedElement.matches('.delivery-btn, .action-btn, .social-btn, .emergency-hotline')) { window.GHL.trackActivity(contactId, 'Button Click', { checklistType: checklistType, buttonType: elementClass, buttonText: elementText, timestamp: new Date().toISOString() }); } // Track emergency contact clicks if (clickedElement.matches('a[href^="tel:"]')) { window.GHL.trackActivity(contactId, 'Emergency Call Attempted', { checklistType: checklistType, phoneNumber: clickedElement.href.replace('tel:', ''), timestamp: new Date().toISOString() }); } }); // Track when user leaves the page window.addEventListener('beforeunload', () => { window.GHL.trackActivity(contactId, 'Session End', { checklistType: checklistType, totalTimeOnPage: timeOnPage, finalScrollDepth: scrollDepth, totalClicks: clickCount, timestamp: new Date().toISOString() }); clearInterval(timeTracker); }); // Track focus/blur events (user switching tabs) let isVisible = true; document.addEventListener('visibilitychange', () => { if (document.hidden && isVisible) { isVisible = false; window.GHL.trackActivity(contactId, 'Tab Hidden', { checklistType: checklistType, timeOnPageWhenHidden: timeOnPage, timestamp: new Date().toISOString() }); } else if (!document.hidden && !isVisible) { isVisible = true; window.GHL.trackActivity(contactId, 'Tab Visible', { checklistType: checklistType, timeOnPageWhenReturned: timeOnPage, timestamp: new Date().toISOString() }); } }); } // Lead scoring and qualification tracking function updateLeadScore(contactId, action, points = 1) { const currentScore = parseInt(sessionStorage.getItem('lead_score') || '0'); const newScore = currentScore + points; sessionStorage.setItem('lead_score', newScore.toString()); // Send score update to GHL custom field window.GHL.trackActivity(contactId, 'Lead Score Update', { action: action, pointsAdded: points, totalScore: newScore, timestamp: new Date().toISOString() }); // Trigger high-value lead workflow if score threshold reached if (newScore >= 50 && !sessionStorage.getItem('high_value_triggered')) { sessionStorage.setItem('high_value_triggered', 'true'); window.GHL.triggerWorkflow(contactId, 'HIGH_VALUE_LEAD_WORKFLOW_ID', { leadScore: newScore, trigger: 'score_threshold', timestamp: new Date().toISOString() }); } }