var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-442708-3']);
_gaq.push(['_trackPageview']);

 var oTrackit = {
    init:function() {
        this.google();
        //this.thirdParty();
    },

    google:function() {
		try {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		} catch (ee) {
			; //do nothing
		}
		$('li.Email a').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_E-mail a Friend','Click_E-mail a Friend']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
		$('#menu a.HowVaccine').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_How_Do_Get_The_Menactra_Vaccince','Click_How_Do_Get_The_Menactra_Vaccince']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
		$('a[href*="popup_submit_story.html"]').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_Whats_Your_Story','Click_Whats_Your_Story']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
		$('#menu a.WhyMenactra').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_Why_Menactra_Vaccine','Click_Why_Menactra_Vaccine']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
		$('#header a[href*="menactra-prescribing-information.html"]').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_Prescribing_Information','Click_Prescribing_Information']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
		$('#menu a.WhatIs').click(function(){
			try {
				_gaq.push(['_trackEvent','Click_What_Is_Meningococcal_Vaccine','Click_What_Is_Meningococcal_Vaccine']);
			} catch (ee) {
				// do nothing. bad.
			}
		});
    },

    thirdParty:function() {
        var iRand = Math.floor(Math.random()*1000)
        //Tacoda
        $("body").append('<img src="http://anat.tacoda.net/encore/2349/A2/E210/" width="0" height="0" border="0">');
        //RealMedia
        $("body").append('<img src="http://network.realmedia.com/RealMedia/ads/adstream_nx.ads/TRACK_Sanofiaventis/Retarget_Nonsecure@Bottom3">');
        //Specificclick
        $("body").append('<img src="http://adopt.specificclick.net/conv.sm?adv=2814&rnd='+iRand+'" width="1" height="1" border="0">');
    }
}

$(window).bind("load", function() { oTrackit.init(); });

