
var tag_max_debug_count = 15;
var tag_debug_count = 0;



//tag_stepId function - determine what step of the process the guest is on in eres - uses omniture s_prop5 value to determine
function tag_stepId() {
    try {
        if (readQueryString('override_step') != '') {
            return readQueryString('override_step');
        }

        var val = s_prop5;
        val = val.replace(/\s+/g, '');
        val = val.toLowerCase();

        switch (val) {
            case 'reservations:checkavailability': return 1;
            case 'reservations:selectroom': return 2;
            case 'reservations:preferences': return 3;
            case 'reservations:reviewyourreservation': return 4;
            case 'reservations:reservationconfirmation': return 5;
        }
        //do normal routine to get stepid
    } catch (e) {
        if (tag_isDebug()) {
            alert(e);
            tag_debug_count++;
            return -1;
        }
    }
}



//tag_isLoggedIn function - determine whether guest is logged in as TR member or not
function tag_isLoggedIn() {
    try {
        return isCookieExist("userSessionCookie");
    } catch (e) {
        if (tag_isDebug()) {
            alert(e);
            tag_debug_count++;
            return false;
        }
    }
}


/* tag_propertyCode function - to determine property code - currently being bypassed by passing in the omniture s_prop1 value - this funciton is only working in IE */
function tag_propertyCode() {
    var propertycode = '';

    try {
        if (document.getElementById('propCode')) {
            propertycode = document.getElementById('propCode').value;
        }
    } catch (e) {
        if (tag_isDebug() && tag_debug_count < tag_max_debug_count) {
            alert(e);
            tag_debug_count++;
        }
    }

    return propertycode;

}


//tag_market function - property code is passed to determine which market that property is in - market code is returned
function tag_market(propVal) {
    if (propVal == "CLV" || propVal == "PLV" || propVal == "LAS" || propVal == "FLV" || propVal == "RLV" || propVal == "BLV" || propVal == "ILV" || propVal == "LAU") {
        return "LVM"
    }
    else if (propVal == "ATL" || propVal == "CAC" || propVal == "BAC" || propVal == "SAC") {
        return "ACM"
    }
    else if (propVal == "REN" || propVal == "HLT" || propVal == "TAH") {
        return "RNO"
    }
    else if (propVal == "NOR" || propVal == "GBI") {
        return "GCM"
    }
    else if (propVal == "STU" || propVal == "GTU" || propVal == "UTU") {
        return "NMM"
    }
    else {
        return "none"
    }
}

//determine if script is in debug mode based on debug=1 name/value in querystring 
function tag_isDebug() {
    try {
        return (readQueryString("debug") != '');
    } catch (e) {
        return false;
    }
}


//tag_writeScriptTag function - writes the tag to the page with the url that is passed
function tag_writeScriptTag(src) {

    if (src == null || src == 'undefined' || src == '') return;

    var scriptTag = '<scrip';
    scriptTag += 't language=\"JavaScript\" src=\"' + src + '\"></s' + 'cript>';
    if (tag_isDebug()) {
        alert(scriptTag);
    }
    else {
        document.write(scriptTag);
    }


}

//tag_writeImageTag function - writes the pixel tag to the page with the url that is passed
function tag_writeImageTag(src) {

    if (src == null || src == 'undefined' || src == '') return;

    var imageTag = '<img src=\"' + src + '\" width=\"1\" height=\"1\" border=\"0\">';

    if (tag_isDebug()) {
        alert(imageTag);
    }
    else {
        document.write(imageTag);
    }


}


// ---- SECOND FILE




//function added 1-26-09 - FIT Res campaign
function writeTag_FITRES() {
    //call tag_isLoggedIn function to determine if visitor is logged in
    var loggedIn = tag_isLoggedIn();
    //call tag_stepId funciton to identify which step in eres user is on
    var step = tag_stepId();
    //pass omniture s_prop1 variable - property code to tag_market function to determine if property is part of a market
    var marketID = tag_market(s_prop1.toUpperCase());

    try {

        if (loggedIn == "false") {
            if (step == 2) {
                if (marketID == "LVM") {
                    //if on step 2 of eres process and property is in LVM market or is LAU
                    var url = 'https://view.atdmt.com/jaction/heihna_' + s_prop1.toUpperCase() + 'FITResStart_1';
                }
                else {
                    //if on step 2 of eres process and property is NOT in LVM market and is NOT LAU
                    var url = 'https://view.atdmt.com/jaction/heihb9_FITRESStep' + step + 'Start' + s_prop1.toUpperCase() + '_8';
                }

                //call tag_writeScriptTag function to write the tag to the page passing the url of the tag
                tag_writeScriptTag(url);
            }
            else if (step == 5) {
                if (marketID == "LVM") {
                    //if on step 5 - confirmation page of eres process and property is in LVM market or is LAU
                    var url = 'https://view.atdmt.com/jaction/heihna_' + s_prop1.toUpperCase() + 'FITResComplete_1';
                }
                else {
                    //if on step 5 - confirmation page of eres process and property is NOT LVM market or is NOT LAU
                    var url = 'https://view.atdmt.com/jaction/heihb9_FITRESStep' + step + 'Complete' + s_prop1.toUpperCase() + '_7';
                }

                //call tag_writeScriptTag function to write the tag to the page passing the url of the tag
                tag_writeScriptTag(url);
            }
        }

    } catch (e) {
        return false;
    }


}


//added 1-28-09 - TWS - Tunica Booking campaign
function writeTag_TunicaBooking() {
    //call tag_stepId funciton to identify which step in eres user is on
    var step = tag_stepId();
    //pass omniture s_prop1 variable - property code to tag_market function to determine if property is part of a market
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (step == 5) {
            if (marketID == "NMM") {
                //if on step 5 - confirmation page of eres process and property is in Tunica Market
                var url = 'https://view.atdmt.com/jaction/heihb8_TunicaPubpixelBookingConf_1';

                //call tag_writeScriptTag function to write the tag to the page passing the url of the tag
                tag_writeScriptTag(url);
            }
        }

    } catch (e) {
        return false;
    }
}


//added 2-20-09 - TWS - Global Tag for first step eres
function writeTag_GlobalStep1() {
    //call tag_stepId funciton to identify which step in eres user is on
    var step = tag_stepId();
    try {
        if (step == 1) {
            var url = 'https://switch.atdmt.com/jaction/heihna_ResStarts_1';
        }
    } catch (e) {
        return false;
    }
    //call tag_writeScriptTag function to write the tag to the page passing the url of the tag
    tag_writeScriptTag(url);
}

//added 3-20-09 - TWS - Global Confirmation tag - every property outside of Vegas
function writeTag_GlobalStep5() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (marketID == "ACM") {
            if (step == 5) {
                var url = 'https://view.atdmt.com/iaction/heihbk_RESStep5' + prop + '_7';
                tag_writeScriptTag(url);
            }
        }
    } catch (e) {
        return false;
    }

}

//GWO Google Website Optimizer Code

//GoGetWet Buttons #3
function gOptimizer_FLVGoWetButtons() {
    try {
        var pageTracker = _gat._getTracker("UA-8533131-1");
        pageTracker._trackPageview("/3336597781/goal");
    }
    catch (e) {
        return false;
    }
}
if (window.location.href.indexOf("packageCode") > 0) {
    gOptimizer_FLVGoWetButtons();
}

//Escape to AC Text Change
function gOptimizer_EtAC() {
    var step = tag_stepId();
    if (step == 5) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/1832181519/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_EtAC();


//Pulse of Vegas Your Vegas vs Best Rates
function gOptimizer_POV() {
    var step = tag_stepId();
    if (step == 5) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/0554298047/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_POV();

//CLV User Review
function gOptimizer_CLVReview() {
    var step = tag_stepId();
    if (step == 3) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/0109969672/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_CLVReview();

//CLV Photosynth Test
function gOptimizer_CLVSynth() {
    var step = tag_stepId();
    if (step == 1) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/3304499931/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_CLVSynth();

//FLV Booking Mask Test
function gOptimizer_FLVBookingMask() {
    var step = tag_stepId();
    if (step == 5) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/3274221536/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_FLVBookingMask();

//FLV Homepage Logo Train Test
function gOptimizer_HETLogoTrain() {
    var step = tag_stepId();
    if (step == 5) {
        try {
            var pageTracker = _gat._getTracker("UA-8533131-1");
            pageTracker._trackPageview("/3613711776/goal");
        }
        catch (e) {
            return false;
        }
    }
}
gOptimizer_HETLogoTrain();

//Google Analytics Funnel Code
function ga_eres1() {
    var step = tag_stepId();
    if (step == 1) {
        try {
            var pageTracker = _gat._getTracker("UA-9693611-1");
            pageTracker._trackPageview();
        }
        catch (e) {
            return false;
        }
    }
}
ga_eres1();

function ga_eres2() {
    var step = tag_stepId();
    if (step == 2) {
        try {
            var pageTracker = _gat._getTracker("UA-9693611-1");
            pageTracker._trackPageview();
        }
        catch (e) {
            return false;
        }
    }
}
ga_eres2();

function ga_eres3() {
    var step = tag_stepId();
    if (step == 3) {
        try {
            var pageTracker = _gat._getTracker("UA-9693611-1");
            pageTracker._trackPageview();
        }
        catch (e) {
            return false;
        }
    }
}
ga_eres3();

function ga_eres4() {
    var step = tag_stepId();
    if (step == 4) {
        try {
            var pageTracker = _gat._getTracker("UA-9693611-1");
            pageTracker._trackPageview();
        }
        catch (e) {
            return false;
        }
    }
}
ga_eres4();

function ga_eres5() {
    var step = tag_stepId();
    if (step == 5) {
        try {
            var pageTracker = _gat._getTracker("UA-9693611-1");
            pageTracker._trackPageview();
        }
        catch (e) {
            return false;
        }
    }
}
ga_eres5();



//End GWO Code


//added 4/24/09 by jlp - BKV Step 5 tag for all props
//added 2 additional yieldmanager tags 5/5/09 - jlp
function writeTag_bkvStep5() {
    var step = tag_stepId();
    try {
        if (step == 5) {
            document.write('<img src="https://b.collective-media.net/seg/cm/ai_harrahs_c" width="1" height="1" />');
            document.write('<img src="https://ad.yieldmanager.com/pixel?id=436529&t=2" width="1" height="1" />');
            document.write('<img src="https://ad.yieldmanager.com/unpixel?id=436533" width="1" height="1" />');
        }
    }
    catch (e) {
        return false;
    }

}

//added 5/7/09 by tws - Ogilvy - step 5 confirmation extended data tag for all AC props
//Captures number of nights and total booking piece
function writeTag_ACMEscapeExtendedTag() {
    var marketID = tag_market(s_prop1.toUpperCase());
    var step = tag_stepId();
    try {
        if (marketID == "ACM") {
            if (step == 5) {
                //conrimation ID
                var pConf = s_eVar21.substring(0, 5);
                //prop code
                var pProp = s_eVar21.substring(5, 8);
                //pID = prop code and confirmation added together to be passed to tag
                var pID = pProp + "_" + pConf;

                var prodArray = s_products.split(",");
                //total nights passed to tag
                var ttlNights = prodArray.length;
                var ttlCost = 0;
                var i = 0;
                for (i = 0; i < prodArray.length; i++) {
                    var grp = prodArray[i].split(";");
                    //total revenue pass to tag
                    ttlCost = ttlCost + parseFloat(grp[3]);

                }

                //find cash or comp
                var payType;
                if (s_products.indexOf("paid") != -1) {
                    payType = "Cash";
                }
                else {
                    payType = "Comp";
                }

                var url = 'https://view.atdmt.com/action/heihna_HETEscapeBookingConfED_8/v3/ato.' + pID + '/[atm1.1/atm2.' + ttlCost + '/atm3.' + ttlNights + '/atc1.' + pProp + '/atc2.' + payType + ']'
                tag_writeImageTag(url);
            }
        }
    } catch (e) {
        return false;
    }

}

//added 5/11/09 - jlp - Vegas remessaging tags
function writeTag_RemessageVegas() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (marketID == "LVM") {
            if (step == 1) {
                var url = 'https://view.atdmt.com/jaction/heihna_' + prop + 'BookingAbandonerStep1_1';
                tag_writeScriptTag(url);
            }
        }
    } catch (e) {
        return false;
    }
}

//added 5/22/09 - jlp - BKV enterprise remessaging tag
function writeTag_RemessageAll() {
    var step = tag_stepId();
    try {
        if ((step == 1) || (step == 2) || (step == 3) || (step == 4)) // Don't put tag on the confirmation page
        {
            var url = 'https://view.atdmt.com/jaction/heihb9_HarrahsSiteWideRemessagingTag_10';
            tag_writeScriptTag(url);
        }
    } catch (e) {
        return false;
    }
}

//added 5/22/09 - jlp - BKV QuantCast pixel
function writeTag_QuantCast() {
    var step = tag_stepId();
    try {
        if (step == 5) {
            var url = 'https://secure.leadback.advertising.com/adcedge/lb?site=695501&srvc=1&betr=harenter_cs=2&betq=8358=401897';
            tag_writeImageTag(url);
        }
    } catch (e) {
        return false;
    }
}

//added 5/29/09 - jlp - ValueClick pixel for BKV
function writeTag_ValueClick() {
    var step = tag_stepId();
    try {
        if (step == 5) {
            var url = 'https://secure.fastclick.net/w/roitrack.cgi?aid=8299';
            tag_writeImageTag(url);
        }
    } catch (e) {
        return false;
    }
}

//added 6/08/09 - jlp - AC Pub Pixel for BKV
function writeTag_ACPub() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (marketID == "ACM") {
            if (step == 5) {
                document.write('<iframe src="https://view.atdmt.com/iaction/heihbk_ACPubpixelBookingConf_7" width="1" height="1" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"></iframe>');
            }
        }
    } catch (e) {
        return false;
    }
}

//added 6/30/09- JLP - WCL pixel for BKV
function writeTag_WCLBooking() {
    //call tag_stepId funciton to identify which step in eres user is on
    var step = tag_stepId();
    // use omniture s_prop1 variable to set prop code variable
    var propCode = s_prop1.toUpperCase();
    try {
        if (step == 5) {
            if (propCode == "WCL") {
                //if on step 5 - confirmation page of eres process and property is Caesars Windsor
                var url = 'https://view.atdmt.com/jaction/heihbk_RESStep5WCL_1';

                //call tag_writeScriptTag function to write the tag to the page passing the url of the tag
                tag_writeScriptTag(url);
            }

        }

    } catch (e) {
        return false;
    }
}

//updated 7/29/09 - jlp - "Other" Pub Pixel for BKV (specific one-off props outside of major markets)
function writeTag_OtherPub() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    // var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if ((prop == "AKC") || (prop == "CHE") || (prop == "COU") || (prop == "GBI") || (prop == "HBR") || (prop == "HLT") || (prop == "JOL") || (prop == "LAD") || (prop == "MET") || (prop == "NKC") || (prop == "NOR") || (prop == "REN") || (prop == "RIN") || (prop == "SAC") || (prop == "STL") || (prop == "TAH") || (prop == "UBC") || (prop == "UEL") || (prop == "WCL")) {
            if (step == 5) {
                document.write('<iframe src="https://switch.atdmt.com/iaction/heihbk_OtherPubpixelBookingConf_1" width="1" height="1" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"></iframe>');
            }
        }
    } catch (e) {
        return false;
    }
}

//added 8/04/09 - jlp -  MS test for BKV
function writeTag_ACPubMS() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (marketID == "ACM") {
            if (step == 5) {
                document.write('<img height="1" width="1" src="https://view.atdmt.com/action/MS_HAR_CPA_Confirm2_AC" />');
            }
        }
    } catch (e) {
        return false;
    }
}

//updated 11/4/09 - tws - removed Tunica props - "Other" MS test for BKV
function writeTag_OtherPubMS() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    // var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if ((prop == "AKC") || (prop == "CHE") || (prop == "COU") || (prop == "GBI") || (prop == "HBR") || (prop == "HLT") || (prop == "JOL") || (prop == "LAD") || (prop == "MET") || (prop == "NKC") || (prop == "NOR") || (prop == "REN") || (prop == "RIN") || (prop == "SAC") || (prop == "STL") || (prop == "TAH") || (prop == "UBC") || (prop == "UEL") || (prop == "WCL")) {
            if (step == 5) {
                document.write('<img height="1" width="1" src="https://view.atdmt.com/action/MS_HAR_CPA_Confirm1_Other" />');
            }
        }
    } catch (e) {
        return false;
    }
}

//updated 11/04/09 - tws - removed tunica tags - another BKV other pixel
function writeTag_OtherAdTag() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    // var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if ((prop == "AKC") || (prop == "CHE") || (prop == "COU") || (prop == "GBI")|| (prop == "HBR") || (prop == "HLT") || (prop == "JOL") || (prop == "LAD") || (prop == "MET") || (prop == "NKC") || (prop == "NOR") || (prop == "REN") || (prop == "RIN") || (prop == "SAC") || (prop == "STL") || (prop == "TAH") || (prop == "UBC") || (prop == "UEL") || (prop == "WCL")) {
            if (step == 5) {
                document.write('<img src="https://servedby.advertising.com/action/type=965354562/bins=1/rich=0/mnum=1516/site=695501/logs=0/betr=harrah_cs=2" width="1" height="1" border="0" />');
            }
        }
    } catch (e) {
        return false;
    }
}

//added 8-27-09 - TWS - Pulse 360/BKV tag
function writeTag_Pulse360() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    var tCode;
    try {
        if (step == 5) {
            if ((prop == "UTU") || (prop == "GBI") || (prop == "TAH") || (prop == "UEL") || (prop == "GTU")) {
                switch (prop) {
                    case "UTU":
                        tCode = "92169340";
                        break;
                    case "GBI":
                        tCode = "92169342";
                        break;
                    case "TAH":
                        tCode = "92169346";
                        break;
                    case "UEL":
                        tCode = "92136055";
                        break;
                    case "GTU":
                        tCode = "92169344";
                        break;
                }

                document.write("<script type=\"text/javascript\" language=\"JavaScript\" src=\"https://track.pulse360.com/cgi-bin/tracker.cgi?id=" + tCode + "&type=signups\" ></script>");
                document.write("<noscript><img height=1 width=1 border=0 style=\"display:none;\" src=\"https://track.pulse360.com/cgi-bin/tracker.cgi?id=" + tCode + "&type=signups&noscript=1\"></noscript>");

                successfully_converted();
            }
        }
    }
    catch (e) {
        return false;
    }
}

//added 9-8-09 - tws - Tunica Properties booking abandoner tag.
function writeTag_TunicaAbandoner() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
        if (marketID == "NMM") {
            if (step == 2) {
                tag_writeScriptTag("https://view.atdmt.com/jaction/heihna_" + prop + "Step2BookingAbandoners_1");
            }
        }
    } catch (e) {
        return false;
    }
}

//added 10-9-09 tws Reno Booking abandoners
function writeTag_RenoAbandoner() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    try {
        if (prop == "REN") {
            switch (step) {
                case 1:
                    var url = 'https://switch.atdmt.com/jaction/heihb8_RenoStep1BookingAbandoners_1';
                    break;

                case 2:
                    var url = 'https://switch.atdmt.com/jaction/heihb8_RenoStep2BookingAbandoners_1';
                    break;

                case 3:
                    var url = 'https://switch.atdmt.com/jaction/heihb8_RenoStep3BookingAbandoners_1';
                    break;
            }
            tag_writeScriptTag(url);
        }
    } catch (e) {
        return false;
    }
}

//added 11/23/09 - jlp - Chelsea cross-sell link on sold out step 1 for CAC.
function writeLink_ChelseaAC() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    try {
		if (prop == "CAC") 
		{
			if (s_eVar42 == "Check Availability:Cross Sell Grid") 
			{
				var cac_chelsea_obj = document.getElementById("BelowFloats");
				var cac_chelsea_content = "<table width=\"650\" style=\"border:solid 1px #000000\" cellpadding=\"3\" cellspacing=\"0\"><tr><td><a target=\"_chelsea\" href=\"https://gc.synxis.com/rez.aspx?Hotel=22007&Chain=8687&shell=TCH&promo=Caesar&utm_source=caesars&utm_medium=freelisting&utm_campaign=caesarslisting\"><img src=\"/images/casinos/TheChelsea_70x45.jpg\" width=\"70\" height=\"45\" border=\"0\" /></a></td><td><a target=\"_chelsea\" href=\"https://gc.synxis.com/rez.aspx?Hotel=22007&Chain=8687&shell=TCH&promo=Caesar&utm_source=caesars&utm_medium=freelisting&utm_campaign=caesarslisting\"><img src=\"/images/casinos/TheChelseaLogo.gif\" width=\"90\" height=\"19\" border=\"0\" /></a></td><td>&nbsp;</td><td valign=\"middle\">From C to shining C, also check out our partner hotel <a target=\"_chelsea\" href=\"https://gc.synxis.com/rez.aspx?Hotel=22007&Chain=8687&shell=TCH&promo=Caesar&utm_source=caesars&utm_medium=freelisting&utm_campaign=caesarslisting\"><b>The Chelsea</b></a> for your stay in Atlantic City.</td></tr></table><br /><br />";
				cac_chelsea_obj.innerHTML = cac_chelsea_content + cac_chelsea_obj.innerHTML;
			}
		}
    } catch (e) {
        return false;
    }
}

//added 12-1-09 - tws - Netmining Tag for Neo
function writeTag_NetMineConfirmation() {
    var step = tag_stepId();
    try {
        
        if (step == 5) 
        {
            //conrimation ID
            var pConf = s_eVar21.substring(0, 5);
            //prop code
            var pProp = s_eVar21.substring(5, 8);
            //pID = prop code and confirmation added together to be passed to tag
            var pID = pProp + "_" + pConf;

            var prodArray = s_products.split(",");
            //total nights passed to tag
            var ttlNights = prodArray.length;
            var ttlCost = 0;
            var i = 0;
            for (i = 0; i < prodArray.length; i++) {
                var grp = prodArray[i].split(";");
                //total revenue pass to tag
                ttlCost = ttlCost + parseFloat(grp[3]);
            }
			document.write("<IFRAME SRC=\"https://fls.doubleclick.net/activityi;src=2558013;type=confi945;cat=harra113;qty=1;cost=" + ttlCost + ";u2=" + ttlCost + ";u1=" + pID + ";ord=" + pID + "?\" width=\"1\" height=\"1\" frameborder=\"0\"></iframe> ");
        }
        
    } catch (e) {
        return false;
    }
}

//added 3-18-2010 - tws - Netmining Tag - all but confirmation page
function writeTag_NetMine4Steps() {
    var step = tag_stepId();
    try {
        
        if (step != 5) 
        {
            document.write("<script src='https://mdfst.netmng.com/?aid=173' type='text/javascript' defer='defer'></script>");
        }
        
    } catch (e) {
        return false;
    }
}

//added 3-9-2010 - tws - BKV - Booking abandoners for all props not in LV market
function writeTag_BKVBookingAbandoner() {
    var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
    try {
    
    	if (marketID != "LVM") {
    
	        if (step == 1)
	        {
	            var url = 'https://view.atdmt.com/jaction/heihna_' + prop + 'BookingAbandonerStep1';
	            tag_writeScriptTag(url);
	        }
	        else if(step == 2)
	        {
	        	var url = 'https://view.atdmt.com/jaction/heihna_' + prop + 'BookingAbandonerStep2';
	            tag_writeScriptTag(url);
	        }
	        else if (step == 3)
	        {
	        	var url = 'https://view.atdmt.com/jaction/heihna_' + prop + 'BookingAbandonerStep3';
	            tag_writeScriptTag(url);
	        }
	      }
    } catch (e) {
        return false;
    }
}

//added 3-9-2010 - BKV - booking confirmation by Market - all markets but LVM
function writeTag_BKVMarketConfirmation(){
	var step = tag_stepId();
    var prop = s_prop1.toUpperCase();
    var marketID = tag_market(s_prop1.toUpperCase());
	try {
    
    	if (step == 5) {
    
	        if (marketID == "NMM")
	        {
	            var url = 'https://view.atdmt.com/jaction/heihna_TunicaMarketConfirmation';
	            tag_writeScriptTag(url);
	        }
	        else if(marketID == "ACM")
	        {
	        	var url = 'https://view.atdmt.com/jaction/heihna_AtlanticCityMarketConfirmation';
	            tag_writeScriptTag(url);
	        }
	        else if (marketID == "RNO")
	        {
	        	var url = 'https://view.atdmt.com/jaction/heihna_RenoTahoeMarketConfirmation';
	            tag_writeScriptTag(url);
	        }
	   }
    } catch (e) {
        return false;
    }
}


//5-7-2010 split from BKVMarketConfirmation tag above - needs to fire on all property bookings 
function writeTag_BKVAllPropsConfirmation(){
	var step = tag_stepId();
	try {

		if (step == 5) {
			var url = 'https://view.atdmt.com/iaction/heihna_CompanyWideBookingConfirmation';
			tag_writeScriptTag(url);
		}
	} catch (e) {
		return false;
	}
}

//added 3-19-2010 - Test and Target Conversion tracking
function writeTag_TNTConvert() {
    var step = tag_stepId();
    try {
        
        if (step == 5) 
        {
            document.write("<div class='mboxDefault'></div><script>mboxCreate('orderConfirmPage');</script>");
        }
        
    } catch (e) {
        return false;
    }
}

//added 4-1-2010 - tws - Planet Hollywood
function writeTag_PHVActiontag() {
	var step = tag_stepId();
	var prop = s_prop1.toUpperCase();
	try {

		if (prop == "PHV") {
			if ((step == 1) || (step == 2) || (step ==3)) {
				var url = 'https://view.atdmt.com/jaction/heihna_PlanetHollywoodResort_BookStep' + step + '';
				tag_writeScriptTag(url);
			}
		}
	} catch (e) {
		return false;
	}
}


//added 4-14-2010 insider circle tracking - tws
function writeTag_InsiderCircle() {
	var step = tag_stepId();
	try {
		if (step == 5) {
			
			var dyna = document.getElementById("dynamic");
      		dyna.src="https://www.insidercircle.net/convert.js"; 

			
			function callTag(){
				var prodArray = s_products.split(",");
				//total nights passed to tag
				var ttlNights = prodArray.length;
				var ttlCost = 0;
				var i = 0;
				for (i = 0; i < prodArray.length; i++) {
					var grp = prodArray[i].split(";");
					//total revenue pass to tag
					ttlCost = ttlCost + parseFloat(grp[3]);
					
				}
				
				var tracker = new insiderConversion(ttlCost);
				
				tracker.record();
				
				
			}
			
			setTimeout(callTag, 7000);
			
		}
		
	} catch (e) {
		return false;
	}
}

writeTag_BKVAllPropsConfirmation();

writeTag_InsiderCircle();

writeTag_PHVActiontag();

writeTag_TNTConvert();

writeTag_NetMine4Steps();

writeTag_BKVMarketConfirmation();

writeTag_BKVBookingAbandoner();

writeTag_NetMineConfirmation();

writeTag_RenoAbandoner();

writeTag_TunicaAbandoner();

writeTag_Pulse360();

writeTag_GlobalStep1();

writeTag_FITRES();

writeTag_TunicaBooking();

//writeTag_GlobalStep5();

writeTag_bkvStep5();

writeTag_ACMEscapeExtendedTag();

writeTag_RemessageVegas();

writeTag_RemessageAll();

writeTag_QuantCast();

writeTag_ValueClick();

writeTag_ACPub();

writeTag_WCLBooking();

//writeTag_OtherPub();

writeTag_ACPubMS();

writeTag_OtherPubMS();

writeTag_OtherAdTag();

writeLink_ChelseaAC();


