// Generic variables and arrays var theHost = location.hostname; var queryString = window.location.search; var partner_portals = new Array(); var partner_games = new Array(); var dest_urls = new Array(); var args = new Array(); var add_ouid = false; var add_pr = false; var d_valid = false; // Whether or NOT there is a valid Destination var cb_valid = false; // Whether or NOT there is a valid Cobrand ID var qss = false; // Query String started indicator var build_string = ""; var dest_type_id = 1; // See the email_destination_types database table var extra_param = ""; // See the email_destinations.param database field // Variables derived from parsing the queryString var cb = getValue(queryString, 'cb='); // cobrand_id var p = getValue(queryString, 'p='); // partner_id var ww = getValue(queryString, 'ww='); // go to worldwinner portal instead of partner var d = getValue(queryString, 'd='); // destination code var c = getValue(queryString, 'c='); // cID var t = getValue(queryString, 't='); // tournament_id var u = getValue(queryString, 'u='); // username var g = getValue(queryString, 'g='); // game_id var o = getValue(queryString, 'o='); // Obfuscated UserId var iv = getValue(queryString, 'iv='); // Inviter UserId var pm = getValue(queryString, 'pm='); // Whether or not to pass the promo param var e = getValue(queryString, 'e='); // email var pr = getValue(queryString, 'pr='); // Whether or not to set the promoCR cookie // One year timestamp for playerdata and cobrandID cookies. var theYearDate = new Date(); theYearDate.setTime(theYearDate.getTime() + (31536000000)); // Build the following arrays by reading from the database. // The default "partner" destinations. Use zero since no cobrand_id is zero. // Check for a valid cobrand and destination while already in the foreach loops. partner_portals[0] = 'http%3A//'+theHost; partner_games[0] = 'http%3A//'+theHost+'/cgi/tournament/list_single.pl%3Fgame_id%3D'; partner_portals[4] = 'http%3A//www.pogo.com/ww/signup-jump.jsp%3Fsite%3Dpogo'; partner_games[4] = 'http%3A//www.pogo.com/ww/signup-jump.jsp%3Fsite%3Dpogo&siurl=http%3A//www.worldwinner.com/cgi/tournament/list_single.pl%3Fgame_id%3D'; if( cb == "4" ) { // We have a valid cobrand. cb_valid = true; } partner_portals[32] = 'http%3A//www.paidgameplayer.com/admin/wwreg.aspx'; partner_games[32] = 'http%3A//www.paidgameplayer.com/admin/wwreg.aspx?siurl=http%3A//www.worldwinner.com/cgi/tournament/list_single.pl%3Fgame_id%3D'; if( cb == "32" ) { // We have a valid cobrand. cb_valid = true; } dest_urls[1] = 'http%3A//'+theHost+'/cgi/tournament/list_all.pl'; if( d == "1" ) { // We have a valid destination. d_valid = true; dest_type_id = "4"; extra_param = getValue(queryString, '='); } dest_urls[2] = 'http%3A//'+theHost+'/cgi/tournament/list_all.pl'; if( d == "2" ) { // We have a valid destination. d_valid = true; dest_type_id = "5"; extra_param = getValue(queryString, '='); } dest_urls[3] = 'http%3A//'+theHost+'/cgi/tournament/list_more.pl'; if( d == "3" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[4] = 'http%3A//'+theHost+'/cgi/tournament/leaders.pl'; if( d == "4" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[5] = 'https%3A//'+theHost+'/cgi/finance/deposit.pl'; if( d == "5" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[6] = 'http%3A//'+theHost+'/cgi/help/index.html'; if( d == "6" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[7] = 'http%3A//'+theHost+'/cgi/finance/change_email.html'; if( d == "7" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[8] = 'http%3A//'+theHost+'/cgi/tournament/leaders.pl'; if( d == "8" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[9] = 'http%3A//'+theHost+'/cgi/lostPassword.pl%3Fu%3D'; if( d == "9" ) { // We have a valid destination. d_valid = true; dest_type_id = "2"; extra_param = getValue(queryString, '='); } dest_urls[10] = 'http%3A//'+theHost+'/cgi/tournament/list_invite.pl'; if( d == "10" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[11] = 'http%3A//'+theHost+'/cgi/email_confirmation.pl'; if( d == "11" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[12] = 'http%3A//'+theHost+'/cgi/email_confirmation.pl'; if( d == "12" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[13] = 'http%3A//'+theHost+'/cgi/finance/merch_redeem.pl'; if( d == "13" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[14] = 'http%3A//'+theHost+'/cgi/tournament/list_all.pl'; if( d == "14" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[15] = 'http%3A//'+theHost+'/cgi/tournament/topthis/whatistopthis.pl'; if( d == "15" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[16] = 'http%3A//'+theHost+'/cgi/tournament/thisweek.pl'; if( d == "16" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[17] = 'http%3A//'+theHost+'/cgi/tournament/megatourn/main.pl%3Fevent_id%3D'; if( d == "17" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'm='); } dest_urls[18] = 'http%3A//'+theHost+'/cgi/community/searchProc.pl%3Fusername%3D'; if( d == "18" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'sn='); } dest_urls[19] = 'http%3A//'+theHost+'/cgi/finance/setReload.pl'; if( d == "19" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[20] = 'http%3A//'+theHost+'/cgi/points/matrix.html'; if( d == "20" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[21] = 'http%3A//'+theHost+'/cgi/tournament/specialTourn.pl%3Fevent_id%3D'; if( d == "21" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'm='); } dest_urls[22] = 'http%3A//'+theHost+'/cgi/tournament/ladder/SeedEvent.html%3Fgame_id%3D'; if( d == "22" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'g='); } dest_urls[23] = 'http%3A//'+theHost+'/cgi/tournament/list_invite.pl'; if( d == "23" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[24] = 'http%3A//'+theHost+'/cgi/lostPassword.pl'; if( d == "24" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[25] = 'http%3A//'+theHost+'/cgi/points/redeem0.pl'; if( d == "25" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[26] = 'http%3A//server.iad.liveperson.net/hc/52168016/%3Fcmd%3Dfile%26file%3DvisitorWantsToChat%26site%3D52168016%26byhref%3D1%26SESSIONVAR%21identifier%3D'; if( d == "26" ) { // We have a valid destination. d_valid = true; dest_type_id = "2"; extra_param = getValue(queryString, '='); } dest_urls[27] = 'http%3A//'+theHost+'/cgi/finance/account.pl'; if( d == "27" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[28] = 'http%3A//'+theHost+'/cgi/finance/profile.pl'; if( d == "28" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[29] = 'https%3A//'+theHost+'/cgi/finance/e_deposit.pl'; if( d == "29" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[30] = 'http%3A//'+theHost+'/cgi/calendar.html'; if( d == "30" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[31] = 'http%3A//'+theHost+'/cgi/conversion/limited_offer.html'; if( d == "31" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[32] = 'http%3A//'+theHost+'/cgi/tournament/ComingSoon.pl%3Fgame_id%3D'; if( d == "32" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[33] = 'http%3A//'+theHost+'/cgi/tournament/list_category.pl%3Fcategory_id%3D'; if( d == "33" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'ci='); } dest_urls[34] = 'http%3A//'+theHost+'/cgi/about/mascots.html'; if( d == "34" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[35] = 'http%3A//'+theHost+'/cgi/tournament/challengeDetail.html'; if( d == "35" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[36] = 'http%3A//'+theHost+'/cgi/tournament/gameIntro.html'; if( d == "36" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[37] = 'http%3A//'+theHost+'/cgi/nosession/wheel_of_fortune.html'; if( d == "37" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[38] = 'http%3A//'+theHost+'/cgi/tournament/survival/standings.html%3Fsurvival_id%3D'; if( d == "38" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'sv='); } dest_urls[39] = 'https%3A//'+theHost+'/cgi/finance/checks0.html'; if( d == "39" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[40] = 'http%3A//'+theHost+'/cgi/rewards/milestones.html'; if( d == "40" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[41] = 'http%3A//'+theHost+'/cgi/rewards/index.html'; if( d == "41" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[42] = 'http%3A//'+theHost+'/cgi/community/challenges_how.pl'; if( d == "42" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[43] = 'http%3A//'+theHost+'/cgi/tour/0.html'; if( d == "43" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[44] = 'http%3A//'+theHost+'/cgi/tournament/list_single.pl%3Fgame_id%3D'; if( d == "44" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'g='); } dest_urls[45] = 'http%3A//'+theHost+'/cgi/tournament/victoryPoints.pl'; if( d == "45" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[46] = 'http%3A//'+theHost+'/cgi/tournament/Specials.pl%3Ftab_id%3D'; if( d == "46" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'ti='); } dest_urls[47] = 'http%3A//'+theHost+'/cgi/tour/00.html'; if( d == "47" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[48] = 'http%3A//'+theHost+'/cgi/finance/tournRecords.pl'; if( d == "48" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[49] = 'http%3A//'+theHost+'/cgi/calendar.html'; if( d == "49" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[50] = 'http%3A//'+theHost+'/cgi/textMsg.html'; if( d == "50" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[51] = 'http%3A//'+theHost+'/cgi/premier/index.html'; if( d == "51" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[53] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=HappyHour'; if( d == "53" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[54] = 'http%3A//'+theHost+'/cgi/tournament/HappyHour.pl'; if( d == "54" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[55] = 'http%3A//'+theHost+'/cgi/community/overview.pl?LinkTrack=tab.community.4'; if( d == "55" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, 'ca='); } dest_urls[56] = 'http%3A//'+theHost+'/cgi/community/overview.pl?LinkTrack=tab.community.4'; if( d == "56" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, 'ca='); } dest_urls[57] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=NewHearts'; if( d == "57" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[58] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=SpiderSolitaire'; if( d == "58" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[59] = 'http%3A//'+theHost+'/cgi/tournament/consumerAd.pl%3Fcati_id%3D'; if( d == "59" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'ci='); } dest_urls[60] = 'http%3A//'+theHost+'/cgi/tournament/Specials.pl?tab_id=1'; if( d == "60" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[61] = 'http%3A//'+theHost+'/cgi/about/charityotm.html'; if( d == "61" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[62] = 'http://www.worldwinner.com/cgi/tournament/Specials.pl?tab_id=8'; if( d == "62" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[63] = 'http%3A//'+theHost+'/cgi/promos/dod.html'; if( d == "63" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[64] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl%3Ffeature%3D'; if( d == "64" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'cs='); } dest_urls[65] = 'http%3A//'+theHost+'/cgi/promos/its_a_gas.html'; if( d == "65" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[66] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=NewSpades'; if( d == "66" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[67] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=ThePriceIsRight'; if( d == "67" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[68] = 'http%3A//'+theHost+'/cgi/promos/triple_play.html'; if( d == "68" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[69] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=WOF'; if( d == "69" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[70] = 'http%3A//'+theHost+'/cgi/community/virtual_gift.pl'; if( d == "70" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[71] = 'http://www.worldwinner.com/cgi/community/overview.pl'; if( d == "71" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[72] = 'http%3A//'+theHost+'/cgi/about/charityotm.html'; if( d == "72" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[73] = 'http%3A//'+theHost+'/cgi/tournament/bracket/championship.pl%3Fbracket_id%3D'; if( d == "73" ) { // We have a valid destination. d_valid = true; dest_type_id = "3"; extra_param = getValue(queryString, 'br='); } dest_urls[74] = 'https%3A//'+theHost+'/cgi/tax/reporting.html'; if( d == "74" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[75] = 'http%3A//'+theHost+'/cgi/forums/messagelist.html?tid=88298&fid=26&cid=1&page=1'; if( d == "75" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[76] = 'http://www.worldwinner.com/cgi/forums/topiclist.html?fid=26&cid=1'; if( d == "76" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[77] = 'http%3A//'+theHost+'/cgi/w3games.pl'; if( d == "77" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[78] = 'http%3A//'+theHost+'/cgi/promos/gamelovers.html'; if( d == "78" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[79] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=SportsTrivia'; if( d == "79" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[80] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=SportsTriviaLive'; if( d == "80" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[81] = 'http%3A//'+theHost+'/cgi/login.html'; if( d == "81" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[82] = 'http%3A//'+theHost+'/cgi/promos/april_showers.html'; if( d == "82" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[83] = 'http%3A//'+theHost+'/cgi/promos/rainy_day.html'; if( d == "83" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[84] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=Jeopardy'; if( d == "84" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[85] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=TheMoneyList'; if( d == "85" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[86] = 'http%3A//'+theHost+'/cgi/ComingSoon.pl?feature=BejeweledTwist'; if( d == "86" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[87] = 'http%3A//'+theHost+'/cgi/promos/playcation.html'; if( d == "87" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[88] = 'http%3A//'+theHost+'/cgi/community/refer.pl?LinkTrack=sectionTabs.profile4'; if( d == "88" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[89] = 'http%3A//'+theHost+'/cgi/rewards/milestones.html?subnav_id=1'; if( d == "89" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[90] = 'http%3A//'+theHost+'/cgi/promos/refer-a-friend.html'; if( d == "90" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } dest_urls[91] = 'http%3A//'+theHost+'/cgi/promotions.html'; if( d == "91" ) { // We have a valid destination. d_valid = true; dest_type_id = "1"; extra_param = getValue(queryString, '='); } if( cb != "undefined" && cb != "" ) { // See if we need to make a cobrandID cookie. if( cb == 2 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 3 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 4 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 5 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 7 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 8 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 9 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 10 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 11 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 12 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 13 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 14 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 15 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 16 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 17 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 18 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 19 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 20 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 21 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 22 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 23 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 24 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 25 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 26 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 27 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 28 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 29 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 30 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 31 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 32 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 34 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 35 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 1 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 36 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 37 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 38 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 33 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 40 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 41 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 42 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 43 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 44 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 45 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 39 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 46 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 47 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 48 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 49 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 50 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 51 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 52 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 53 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 54 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 55 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 56 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 57 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 58 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 59 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 60 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 61 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 62 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 63 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 64 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 65 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 66 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 67 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 68 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 69 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 70 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 75 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 71 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 72 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 73 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 74 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 76 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 77 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 78 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 79 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 80 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 81 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 82 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 83 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 84 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 85 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 86 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 87 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 88 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 89 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 90 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 91 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 92 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 93 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 94 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 95 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 96 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 97 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 98 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 99 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 100 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 101 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 102 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 103 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 104 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } if( cb == 105 ) { // Write the cobrandID cookie. setCookie('cobrandID', cb, theYearDate, '/', '.worldwinner.com'); } } if( cb_valid == false || ww == 1 ) { // We did NOT get a valid cobrand_id, set it to zero. cb = 0; } if( d_valid == false ) { // We did NOT get a valid destination, set it to one. d = 1; } // Blow away session cookie to allow 'siurl' to function in all cases cookieName = theHost + "SID_"; var realCookieName = getCookieName( cookieName ); // in case there is an extension if ((realCookieName) && (cb != 0)) { // if session cookie exists, blow it away var backDate = new Date(); backDate.setTime(backDate.getTime() - (2592000000)); // go back 1 month setCookie(realCookieName, "", backDate, '/', '.worldwinner.com'); } else if ((realCookieName) && (cb == 0)) { // if we have a SID cookie and are going to WW, include 'ouid' on query string add_ouid = true; add_pr = true; } // Set ouID cookie if value was found if (o != "") { setCookie('ouID', o, null, '/', '.worldwinner.com'); } // Set promoCR cookie if value was found if (pr != "") { setCookie('promoCR', pr, null, '/', '.worldwinner.com'); } // Destination Considerations // If native WW, send directly to destination. // For dest_type_ids, see the email_destination_types database table. if( dest_type_id == 5 ) { if (cb == 0) { build_string = 'rurl=' + partner_games[cb] + g; } else { build_string = 'rurl=' + partner_games[cb] + g; } // Set query string started to true. qss = true; } else if( dest_type_id == 4 ) { build_string = 'rurl=' + partner_portals[cb]; var reBuild = /%3F/; if( reBuild.test(build_string) ) { // Set query string started to true. qss = true; } } else if( dest_type_id == 3 ) { if (cb == 0) { build_string = 'rurl=' + dest_urls[d] + extra_param; } else { build_string = 'rurl=' + partner_portals[cb] + '&siurl=' + dest_urls[d] + extra_param; } // Set query string started to true. qss = true; } else if( dest_type_id == 2 ) { build_string = 'rurl=' + dest_urls[d] + u; add_ouid = false; } else { if (cb == 0) { build_string = 'rurl=' + dest_urls[d]; } else { build_string = 'rurl=' + partner_portals[cb] + '&siurl=' + dest_urls[d]; } } // Add additional arguments and common incidentals // These have been made as generic as possible. Do // NOT add special cases on a per destination basis. // We are still building the rurl parameter here which // is why the percents are still being used. if (t != "") { args.push("tourn_id%3D" + t); } if (e != "") { args.push("e%3D" + e); } if (c != "") { args.push("cID%3D" + c); } if (iv != "") { args.push("inviter_id%3D" + iv); } if (pm != "") { args.push("promo%3D" + pm); } if ((add_ouid == true) && (o != "")) { args.push("ouid%3D" + o); } if ((add_pr == true) && (pr != "")) { args.push("promoCR%3D" + pr); } for (var i = 0; i < args.length; i++) { if (qss) { build_string += "%26" + args[i]; } else { build_string += "%3F" + args[i]; qss = true; } } // We are now building the remainder of the entire URL. Switch // the using "&" and "=" instead of the percent replacements. if (c != "") { build_string += "&cID=" + c; } if ((u != "") && (u != 'WW_USERNAME')) { build_string += "&un=" + u; } if ((p != "") && (p != 'WW_PARTNERID')) { build_string += "&partnerID=" + p; } if (build_string != "") { // Set the queryString to the string that we just built. queryString = build_string; } // Parse out the new arguments var cID = getValue( queryString, 'cID='); var partnerID = getValue( queryString, 'partnerID='); var un = getValue( queryString, 'un='); var rurl = getValue( queryString, 'rurl='); var siurl = getValue( queryString, 'siurl='); if (rurl == "") { rurl = "http://"+theHost+"/"; } var myDate = new Date(); myDate.setTime(myDate.getTime() + (86400000)); // 24-hour cookie if (cID != "") { setCookie('cID', cID, null, '/', '.worldwinner.com'); } if (partnerID != "") { setCookie('partnerID', partnerID, null, '/', '.worldwinner.com'); } if ( ( siurl != 'undefined') && (siurl != "") ) { setCookie('siurl', siurl, null, '/', '.worldwinner.com'); } // do not overwrite playerdata cookie if username matches var pd = getCookie('playerdata'); var skip_pd = 0; if ( pd != "" ) { var re = /name=([^&]+)/; var matches = re.exec(pd); if ( matches ) { // username matched playerdata cookie if ( matches[1] == un ) { skip_pd = 1; } } if( skip_pd == 0 ) { // save the gametype_ids before rewriting the playerdata cookie var gids = /gametype_ids=([^&]+)/; var match_gids = gids.exec(pd); var gids_for_cookie = ""; if ( match_gids ) { var gids_array = match_gids[1].split(","); for( var g_idx = 0; g_idx < gids_array.length; g_idx++ ) { if( g_idx != 0 ) { gids_for_cookie += '%2C'; } gids_for_cookie += gids_array[g_idx]; } } if ( un != "" ) { setCookie('playerdata', 'name%3D' + un + '&state%3D3&universe%3D1&gametype_ids%3D' + gids_for_cookie, theYearDate, '/', '.worldwinner.com'); } } } else if ( un != "" ) { setCookie('playerdata', 'name%3D' + un + '&state%3D3&universe%3D1&gametype_ids%3D', theYearDate, '/', '.worldwinner.com'); } if (pr != "") { var rlink = '/cgi/promo.pl?'; if(cID != '') rlink += ('&c=' + cID); if(o != '') rlink += ('&o=' + o); rlink += '&rlink=' + rurl; window.location.href = rlink; } else { window.location.href = unescape(rurl); }