﻿//Function to utilise Google's analytical goals.
function contactGoal(goalId) {
    switch (goalId) {
        //Visit to contact us page - out of service. 
        case 1:
            goalTracker("/goal1.html");
            break
            //submitted contact form
        case 2:
            goalTracker("/goal2.html");
            break
            //order sample completion
        case 3:
            goalTracker("/goal3.html");
            break
            //newsletter signup
        case 4:
            goalTracker("/goal4.html");
            break
    }
}

/* 
The function that controls the mailto's goal tracking on the contact page. 
The goal1.html reference in the function above is deprecated 
*/
function emailTracking() {
    pageTracker._trackPageview("/goal2.html");

    //Just redirect's the user's window to a mailto.
    //location.replace("mailto:" + email);
    return true;
}

function goalTracker(goalUrl) {
    //URL just a way of counting goals reached.
    pageTracker._trackPageview(goalUrl);
}

var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
var pageTracker = _gat._getTracker("UA-31063-62");
pageTracker._initData();
pageTracker._trackPageview();