// Attach Events LeadSourceRuntime_XBrowserAddHandler(window,'load',LeadSourceRuntime_onload); var _leadSourceFields = {'LeadTrackingRefererDomain':'' escape(document.referrer) '','LeadTrackingSession':'a38059f7-916e-4705-9cc7-f9b30e864622','LeadTrackingRenderDate':'10/14/2024 5:54:54 AM','LeadTrackingBrowserGUID':'6558390f-1e23-4bed-9146-8825f34ba09c','LeadTrackingPageLoadGUID':'2fb2f7bd-e426-47a8-aa04-bcc31b9aea5f'}; function LeadSourceRuntime_onload() { LeadSourceRuntime_PopulateForms(_leadSourceFields); if(window.LeadSource_onload) window.LeadSource_onload(_leadSourceFields); } function LeadSourceRuntime_XBrowserAddHandler(target,eventName,handlerName) { if ( target.addEventListener ) target.addEventListener(eventName, handlerName, false); else if ( target.attachEvent ) target.attachEvent("on" + eventName, handlerName); else target["on" + eventName] = handlerName; } function LeadSourceRuntime_PopulateForms(o) { for(var f=0; f < document.forms.length;f++) { var LeadTrackingPopulate = document.forms[f].getAttribute("LeadTrackingPopulate"); if(!LeadTrackingPopulate || LeadTrackingPopulate.toLowerCase() == 'true') { var action = document.forms[f].action; for(var l in o) { if(LeadSourceRuntime_getFormElementByName(document.forms[f], l) == null) LeadSourceRuntime_addElement(document.forms[f], 'HIDDEN', l, o[l]); else LeadSourceRuntime_getFormElementByName(document.forms[f], l).value = o[l]; action = action.replace(new RegExp('&' + l + '=', 'gi'), "&__ORG__" + l + "="); action = action.replace(new RegExp('\\?' + l + '=', 'gi'), "?__ORG__" + l + "="); } document.forms[f].action = action; } // Add CaptureURL if (LeadSourceRuntime_getFormElementByName(document.forms[f], 'CaptureURL') == null) if(document.location.href.toLowerCase().indexOf('http://iframe.plattformpartners.com') != 0) LeadSourceRuntime_addElement(document.forms[f], 'HIDDEN', 'CaptureURL', document.location.href); } } function LeadSourceRuntime_addElement(frm, fieldType, fieldName, fieldValue) { if (document.getElementById) { var input = document.createElement('INPUT'); if (document.all) { input.type = fieldType; input.name = fieldName; input.value = fieldValue; } else if (document.getElementById) { // so here is the NN6 workaround input.setAttribute('type', fieldType); input.setAttribute('name', fieldName); input.setAttribute('value', fieldValue); } frm.appendChild(input); } } function LeadSourceRuntime_getFormElementByName(Form, Element) { for(var i=0; i< Form.length; i++) { if(Form[i].name != null) { if(Form[i].name.toUpperCase() == Element.toUpperCase()) return Form[i]; } } return null; } function LeadSourceRuntime_CreateQueryString() { var q = ''; for(s in _leadSourceFields) { q += '&' + escape(s) + '=' + escape(_leadSourceFields[s]); } return q; }