﻿

function openEmailFriend() {
	document.getElementById("sendtofriendform").style.display = 'block';
}
function closeEmailFriend() {
	document.getElementById("sendtofriendform").style.display = 'none';
}

function clearField(formfield) {
	if (formfield.defaultValue == formfield.value)
		formfield.value = '';
	else if (formfield.value == '')
		formfield.value = formfield.defaultValue;
}

function querySt(key) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i = 0; i < gy.length; i++) {
		ft = gy[i].split("=");
		if (ft[0] == key) {
			return ft[1];
		}
	}
}
function TrackLink()
{
    if (arguments.length < 2)
    {
        alert("Error: Not enough arguments to TrackLink()");
        return;
    }

    var linkTest = arguments[0];
    
    var link;

    if (linkTest.href == undefined)
    {
        link = document.createElement('a');
        link.href = linkTest;
    }

    else
    {
        link = linkTest;
    }

    var name = arguments[1];
    
    var options;

    if (arguments.length > 2)
    {
        options = arguments[2];
    }

    var linkTrackVars = '';
    var linkTrackEvents = '';

    var suppressTracking = false;

    if (options != undefined)
    {
        if (options.prop != undefined)
        {
            linkTrackVars += options.prop;

            s[options.prop] = options.prop;
        }

        if (options.event != undefined)
        {
            if (linkTrackVars.length > 0)
            {
                linkTrackVars += ",events";
            }

            else
            {
                linkTrackVars += "events";
            }

            linkTrackEvents += options.event;

            s.events = options.event;
        }

        if (options.supress != undefined)
        {
            suppressTracking = options.supress;
        }

        s.linkTrackVars = linkTrackVars;
        s.linkTrackEvents = linkTrackEvents;
    }

    if (!suppressTracking)
    {
        s.tl(link, 'o', name);
    }
   }


function disclaimer()
{
	return confirm("You are now leaving Juvenation.org\n\nThe link you clicked on will take you to a site maintained by a third party, which is solely responsible for its content. JDRF does not control, influence, or endorse this site; and the opinions, claims, or comments expressed on this site should not be attributed to JDRF. We encourage you to read the privacy policy of every website you visit.\n\nClick OK to proceed to outside site or CANCEL to return to Juvenation.org.");
	}
