$(document).ready(function() {
	// get the value for the VentureOne source query parameter
	var campaign = '';
	
	if(jQuery.url.param("source")) {
		campaign = jQuery.url.param("source");
	}		
	
	// if a value exists, check to see if it's the same referral as before
	if(campaign == getCookie('vonesource') || (campaign == '' && typeof(getCookie('vonesource')) != undefined)) {
		vlink = "https://www.canadapost.ca/cpid/apps/signup?" + "LOCALE=" + GLOBALOBJ.locale + "&joinVentureOneParam=true&campaignsource=" + getCookie('vonesource') + "&icid=" + (jQuery.url.param("icid") ? jQuery.url.param("icid") : '');	
	} else {
		if (campaign != '') {
			setCookie('vonesource', campaign, 10);			
		}
		vlink = "https://www.canadapost.ca/cpid/apps/signup?" + "LOCALE=" + GLOBALOBJ.locale + "&joinVentureOneParam=true&campaignsource=" + campaign + "&icid=" + (jQuery.url.param("icid") ? jQuery.url.param("icid") : '');		
	}		
	
	$(".vonelink").attr("href", vlink);
	
});	

