"use strict";var CGoogleEventTracking=function(Options){if(typeof(Options)!=='object'){Options={};}
this.ID=Options.ID||'GoogleEventTracking_'+CUtil.UUID();this.ControlID=Options.ControlID||this.ID;this.DisableGoogleEventTracking=Options.DisableGoogleEventTracking||false;this.Action=Options.GaAction||"Click";this.Label=Options.GaLabel||"Event Trigger";this.Category=Options.GaCategory||"Undefined";this.Value=Options.GaValue||null;this.Cache=CElementCacheGlobal.Register('CGoogleEventTracking'+this.ControlID,{Container:'#'+this.ControlID,});this.Setup();};CGoogleEventTracking.prototype=Object.create(CControl.prototype);CGoogleEventTracking.prototype.Debugging=false;CGoogleEventTracking.prototype.DisableTracking=null;CGoogleEventTracking.prototype.Tags=(function(){function FetchTags(){var Tags=[];if(typeof window.dataLayer!=="undefined"){$.each(window.dataLayer,function(Key,Layer){if(Layer[0]=='config'){Tags.push(Layer[1]);}});}
return Tags;}
var instance;return{GetInstance:function(){if(instance==null){instance=new FetchTags();instance.constructor=null;}
return instance;}};})();CGoogleEventTracking.prototype.Setup=function(){var self=this;if(typeof self.DisableTracking!=="undefined"&&self.DisableTracking===true){self.DisableGoogleEventTracking=true;}
self.Cache("Container").on("click",function(e){if(typeof self.Debugging!=="undefined"&&self.Debugging===true){console.log("Debugging is on. Default behavior is prevented.");e.preventDefault();}
self.TrackEvent();});return this;};CGoogleEventTracking.prototype.Set=function(EventObject){var self=this;if(typeof(EventObject)!=='object'){EventObject={};}
if(typeof EventObject.GaAction!=="undefined"&&EventObject.GaAction!==null){self.Action=EventObject.GaAction;}
if(typeof EventObject.GaLabel!=="undefined"&&EventObject.GaLabel!==null){self.Label=EventObject.GaLabel;}
if(typeof EventObject.GaCategory!=="undefined"&&EventObject.GaCategory!==null){self.Category=EventObject.GaCategory;}
if(typeof EventObject.GaValue!=="undefined"&&EventObject.GaValue!==null){self.Value=EventObject.GaValue;}
if(typeof EventObject.DisableGoogleEventTracking!=="undefined"&&EventObject.DisableGoogleEventTracking!==null){self.DisableGoogleEventTracking=EventObject.DisableGoogleEventTracking;}}
CGoogleEventTracking.prototype.TrackEvent=function(EventObject){var self=this;self.Set(EventObject);if(typeof self.DisableTracking!=="undefined"&&self.DisableTracking===true){if(typeof self.Debugging!=="undefined"&&window.console&&self.Debugging===true){console.log("Event tracking disabled globally. Nothing sent.");}
return;}
if(self.DisableGoogleEventTracking===true){if(typeof self.Debugging!=="undefined"&&window.console&&self.Debugging===true){console.log("Event tracking disabled. Nothing sent.");}
return;}
if(typeof window.gtag!=="undefined"&&typeof(gtag)==='function'){var Tags=self.Tags.GetInstance();if(Tags==null){return;}
if(typeof Tags!=="object"){return;}
if(Tags.length===0){return;}}
try{if(typeof window.gtag!=="undefined"&&typeof(gtag)==='function'){$.each(Tags,function(Key,Property){if(Property.match("^G-")){gtag('event',self.Category+' - '+self.Action,{'send_to':Property,'event_label':self.Label,});}else if(Property.match("^UA-")){gtag('event',self.Action,{'send_to':Property,'event_category':self.Category,'event_label':self.Label,'value':self.Value});}});}else if(typeof(window._gaq)!=="undefined"){_gaq.push(['_trackEvent',self.Category,self.Action,self.Label,self.Value]);}else if(typeof window.ga!=="undefined"&&typeof(ga)==='function'){ga('send','event',self.Category,self.Action,self.Label,self.Value);}
if(typeof self.Debugging!=="undefined"&&window.console&&self.Debugging===true){console.log("Track Event sent");console.log({Properties:Tags,Category:self.Category,Action:self.Action,Label:self.Label,Value:self.Value});}}catch(Exception){if(typeof self.Debugging!=="undefined"&&window.console&&self.Debugging===true){console.error("Track Event could not send. Unable to find a valid GA method to use.");}}}
var WebLawnganics=new CWebsite('Lawnganics');WebLawnganics.Setup=function(){$('a[href^=tel]').on('click',function(){var GaEvent={'GaCategory':'phone_number','GaLabel':'Click-to-Call','GaAction':'Phone Click - Click'};var EventTracking=new CGoogleEventTracking(GaEvent);EventTracking.TrackEvent();if(typeof fbq!=='undefined'){fbq('track','Contact',{content_category:'button',content_name:'click-to-call'});}});};WebLawnganics.ContactUsConfirmation=function(FormType){var GaEvent;var FBQContentName;switch(FormType){case'Contact':GaEvent={'GaCategory':'contact_form','GaLabel':'Form Submit {ContactForm}','GaAction':'Form - Success'};FBQContentName='contact-us-form-submission';break;case'QuickContactUs':GaEvent={'GaCategory':'quick_contact_us_form','GaLabel':'Form Submit {QuickContactUsForm}','GaAction':'Form - Success'};FBQContentName='quick-contact-us-form-submission';break;}
var EventTracking=new CGoogleEventTracking(GaEvent);EventTracking.TrackEvent();if(typeof fbq!=='undefined'){fbq('track','Contact',{content_category:'button',content_name:FBQContentName});}};