// TODO this needs to be refactored to be DRY

// CJ
//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/@cpodeltatruckboxes.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();
  //}
//}

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

//function bing_check_ref(a){ 
  //return (check_bing(a) && a[1].indexOf('cashbackShopping') != -1);
//}

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

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