﻿
//Client Side Iterative vars to make sure that postings do not occur to Twitter or Twitter in the event
//That the Server Side Session Level hasn't had a chance to conditionally re-render the code after a Postback.

var JS_Twitter_ShowOff_Interaction = 0;
var JS_Twitter_MyMusicChoice_Interaction = 0;
var JS_Twitter_Originals_Interaction = 0;
var JS_Twitter_WatchVideos_Interaction = 0;
var JS_Twitter_ListenToMusic_Interaction = 0;
var JS_Twitter_BigTopHits_Interaction = 0;
var JS_Twitter_FaceOff_Interaction = 0;
var JS_Twitter_FanFaves_Interaction = 0;
var JS_Twitter_Level10_Interaction = 0;
var JS_Twitter_LoveMeter_Interaction = 0;
var JS_Twitter_MajorityRules_Interaction = 0;
var JS_Twitter_Retrograde_Interaction = 0;
var JS_Twitter_SWRVDown_Interaction = 0;
var JS_Twitter_SWRVTakeover_Interaction = 0;
var JS_Twitter_Vidications_Interaction = 0;
var JS_Twitter_TheCut_Interaction = new Object();
JS_Twitter_TheCut_Interaction.counter = 0;
var JS_Twitter_SWRVDown_PreVoting_Interaction = new Object();
JS_Twitter_SWRVDown_PreVoting_Interaction = 0;

//BIG TOP HITS VOTE
function TwitterVoteSWRVBigTopHitsVoter(artist, song) {
    var SharedStatus = "False";
    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    if (JS_Twitter_BigTopHits_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + artist + ' \"' + song + '\" on Big Top Hits http://swrv.tv/bigtophits. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'BigTopHits', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'BigTopHits', "Artist: " + artist + ":: SongVotedFor: " + song, MCUserID, 13, SharedStatus);
    JS_Twitter_BigTopHits_Interaction++;
}

//FACEOFF VOTE
function TwitterVoteSWRVFaceOffVote(winner, loser) {
    winner = TwitterScrubString(winner);
    loser = TwitterScrubString(loser);
    var SharedStatus = "False";
    if (JS_Twitter_FaceOff_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + winner + ' over ' + loser + ' on FaceOff http://swrv.tv/faceoff. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'FaceOff', "ArtistVotedFor: " + winner + ":: ArtistVotedAgainst: " + loser, MCUserID, 14, SharedStatus);
    JS_Twitter_FaceOff_Interaction++;
}

//FACEOFF COMMENT
function TwitterCommentSWRVFaceOffComment(comment) {
    comment = TwitterScrubString(comment);
    var SharedStatus = "False";
    if (JS_Twitter_FaceOff_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just sent a SoundOff to FaceOff at http://swrv.tv/faceoff. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'FaceOff', "Comment: " + comment, MCUserID, 15, SharedStatus);
    JS_Twitter_FaceOff_Interaction++;
}

//FAN FAVES VOTE
function TwitterVoteSWRVFanFavesVoter(artistFor, songFor, artistAgainst, songAgainst) {
    artistFor = TwitterScrubString(artistFor);
    songFor = TwitterScrubString(songFor);
    artistAgainst = TwitterScrubString(artistAgainst);
    songAgainst = TwitterScrubString(songAgainst);
    var SharedStatus = "False";
    if (JS_Twitter_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + artistFor + ' over ' + artistAgainst + ' on Fan Faves at http://swrv.tv/fanfaves. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'FanFaves', "Artist Voted For: " + artistFor + "::Song Voted For: " + songFor + "::" + artistAgainst + "::" + songAgainst, MCUserID, 16, SharedStatus);
    JS_Twitter_FanFaves_Interaction++;
}

//FAN FAVES COMMENT
function TwitterCommentSWRVFanFavesComment(comment) {
    comment = TwitterScrubString(comment);
    var SharedStatus = "False";
    if (JS_Twitter_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just sent a comment to Fan Faves at http://swrv.tv/fanfaves. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'FanFaves', "Comment: " + comment, MCUserID, 17, SharedStatus);
    JS_Twitter_FanFaves_Interaction++;
}

//FAN FAVES UPLOAD
function TwitterUploadSWRVFanFavesUpload() {
    var SharedStatus = "False";
    if (JS_Twitter_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('uploaded to Fan Faves at http://swrv.tv/fanfaves. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'FanFaves', "Comment: " + comment, MCUserID, 18, SharedStatus);
    JS_Twitter_FanFaves_Interaction++;
}

//LEVEL10 VOTE
function TwitterVoteSWRVLevel10Voter(artist, song) {
    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    var SharedStatus = "False";
    if (JS_Twitter_Level10_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + artist + ' \"' + song + '\" on Level10 at http://swrv.tv/level10. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'Level10', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'Level10', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 19, SharedStatus);
    JS_Twitter_Level10_Interaction++;
}

//LOVE METER POLL
function TwitterPollSWRVLoveMeter(artist, video, rate) {
    artist = TwitterScrubString(artist);
    video = TwitterScrubString(video);
    rate = TwitterScrubString(rate);
    var SharedStatus = "False";
    if (JS_Twitter_LoveMeter_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('rated ' + artist + ' \"' + video + '\" ' + rate + ' on Love Meter at http://swrv.tv/lovemeter. \n\r Follow @SWRV_TV.');
            }
        });
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'LoveMeter', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'LoveMeter', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 20, SharedStatus);
    JS_Twitter_LoveMeter_Interaction++;
}

//MAJORITY RULES POLL
function TwitterPollSWRVMajorityRulesPoll(artist, song) {
    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    var SharedStatus = "False";
    if (JS_Twitter_MajorityRules_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + artist + ' \"' + song + '\" on Majority Rules at http://swrv.tv/majorityrules. \n\r Follow @SWRV_TV.');
            }
        });
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'MajorityRules', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'MajorityRules', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 21, SharedStatus);
    JS_Twitter_MajorityRules_Interaction++;
}

//RETROGRADE POLL
function TwitterPollSWRVRetrogradePoll(artist, song) {
    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    var SharedStatus = "False";
    if (JS_Twitter_Retrograde_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('voted for ' + artist + ' \"' + song + '\" on Retrograde at http://swrv.tv/retrograde. \n\r Follow @SWRV_TV.');
            }
        });
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'Retrograde', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'Retrograde', artist + "::" + song, MCUserID, 22, SharedStatus);
    JS_Twitter_Retrograde_Interaction++;
}

//SWRVDOWN QUESTION
function TwitterPollSWRVSWRVDownQ(question, answer) {
    answer = TwitterScrubString(answer);
    question = TwitterScrubString(question);
    var SharedStatus = "False";
    if (JS_Twitter_SWRVDown_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just answered a question on SWRVdown at http://swrv.tv/swrvdown. \n\r Follow @SWRV_TV.');
            }
        });
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'SWRVDown', "QuestionGiven: " + question + "::" + "VoteSelected: " + answer, MCUserID, 23, SharedStatus);
    JS_Twitter_SWRVDown_Interaction++;
}

//SWRVDOWN POLL
function TwitterPollSWRVDownPoll(artist, video, rate) {
    artist = TwitterScrubString(artist);
    video = TwitterScrubString(video);
    rate = TwitterScrubString(rate);
    var SharedStatus = "False";
    if (JS_Twitter_SWRVDown_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('rated ' + artist + ' \"' + video + '\" ' + rate + ' on SWRVdown at http://swrv.tv/swrvdown. \n\r Follow @SWRV_TV.');
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'SWRVDown', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 24, SharedStatus); JS_Twitter_SWRVDown_Interaction++;
    JS_Twitter_SWRVDown_Interaction++;
}

function TwitterPost(counterVar, interactionDetails, showOrActivityName) {

    //Example of show-specific version
    /*
    var SharedStatus = "False";
    if (JS_Twitter_Retrograde_Interaction < 1) {
    SharedStatus = "True";
    twttr.anywhere(function (T) {
    if (T.isConnected()) {
    T.Status.update('voted for ' + artist + ' \"' + song + '\" on Retrograde at http://swrv.tv/retrograde. \n\r Follow @SWRV_TV.');
    }
    });

    */

    showOrActivityName = TwitterScrubString(showOrActivityName);
    interactionDetails = TwitterScrubString(interactionDetails);

    var SharedStatus = "False";
    if (counterVar.counter < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update(interactionDetails);
            }
        });

        counterVar.counter++;
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', showOrActivityName, SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'SWRVDown', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 24, SharedStatus); JS_Twitter_SWRVDown_Interaction++;
}


//SWRV TAKEOVER - UPLOAD
function TwitterUploadSWRVTakeoverUpload(comment) {
    var SharedStatus = "False";
    if (JS_Twitter_SWRVTakeover_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just sent a comment to SWRV Takeover at http://swrv.tv/takeover. \n\r Follow @SWRV_TV.');

            }
        });
    }

    //Uncomment before launch:
    JSPassSessionInteractionData('Twitter', 'SWRVTakeOver', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Twitter', 'SWRVTakeover', "Comment: " + comment, MCUserID, 25, SharedStatus);
    JS_Twitter_SWRVTakeover_Interaction++;
}

//VIDICATION - UPLOAD, COMMENT
function TwitterUploadVidicationUpload(comment) {
    var SharedStatus = "False";
    jQuery(document).ready(function () {
        // put all your jQuery goodness in here.
        if (JS_Twitter_Vidications_Interaction < 1) {
            SharedStatus = "True";
            twttr.anywhere(function (T) {
                if (T.isConnected()) {
                    T.Status.update('just sent a Vid-ication to Vid-ications at http://swrv.tv/vidications. \n\r Follow @SWRV_TV.');
                }
            });
        }
        //Uncomment before launch:
        JSPassSessionInteractionData('Twitter', 'Vidications', SharedStatus);
        //Use Only For Testing ... Comment Next line before launch:
        //MCUserID = "SWRVInteractionTesting";
        //JSPassSessionInteractionDataNonSWRV('Twitter', 'Vidications', "Comment: " + comment, MCUserID, 26, SharedStatus);
        JS_Twitter_Vidications_Interaction++;
    });
}

//SHOWOFF UPLOAD
function TwitterUploadShowOffUpload(SOchannel, MCUserID) {
    var interactionInfo;
    var SharedStatus = "False";
    SOchannel = TwitterScrubString(SOchannel);
    interactionInfo = trim(SOchannel);

    if (JS_Twitter_ShowOff_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('sent a messsage to ShowOff.  Check it out on the Music Choice ' + SOchannel + ' channel at http://www.musicchoice.com! \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'ShowOff', 'ShowOff Channel: ' + interactionInfo, MCUserID, 1, SharedStatus);
    JS_Twitter_ShowOff_Interaction++;
    //alert("showoffupload"); 
}

// SHOWOFF COMMENT (UNUSED):
function TwitterCommentSO(SOchannel, MCUserID) {
    var interactionInfo;
    var SharedStatus = "False";
    SOchannel = TwitterScrubString(SOchannel);
    interactionInfo = trim(SOchannel);
    if (JS_Twitter_ShowOff_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('sent a messsage to ShowOff.  Check it out on the Music Choice ' + SOchannel + ' channel at http://www.musicchoice.com! \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'ShowOff', 'ShowOff Channel: ' + interactionInfo, MCUserID, 2, SharedStatus);
    JS_Twitter_ShowOff_Interaction++;
}

//MYMC VIDEO PLAY
function TwitterMYMCSingleVideoPlay(artist, song, MCUserID, assetID) {

    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    var SharedStatus = "False";
    if (JS_Twitter_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('is watching ' + artist + ' \"' + song + '\" at http://www.musicchoice.com. \n\r Follow @Musicchoice.');
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'MyMusicChoice', assetID, MCUserID, 3, SharedStatus);
    JS_Twitter_MyMusicChoice_Interaction++;
    //alert("mymcsinglevideoplay"); 
}

//MYMC CUSTOM CHANNEL CREATION
function TwitterMYMCCustomChannelCreation(MCUserID) {
    var SharedStatus = false;
    if (JS_Twitter_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('created a My Music Choice video channel at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'MyMusicChoice', 'Custom Channel Created', MCUserID, 4, SharedStatus);
    JS_Twitter_MyMusicChoice_Interaction++;
    //alert("mymcCustomChannelCreated"); 
}

//MYMC FAVORITE PLAYLIST CREATION
function TwitterMYMCFavoritePlaylistCreation(MCUserID) {
    var SharedStatus = "False";
    if (JS_Twitter_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('created a My Music Choice favorites playlist at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'MyMusicChoice', 'Playlist Created', MCUserID, 5, SharedStatus);
    JS_Twitter_MyMusicChoice_Interaction++;
    //alert("mymcplaylistCreated"); 
}

//MYMC VIDEO CHANNEL
function TwitterMYMCVideoChannel(hexcode, MCUserID) {
    var SharedStatus = "False";
    if (JS_Twitter_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('is watching a custom music video channel at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'MyMusicChoice', hexcode, MCUserID, 6, SharedStatus);
    JS_Twitter_MyMusicChoice_Interaction++;
    //alert("mymcvideochannel"); 
}

//ORIGINALS VOTE
function TwitterVoteOriginals(showName, MCUserID) {

    showName = TwitterScrubString(showName);

    var SharedStatus = "False";
    if (JS_Twitter_Originals_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just voted on ' + showName + ' at http://www.musicchoice.com. \n\r Follow @Musicchoice.');
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'Originals', showName, MCUserID, 7, SharedStatus);
    JS_Twitter_Originals_Interaction++;
    //alert("voteoriginals"); 
}

//ORIGINALS COMMENT
function TwitterCommentOriginals(showName, MCUserID) {

    showName = TwitterScrubString(showName);
    var SharedStatus = "False";
    if (JS_Twitter_Originals_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just sent a comment on ' + showName + ' at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'Originals', showName, MCUserID, 8, SharedStatus);
    JS_Twitter_Originals_Interaction++;
    //alert("commentoriginals"); 
}

//ORIGINALS VIDEO PLAY
function TwitterOriginalsSingleVideoPlay(series, seriesDescription, showName, MCUserID, assetID) {
    //Change the Catch Interaction here to 1 in order to disallow the first interaction and allow the second ONLY.
    // Update ...  Use first interaction if assetID is defined in the QueryString we are going to push the increment so the first interaction is captured.

    var SharedStatus = "False";
    var tempAssetID = GetQuerystringParam('assetID');
    if ((tempAssetID != null) && (tempAssetID != "")) {
        JS_Twitter_Originals_Interaction++;
    }

    series = TwitterScrubString(series);
    seriesDescription = TwitterScrubString(seriesDescription);
    showName = TwitterScrubString(showName);

    if (JS_Twitter_Originals_Interaction == 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('is watching the Originals show: \"' + series + '\" at http://www.musicchoice.com. \n Follow @Musicchoice.');
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'Originals', assetID, MCUserID, 9, SharedStatus);
    JS_Twitter_Originals_Interaction++;
    //alert("originalssinglevideoplay"); 
}

//WATCH VIDEOS SINGLE VIDEO
function TwitterWatchVideoSinglePlay(artist, song, image, assetID, MCUserID) {
    var SharedStatus = "False";
    artist = TwitterScrubString(artist);
    song = TwitterScrubString(song);
    image = TwitterScrubString(image);
    if (JS_Twitter_WatchVideos_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('is watching ' + artist + ' \"' + song + '\" at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'WatchVideos', assetID, MCUserID, 10, SharedStatus);
    JS_Twitter_WatchVideos_Interaction++;
    //alert("watchvideossingleplay"); 
}

//WATCH VIDEOS VIDEO CHANNEL
function TwitterWatchVideoChannel(hexcode, MCUserID) {
    var SharedStatus = "False";
    hexcode = TwitterScrubString(hexcode);
    if (JS_Twitter_WatchVideos_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('is watching the ' + hexcode + ' music video channel at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'WatchVideos', hexcode, MCUserID, 11, SharedStatus);
    JS_Twitter_WatchVideos_Interaction++;
    //alert("watchvideochannel"); 
}

//LISTEN TO MUSIC 
function TwitterListenToMusic(channelDisplayName, channel, MCUserID) {
    var currentUser;
    var SharedStatus = "False";
    channelDisplayName = TwitterScrubString(channelDisplayName);
    if (JS_Twitter_ListenToMusic_Interaction < 1) {
        SharedStatus = "True";
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                currentUser = T.currentUser;
                T.Status.update('is listening to ' + channelDisplayName + ' at http://www.musicchoice.com. \n\r Follow @Musicchoice.');

            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Twitter', 'ListenToMusic', channelDisplayName, MCUserID, 12, SharedStatus);
    JS_Twitter_ListenToMusic_Interaction++;
    //alert("listen2music"); 
}


//==== Utiltiy Functions ====//
// Replace any special characters that may be messing stuff up in the messaging

function html2text(html) {
    var text = html.replace(/<[^>]*>/g, '');
    text = text.replace(/&quot;/g, '"');
    text = text.replace(/&lt;/g, '<');
    text = text.replace(/&amp;/g, '&');
    return text;
}

function text2html(text) {
    var html = text.replace(/&/g, "&amp;");
    html = html.replace(/"/g, "&quot;");
    //apostrophe
    html = html.replace(/'/g, "&#39;");
    return html;
}

function TwitterScrubString(input) {

    //Replace double quotes with nothing, replace newline characters with spaces
    //Replace single quote with '`'.
    //return input.replace(/\"/g, '').replace(/\n/g, ' ');
    return input.replace(/\"/g, '').replace(/\'/g, '`').replace(/\n/g, ' ').replace(/\r/g, '');
}

function trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g, "");
}

