    
    // measurement configurations for discoverdodge.com
    var page_id     = getParameter("pid");
    var banner_id   = getParameter("adid");
    var creative_id = getParameter("rid");
    var mktprgm     = getParameter("mktprgm");
    var referrer    = "";
    
    if((page_id == "") || (page_id == null)){
        var id_val = "nothing";
    } else {
        new Number(page_id);
        var id_val = Number(page_id);
        var id_val = isNaN(id_val);
    }
    
    if(id_val == false){
        referrer = 'http://www.advertising.dcx/?pid='+page_id+'&adid='+banner_id+'&rid='+creative_id;
    } else if(id_val == true){
        referrer = 'http://www.'+page_id+'.dcx/?pid='+page_id+'&adid='+banner_id+'&rid='+creative_id;
    } else {
            referrer = "";
    }
    
    if(page_id == null || page_id == "")page_id = " ";
    if(banner_id == null || banner_id == "")banner_id = " ";
    if(creative_id == null || creative_id == "")creative_id = " ";
    if(mktprgm == null || mktprgm == "" || "".equals( mktprgm ))mktprgm = "unset";
    
    // Set cookie if needed
    if(id_val != "nothing"){
        var name = "mktcodes";
        var myDate = new Date();
        var value = "|" + unescape(page_id) + "|" + unescape(banner_id) + "|" + unescape(creative_id) + "|" + unescape(mktprgm) + "|" + myDate.valueOf();
        var expires = new Date(); //Cookie expires in 45 days
        expires.setDate(expires.getDate() + 45);
        var path = "/";
        // get the full url string, http://www..com/dir/page.html?x=y...
        var url = new String( window.location );
        // strip off the leading protocol ("http://") and strip any trailing file-path and query string
        var domain = url.substring(7, url.indexOf( ".com/"));
        // strip off any preceding subdomains (www.sub.subsub...)
        domain = domain.substring(domain.lastIndexOf(".") + 1, domain.length) + ".com";
        //set the domain for the cookie
        var cookieDomain = url.substring(7, url.indexOf( ".com/"))+".com";
        document.cookie = name+"="+value+";expires="+expires.toGMTString()+";path="+path+";host="+cookieDomain+";false";
    }
    
    // WSS code
    var _hbEC=0, _hbE=new Array;
    function _hbEvent(a,b){
        b=_hbE[_hbEC++]=new Object();
        b._N=a;
        b._C=0;
        return b;
    }
    var hbx=_hbEvent("pv");
    hbx.vpc="HBX0100u";
    hbx.gn="ehg-chrysler.hitbox.com";
    var removespecial = document.title.replace(/[\',\",#,&,!,$,%,^,*,:,|,\/,>,<,~,;]/g,'');
    var mlcSplit = location.pathname.split("/");
    var mlcSplice = mlcSplit.splice(0, mlcSplit.length -1);
    var mlcJoin = mlcSplice.join("/");
    var mlc = mlcJoin.toLowerCase();
    var cv = _hbEvent("cv");
    
    hbx.acct  = "DM550803F9DZ";
    hbx.pn    = removespecial.replace(/\s/g,"+");
    hbx.pndef = "title";
    hbx.ctdef = "full";
    hbx.dcmpn = "pid";
    hbx.hqsp  = "adid";
    hbx.hrf   = referrer;
    
    // Optional Variables
    hbx.lt="auto";
    hbx.dlf=".pdf,.zip,.hqx!.jsp,.htm,.html";
    cv.c21=location.protocol+'//'+location.host+location.pathname;
    cv.c22=location.search.substring(1, location.search.length);
    
    var url_pieces = location.hostname.split(".");
    var env = url_pieces[0].toLowerCase();
    
    // use the testing account unless on live
    if( env != "www" ){
        hbx.acct = "DM550803GNAM";
    }
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    // FLASH PAGE TRACKING
    // argMLCadd (value to be added to page's root mlc. lang will be added as final category)
    // argPN (page name): optional, will use current pn if not defined
    
    function flashPageTracking( argMLCadd, argPN ) {
        // strip starting or trailing slashed from arg
        // NEED regex
        var newMLC = argMLCadd;
        newMLC = root_mlc+"/"+newMLC+"/"+lang;
        var newPN = "";
            if( argPN ) argPN.replace(/[^a-zA-Z0-9,\s,+,-]/g,'').replace(/\s+/g,"+");
        // send new values
        if( argPN ) _hbSet('n', newPN);
        _hbSet('vcon', newMLC);
        _hbSend();
    }
    
    // FLASH LINK TRACKING
    // argLid (link id): required
    // argLpos (link position): optional
    // this will use existing mlc and pn values
    
    function flashLinkTracking( argLID, argLPOS ) {
        var newLID = argLID.replace(/[^a-zA-Z0-9,\s,+,-]/g,'').replace(/\s+/g,"+");
        var newLPOS = "";
            if( argLPOS ) argLPOS.replace(/[^a-zA-Z0-9,\s,+,-]/g,'').replace(/\s+/g,"+");
        var newHEC = 1;
        // send new values
        _hbSet('lid', newLID);
        if( argLPOS ) _hbSet( 'lpos', newLPOS );
        _hbSet('hec', newHEC);
        _hbSend();
    }
