jQuery.noConflict();

jQuery(document).ready(function(){
	var $_GET = {};
	var ttype = document.referrer;
	console.log(ttype);
	
	document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
	    function decode(s) {
	        return decodeURIComponent(s.split("+").join(" "));
	    }

	    $_GET[decode(arguments[1])] = decode(arguments[2]);
	});
	
	if ( $_GET["src"] ) {
		jQuery.cookie('dynamix_lead_src', $_GET["src"], { expires: 7 });
	}
	
	if ( $_GET["medium"] ) {
		jQuery.cookie('dynamix_lead_medium', $_GET["medium"], { expires: 7 });
	}

	if ( $_GET["campaign"] ) {
		jQuery.cookie('dynamix_lead_campaign', $_GET["campaign"], { expires: 7 });
	}

	if ( $_GET["network"] ) {
		jQuery.cookie('dynamix_lead_network', $_GET["network"], { expires: 7 });
	}
	
	if ( ! jQuery.cookie('dynamix_traffic_type') ) {
		jQuery.cookie('dynamix_traffic_type', ttype, { expires: 7 })
	}
});
