function check_cj(a){ return a != null && a.length > 1;}

function cj_check_ref(a){ 
  return (check_cj(a) && a[1].indexOf('cj') != -1);
}

var from_cj = new RegExp('[\\?&]' + "ref" + '=?([^&#]*)').exec( window.document.location );

if(cj_check_ref(from_cj))
{
  var old_onload = window.onload;
  window.onload = function(){
    //first set cookie
    _url = 'https://p10.secure.hostingprod.com/@cpocampbellhausfeld.com/ssl/cj_cookie.php'
    var e = document.createElement("img");
    e.src = _url;
    document.getElementsByTagName("body")[0].appendChild(e);    
    //execute code
    if(old_onload) old_onload();
  }
}
