﻿
//Client Side Iterative vars to make sure that postings do not occur to Facebook 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_Facebook_ShowOff_Interaction = 0;
var JS_Facebook_MyMusicChoice_Interaction = 0;
var JS_Facebook_Originals_Interaction = 0;
var JS_Facebook_WatchVideos_Interaction = 0;
var JS_Facebook_ListenToMusic_Interaction = 0;
var JS_Facebook_BigTopHits_Interaction = 0;
var JS_Facebook_FaceOff_Interaction = 0;
var JS_Facebook_FanFaves_Interaction = 0;
var JS_Facebook_Level10_Interaction = 0;
var JS_Facebook_LoveMeter_Interaction = 0;
var JS_Facebook_MajorityRules_Interaction = 0;
var JS_Facebook_Retrograde_Interaction = 0;
var JS_Facebook_SWRVDown_Interaction = 0;
var JS_Facebook_SWRVTakeover_Interaction = 0;
var JS_Facebook_TheCut_Interaction = new Object();
JS_Facebook_TheCut_Interaction.counter = 0;
var JS_Facebook_SWRVDown_PreVoting_Interaction = new Object();
JS_Facebook_SWRVDown_PreVoting_Interaction.counter = 0;
var JS_Facebook_Vidications_Interaction = 0;

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_TheCut_Interaction = new Object();
JS_Twitter_TheCut_Interaction.counter = 0;
var JS_Twitter_SWRVDown_PreVoting_Interaction = new Object();
JS_Twitter_SWRVDown_PreVoting_Interaction.counter = 0;
var JS_Twitter_Vidications_Interaction = 0;


//BIG TOP HITS VOTE
function FBVoteSWRVBigTopHitsVoter(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_BigTopHits_Interaction < 1) {
        SharedStatus = "True";
        //Remove any breaking characters single quotes, double quotes, newlines.
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Big Top Hits on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/bigtophits',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/BigTopHits_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {

                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    //Uncomment before launch:
 JSPassSessionInteractionData('Facebook', 'BigTopHits', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'BigTopHits', "Artist: " + artist + ":: SongVotedFor: " + song, MCUserID, 13, SharedStatus);
    JS_Facebook_BigTopHits_Interaction++;
}

//BOTH FB AND TWITTER BIG TOP HITS VOTE
function FBTwitVoteSWRVBigTopHitsVoter(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_BigTopHits_Interaction < 1) {
        SharedStatus = "True";
        //Remove any breaking characters single quotes, double quotes, newlines.
        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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Big Top Hits on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/bigtophits',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/BigTopHits_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {

                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('FBTwit', 'BigTopHits', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'BigTopHits', "Artist: " + artist + ":: SongVotedFor: " + song, MCUserID, 13, SharedStatus);
    JS_Facebook_BigTopHits_Interaction++;
    JS_Twitter_BigTopHits_Interaction++;
}


//FACEOFF VOTE
function FBVoteSWRVFaceOffVote(winner, loser) {
    winner = FBScrubString(winner);
    loser = FBScrubString(loser);
    var SharedStatus = "False";
    if (JS_Facebook_FaceOff_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBVoteSWRVFaceOffVote...Winner Vote: " + winner + " Loser Vote: " + loser);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + winner + ' over ' + loser + ' on FaceOff on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/faceoff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FaceOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {

                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    //Uncomment before launch:
 JSPassSessionInteractionData('Facebook', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'FaceOff', "ArtistVotedFor: " + winner + ":: ArtistVotedAgainst: " + loser, MCUserID, 14, SharedStatus);
    JS_Facebook_FaceOff_Interaction++;
}

//BOTH FB AND TWITTER FACEOFF VOTE
function FBTwitVoteSWRVFaceOffVote(winner, loser) {
    winner = FBScrubString(winner);
    loser = FBScrubString(loser);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + winner + ' over ' + loser + ' on FaceOff on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/faceoff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FaceOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {

                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    //Uncomment before launch:
 JSPassSessionInteractionData('FBTwit', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
   //MCUserID = "SWRVInteractionTesting";
   //JSPassSessionInteractionDataNonSWRV('FBTwit', 'FaceOff', "ArtistVotedFor: " + winner + ":: ArtistVotedAgainst: " + loser, MCUserID, 14, SharedStatus);
    JS_Facebook_FaceOff_Interaction++;
    JS_Twitter_FaceOff_Interaction++;
}

//FACEOFF COMMENT
function FBCommentSWRVFaceOffComment(comment) {
    comment = FBScrubString(comment);
    var SharedStatus = "False";
    if (JS_Facebook_FaceOff_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBCommentSWRVFaceOffComment...Comment: " + comment);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a SoundOff to FaceOff on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/faceoff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FaceOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {

                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    //Uncomment before launch:
 JSPassSessionInteractionData('Facebook', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'FaceOff', "Comment: " + comment, MCUserID, 15, SharedStatus);
    JS_Facebook_FaceOff_Interaction++;
}


//BOTH FB AND TWITTER FACEOFF COMMENT
function FBTwitCommentSWRVFaceOffComment(comment) {
    comment = FBScrubString(comment);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a SoundOff to FaceOff on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/faceoff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FaceOff_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {

                    //alert('Post ID: ' + response.id);
                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'FaceOff', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'FaceOff', "Comment: " + comment, MCUserID, 15, SharedStatus);
    JS_Facebook_FaceOff_Interaction++;
    JS_Twitter_FaceOff_Interaction++;
}

//FAN FAVES VOTE
function FBVoteSWRVFanFavesVoter(artistFor, songFor, artistAgainst, songAgainst) {
    artistFor = FBScrubString(artistFor);
    songFor = FBScrubString(songFor);
    artistAgainst = FBScrubString(artistAgainst);
    songAgainst = FBScrubString(songAgainst);
    var SharedStatus = "False";
    if (JS_Facebook_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artistFor + ' over ' + artistAgainst + ' on Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {

                    //alert('Post ID: ' + response.id);
                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'FanFaves', "Artist Voted For: " + artistFor + "::Song Voted For: " + songFor + "::" + artistAgainst + "::" + songAgainst, MCUserID, 16, SharedStatus);
    JS_Facebook_FanFaves_Interaction++;
}

//BOTH FB AND TWITTER FAN FAVES VOTE
function FBTwitVoteSWRVFanFavesVoter(artistFor, songFor, artistAgainst, songAgainst) {
    artistFor = FBScrubString(artistFor);
    songFor = FBScrubString(songFor);
    artistAgainst = FBScrubString(artistAgainst);
    songAgainst = FBScrubString(songAgainst);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artistFor + ' over ' + artistAgainst + ' on Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {

                    //alert('Post ID: ' + response.id);
                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'FanFaves', "Artist Voted For: " + artistFor + "::Song Voted For: " + songFor + "::" + artistAgainst + "::" + songAgainst, MCUserID, 16, SharedStatus);

    JS_Facebook_FanFaves_Interaction++;
    JS_Twitter_FanFaves_Interaction++;
}

//FAN FAVES COMMENT
function FBCommentSWRVFanFavesComment(comment) {
    comment = FBScrubString(comment);
    var SharedStatus = "False";
    if (JS_Facebook_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBCommentSWRVFanFavesComment...Comment: " + comment);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment to Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('Facebook', 'FanFaves', "Comment: " + comment, MCUserID, 17, SharedStatus);

    JS_Facebook_FanFaves_Interaction++;
}

//BOTH FB AND TWITTER FAN FAVES COMMENT
function FBTwitCommentSWRVFanFavesComment(comment) {
    comment = FBScrubString(comment);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment to Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'FanFaves', "Comment: " + comment, MCUserID, 17, SharedStatus);
    JS_Facebook_FanFaves_Interaction++;
    JS_Twitter_FanFaves_Interaction++;
}



//FAN FAVES UPLOAD
function FBUploadSWRVFanFavesUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_FanFaves_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBUploadSWRVFanFavesUpload...Upload ");
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'uploaded to Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('Facebook', 'FanFaves', "Comment: " + comment, MCUserID, 18, SharedStatus);
    JS_Facebook_FanFaves_Interaction++;
}

//BOTH FB AND TWITTER FAN FAVES UPLOAD
function FBTwitUploadSWRVFanFavesUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'uploaded to Fan Faves on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/fanfaves',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/FanFaves_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'FanFaves', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'FanFaves', "Comment: " + comment, MCUserID, 18, SharedStatus);
    JS_Facebook_FanFaves_Interaction++;
    JS_Twitter_FanFaves_Interaction++;
}


//LEVEL10 VOTE
function FBVoteSWRVLevel10Voter(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_Level10_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Level10 on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/level10',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Level10_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'Level10', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'Level10', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 19, SharedStatus);
    JS_Facebook_Level10_Interaction++;
}

//BOTH FB AND TWITTER LEVEL10 VOTE
function FBTwitVoteSWRVLevel10Voter(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Level10 on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/level10',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Level10_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'Level10', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'Level10', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 19, SharedStatus);
    JS_Facebook_Level10_Interaction++;
    JS_Twitter_Level10_Interaction++;
}

//LOVE METER POLL
function FBPollSWRVLoveMeter(artist, video, rate) {
    artist = FBScrubString(artist);
    video = FBScrubString(video);
    rate = FBScrubString(rate);
    var SharedStatus = "False";
    if (JS_Facebook_LoveMeter_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVLoveMeter...Artist: " + artist + " Video: " + video + " Rating: " + rate);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'rated ' + artist + ' \"' + video + '\" ' + rate + ' on Love Meter on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/lovemeter',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/LoveMeter_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'LoveMeter', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('Facebook', 'LoveMeter', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 20, SharedStatus);
    JS_Facebook_LoveMeter_Interaction++;
}

//BOTH FB AND TWITTER LOVE METER POLL
function FBTwitPollSWRVLoveMeter(artist, video, rate) {
    artist = FBScrubString(artist);
    video = FBScrubString(video);
    rate = FBScrubString(rate);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        //alert("Called FBPollSWRVLoveMeter...Artist: " + artist + " Video: " + video + " Rating: " + rate);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'rated ' + artist + ' \"' + video + '\" ' + rate + ' on Love Meter on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/lovemeter',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/LoveMeter_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'LoveMeter', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'LoveMeter', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 20, SharedStatus);
    JS_Facebook_LoveMeter_Interaction++;
    JS_Twitter_LoveMeter_Interaction++;
}

//MAJORITY RULES POLL
function FBPollSWRVMajorityRulesPoll(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_MajorityRules_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVMajorityRulesPoll...Artist: " + artist + " Song: " + song);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Majority Rules on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/majorityrules',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MajorityRules_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'MajorityRules', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'MajorityRules', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 21, SharedStatus);
    JS_Facebook_MajorityRules_Interaction++;
}

//BOTH FB AND TWITTER MAJORITY RULES POLL
function FBTwitPollSWRVMajorityRulesPoll(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_MajorityRules_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVMajorityRulesPoll...Artist: " + artist + " Song: " + song);
        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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Majority Rules on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/majorityrules',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MajorityRules_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'MajorityRules', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'MajorityRules', "Artist Voted For: " + artist + "::Song Voted For: " + song, MCUserID, 21, SharedStatus);

    JS_Facebook_MajorityRules_Interaction++;
    JS_Twitter_MajorityRules_Interaction++;
}

//RETROGRADE POLL
function FBPollSWRVRetrogradePoll(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_Retrograde_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVRetrogradePoll...Artist: " + artist + " Rating: " + song);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Retrograde on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/retrograde',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Retrograde_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'Retrograde', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('Facebook', 'Retrograde', artist + "::" + song, MCUserID, 22, SharedStatus);
    JS_Facebook_Retrograde_Interaction++;
}

//BOTH FB AND TWITTER RETROGRADE POLL
function FBTwitPollSWRVRetrogradePoll(artist, song) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        //alert("Called FBPollSWRVRetrogradePoll...Artist: " + artist + " Rating: " + song);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'voted for ' + artist + ' \"' + song + '\" on Retrograde on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/retrograde',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Retrograde_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'Retrograde', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
   // MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'Retrograde', artist + "::" + song, MCUserID, 22, SharedStatus);
    JS_Facebook_Retrograde_Interaction++;
    JS_Twitter_Retrograde_Interaction++;
}



//SWRVDOWN QUESTION
function FBPollSWRVSWRVDownQ(question, answer) {
    answer = FBScrubString(answer);
    question = FBScrubString(question);
    var SharedStatus = "False";
    if (JS_Facebook_SWRVDown_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVSWRVDownQ...Question: " + question + " Vote: " + answer);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just answered the question \"(' + question + ')\" in the Udown poll on SWRVdown on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvdown',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVdown_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);
                    //Basically using this as an "off" for interactions.  By setting this, the user will no longer be prompted by this game during this session.

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('Facebook', 'SWRVDown', "QuestionGiven: " + question + "::" + "VoteSelected: " + answer, MCUserID, 23, SharedStatus);
    JS_Facebook_SWRVDown_Interaction++;
}

//BOTH FB AND TWITTER SWRVDOWN QUESTION
function FBTwitPollSWRVSWRVDownQ(question, answer) {
    answer = FBScrubString(answer);
    question = FBScrubString(question);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        //alert("Called FBPollSWRVSWRVDownQ...Question: " + question + " Vote: " + answer);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just answered the question \"' + question + '\" in the Udown poll on SWRVdown on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvdown',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVdown_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);
                    //Basically using this as an "off" for interactions.  By setting this, the user will no longer be prompted by this game during this session.

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'SWRVDown', "QuestionGiven: " + question + "::" + "VoteSelected: " + answer, MCUserID, 23, SharedStatus);
    JS_Facebook_SWRVDown_Interaction++;
    JS_Twitter_SWRVDown_Interaction++;
}


//SWRVDOWN POLL
function FBPollSWRVDownPoll(artist, video, rate) {
    artist = FBScrubString(artist);
    video = FBScrubString(video);
    rate = FBScrubString(rate);
    var SharedStatus = "False";
    if (JS_Facebook_SWRVDown_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBPollSWRVDownPoll...Artist: " + artist + " Video: " + video + " Rating: " + rate);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'rated ' + artist + ' \"' + video + '\" ' + rate + ' on SWRVdown on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvdown',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVdown_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('Facebook', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'SWRVDown', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 24, SharedStatus);
    JS_Facebook_SWRVDown_Interaction++;
}


//BOTH FB AND TWITTER SWRVDOWN POLL
function FBTwitPollSWRVDownPoll(artist, video, rate) {
    artist = FBScrubString(artist);
    video = FBScrubString(video);
    rate = FBScrubString(rate);


    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        //alert("Called FBPollSWRVDownPoll...Artist: " + artist + " Video: " + video + " Rating: " + rate);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'rated ' + artist + ' \"' + video + '\" ' + rate + ' on SWRVdown on... ',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvdown',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVdown_86x57.png'
                },
            function (response) {
                if (!response || response.error) {
                    //alert('Error occured');
                } else {
                    //alert('Post ID: ' + response.id);

                }
            });
            }
        });
    }
    //Uncomment before launch:
JSPassSessionInteractionData('FBTwit', 'SWRVDown', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";

    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'SWRVDown', "Artist: " + artist + "::Video: " + video + "::RateGiven: " + rate, MCUserID, 24, SharedStatus);
    JS_Facebook_SWRVDown_Interaction++;
    JS_Twitter_SWRVDown_Interaction++;
}
//SWRV TAKEOVER - UPLOAD
function FBUploadSWRVTakeoverUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_SWRVTakeover_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBUploadSWRVTakeover");
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment to SWRV Takeover on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvtakeover',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVTakeover_86x57.png'
                }, function (response) {
                    if (!response || response.error) {
                        //alert('Error occured');
                    } else {
                        //alert('Post ID: ' + response.id);

                    }
                });
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Facebook', 'SWRVTakeOver', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'SWRVTakeover', "Comment: " + comment, MCUserID, 25, SharedStatus);
    JS_Facebook_SWRVTakeover_Interaction++;
}

//BOTH FB AND TWITTER SWRV TAKEOVER - UPLOAD
function FBTwitUploadSWRVTakeoverUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_SWRVTakeover_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBUploadSWRVTakeover");
        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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment to SWRV Takeover on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/swrvtakeover',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/SWRVTakeover_86x57.png'
                }, function (response) {
                    if (!response || response.error) {
                        //alert('Error occured');
                    } else {
                        //alert('Post ID: ' + response.id);

                    }
                });
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('FBTwit', 'SWRVTakeOver', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'SWRVTakeover', "Comment: " + comment, MCUserID, 25, SharedStatus);
    JS_Facebook_SWRVTakeover_Interaction++;
    JS_Twitter_SWRVTakeover_Interaction++;
}

//VIDICATION - UPLOAD, COMMENT
function FBUploadVidicationUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_Vidications_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBSWRVVidicate...");
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a Vid-ication to Vid-ications on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/vidications',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Vidications_86x57.png'
                }, function (response) {
                    if (!response || response.error) {
                        //alert('Error occured');
                    } else {
                        //alert('Post ID: ' + response.id);

                    }
                });
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('Facebook', 'Vidications', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('Facebook', 'Vidications', "Comment: " + comment, MCUserID, 26, SharedStatus);
    JS_Facebook_Vidications_Interaction++;
}

//BOTH FB AND TWITTER VIDICATION - UPLOAD, COMMENT
function FBTwitUploadVidicationUpload(comment) {
    var SharedStatus = "False";
    if (JS_Facebook_Vidications_Interaction < 1) {
        SharedStatus = "True";
        //alert("Called FBSWRVVidicate...");
        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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a Vid-ication to Vid-ications on...',
                    name: 'SWRV.tv',
                    link: 'http://swrv.tv/vidications',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/Vidications_86x57.png'
                }, function (response) {
                    if (!response || response.error) {
                        //alert('Error occured');
                    } else {
                        //alert('Post ID: ' + response.id);
                    }
                });
            }
        });
    }
    //Uncomment before launch:
    JSPassSessionInteractionData('FBTwit', 'Vidications', SharedStatus);
    //Use Only For Testing ... Comment Next line before launch:
    //MCUserID = "SWRVInteractionTesting";
    //JSPassSessionInteractionDataNonSWRV('FBTwit', 'Vidications', "Comment: " + comment, MCUserID, 26, SharedStatus);
    JS_Facebook_Vidications_Interaction++;
    JS_Twitter_Vidications_Interaction++;
}

//SHOWOFF UPLOAD
function FBUploadShowOffUpload(SOchannel, MCUserID) {
    var interactionInfo;
    var SharedStatus = "False";
    SOchannel = FBScrubString(SOchannel);
    interactionInfo = trim(SOchannel);
    if (JS_Facebook_ShowOff_Interaction < 1) {
        //alert("INSIDE SHOWOFF FUNCTION");
        SharedStatus = "True";

        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'sent a messsage to ShowOff.  Check it out on the Music Choice ' + SOchannel + ' channel!',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/ShowOff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/ShowOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'ShowOff', 'ShowOff Channel: ' + interactionInfo, MCUserID, 1, SharedStatus);
    JS_Facebook_ShowOff_Interaction++;
}


//BOTH FB AND TWITTER SHOWOFF UPLOAD
function FBTwitUploadShowOffUpload(SOchannel, MCUserID) {

    var interactionInfo;
    var SharedStatus = "False";
    SOchannel = FBScrubString(SOchannel);
    interactionInfo = trim(SOchannel);
    if (JS_Facebook_ShowOff_Interaction < 1) {
        SharedStatus = "True";
        //Twitter Send
        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.');
            }
        });
        //FB Send
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'sent a messsage to ShowOff.  Check it out on the Music Choice ' + SOchannel + ' channel!',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/ShowOff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/ShowOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'ShowOff', 'ShowOff Channel: ' + interactionInfo, MCUserID, 1, SharedStatus);
    JS_Facebook_ShowOff_Interaction++;
    JS_Twitter_ShowOff_Interaction++;
}

// SHOWOFF COMMENT (UNUSED):
function FBCommentSO(SOchannel, MCUserID) {
    var interactionInfo;
    var SharedStatus = "False";
    SOchannel = FBScrubString(SOchannel);
    interactionInfo = trim(SOchannel);
    if (JS_Facebook_ShowOff_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'sent a messsage to ShowOff.  Check it out on the Music Choice ' + SOchannel + ' channel!',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/ShowOff',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/ShowOff_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
 }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'ShowOff', 'ShowOff Channel: ' + interactionInfo, MCUserID, 2, SharedStatus);
    JS_Facebook_ShowOff_Interaction++;
}


//MYMC VIDEO PLAY
function FBMYMCSingleVideoPlay(artist, song, MCUserID, assetID) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching ' + artist + ' \"' + song + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'MyMusicChoice', assetID, MCUserID, 3, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
}

//BOTH FB AND TWITTER MYMC VIDEO PLAY
function FBTwitMYMCVideoChannel(artist, song, MCUserID, assetID) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    var SharedStatus = "False";
    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching ' + artist + ' \"' + song + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'MyMusicChoice', assetID, MCUserID, 3, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
    JS_Twitter_MyMusicChoice_Interaction++;
}

//MYMC CUSTOM CHANNEL CREATION
function FBMYMCCustomChannelCreation(MCUserID) {
    var SharedStatus = "False";
    if (JS_Facebook_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'created a My Music Choice video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'MyMusicChoice', 'Custom Channel Created', MCUserID, 4, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
}

//BOTH FB AND TWITTER MYMC CUSTOM CHANNEL CREATION
function FBTwitMYMCCustomChannelCreation(MCUserID) {
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'created a My Music Choice video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'MyMusicChoice', 'Custom Channel Created', MCUserID, 4, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
    JS_Twitter_MyMusicChoice_Interaction++;
}

//MYMC FAVORITE PLAYLIST CREATION
function FBMYMCFavoritePlaylistCreation(MCUserID) {
    var SharedStatus = "False";
    if (JS_Facebook_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'created a My Music Choice favorites playlist at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'MyMusicChoice', 'Playlist Created', MCUserID, 5, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
}

//BOTH FB AND TWITTER MYMC FAVORITE PLAYLIST CREATION
function FBTwitMYMCFavoritePlaylistCreation(MCUserID) {
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'created a My Music Choice favorites playlist at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'MyMusicChoice', 'Playlist Created', MCUserID, 5, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
    JS_Twitter_MyMusicChoice_Interaction++;
}

//MYMC VIDEO CHANNEL
function FBMYMCVideoChannel(hexcode, MCUserID) {
    hexcode = FBScrubString(hexcode);
    var SharedStatus = "False";
    if (JS_Facebook_MyMusicChoice_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching a custom music video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'MyMusicChoice', hexcode, MCUserID, 6, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
}

//BOTH FB AND TWITTER MYMC VIDEO CHANNEL
function FBTwitMYMCVideoChannel(hexcode, MCUserID) {
    hexcode = FBScrubString(hexcode);
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching a custom music video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/myMC.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/MyMusicChoice_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'MyMusicChoice', hexcode, MCUserID, 6, SharedStatus);
    JS_Facebook_MyMusicChoice_Interaction++;
    JS_Twitter_MyMusicChoice_Interaction++;
}

//ORIGINALS VOTE
function FBVoteOriginals(showName, MCUserID) {
    showName = FBScrubString(showName);
    var SharedStatus = "False";
    if (JS_Facebook_Originals_Interaction < 1) {
        SharedStatus = "True";
        //alert('showName: ' + showName);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just voted on ' + showName + ' at http://www.musicchoice.com.',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                     //Basically using this as an "off" for interactions.  By setting this, the user will no longer be prompted by this game during this session.
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'Originals', showName, MCUserID, 7, SharedStatus);
    JS_Facebook_Originals_Interaction++;
}

//BOTH FB AND TWITTER ORIGINALS VOTE
function FBTwitVoteOriginals(showName, MCUserID) {
    showName = FBScrubString(showName);
    var SharedStatus = "False";
    if (JS_Facebook_Originals_Interaction < 1) {
        SharedStatus = "True";
        //alert('showName: ' + showName);
        twttr.anywhere(function (T) {
            if (T.isConnected()) {
                T.Status.update('just voted on ' + showName + ' at http://www.musicchoice.com. \n\r Follow @Musicchoice.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just voted on ' + showName + ' at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                     //Basically using this as an "off" for interactions.  By setting this, the user will no longer be prompted by this game during this session.
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'Originals', showName, MCUserID, 7, SharedStatus);
    JS_Facebook_Originals_Interaction++;
    JS_Twitter_Originals_Interaction++;
}

//ORIGINALS COMMENT
function FBCommentOriginals(showName, MCUserID) {
    showName = FBScrubString(showName);
    var SharedStatus = "False";
    if (JS_Facebook_Originals_Interaction < 1) {
        SharedStatus = "True";

        //alert(showName);
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment on ' + showName + ' at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'Originals', showName, MCUserID, 8, SharedStatus);
    JS_Facebook_Originals_Interaction++;
}

//BOTH FB AND TWITTER ORIGINALS COMMENT
function FBTwitCommentOriginals(showName, MCUserID) {
    showName = FBScrubString(showName);
    var SharedStatus = "False";
    if (JS_Facebook_Originals_Interaction < 1) {
        SharedStatus = "True";

        //alert(showName);
        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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'just sent a comment on ' + showName + ' at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'Originals', showName, MCUserID, 8, SharedStatus);
    JS_Facebook_Originals_Interaction++;
    JS_Twitter_Originals_Interaction++;
}

//ORIGINALS VIDEO PLAY
function FBOriginalsSingleVideoPlay(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 tempAssetID = GetQuerystringParam('assetID');
    if ((tempAssetID != null) && (tempAssetID != "")) {
        JS_Facebook_Originals_Interaction++;
    }
    series = FBScrubString(series);
    seriesDescription = FBScrubString(seriesDescription);
    showName = FBScrubString(showName);
    var SharedStatus = "False";
    if (JS_Facebook_Originals_Interaction == 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching the Originals show: \"' + series + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'Originals', assetID, MCUserID, 9, SharedStatus);
    JS_Facebook_Originals_Interaction++;
}

//BOTH FB AND TWITTER ORIGINALS VIDEO PLAY
function FBTwitOriginalsSingleVideoPlay(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 tempAssetID = GetQuerystringParam('assetID');
    if ((tempAssetID != null) && (tempAssetID != "")) {
        JS_Facebook_Originals_Interaction++;
        JS_Twitter_Originals_Interaction++;
    }
    var SharedStatus = "False";
    series = FBScrubString(series);
    seriesDescription = FBScrubString(seriesDescription);
    showName = FBScrubString(showName);

    if (JS_Facebook_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.');
            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching the Originals show: \"' + series + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/Originals/Default.aspx?page=' + showName + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/' + showName + '_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'Originals', assetID, MCUserID, 9, SharedStatus);
    JS_Facebook_Originals_Interaction++;
    JS_Twitter_Originals_Interaction++;
}

//WATCH VIDEOS SINGLE VIDEO
function FBWatchVideoSinglePlay(artist, song, image, assetID, MCUserID) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    image = FBScrubString(image);
    var SharedStatus = "False";
    if (JS_Facebook_WatchVideos_Interaction < 1) {
        SharedStatus = "True";

        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching ' + artist + ' \"' + song + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/WatchVideos.aspx?assetID=' + assetID + '',
                    picture: 'http://www.musicchoice.com' + image
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'WatchVideos', assetID, MCUserID, 10, SharedStatus);
    JS_Facebook_WatchVideos_Interaction++;
}

//BOTH FB AND TWITTER WATCH VIDEOS SINGLE VIDEO
function FBTwitWatchVideoSinglePlay(artist, song, image, assetID, MCUserID) {
    artist = FBScrubString(artist);
    song = FBScrubString(song);
    image = FBScrubString(image);
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching ' + artist + ' \"' + song + '\" at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/WatchVideos.aspx?assetID=' + assetID + '',
                    picture: 'http://www.musicchoice.com' + image
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'WatchVideos', assetID, MCUserID, 10, SharedStatus);
    JS_Facebook_WatchVideos_Interaction++;
    JS_Twitter_WatchVideos_Interaction++;
}

//WATCH VIDEOS VIDEO CHANNEL
function FBWatchVideoChannel(hexcode, MCUserID) {
    hexcode = FBScrubString(hexcode);
    var SharedStatus = "False";
    if (JS_Facebook_WatchVideos_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching the ' + hexcode + ' music video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/WatchVideos.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/WatchVideos_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'WatchVideos', hexcode, MCUserID, 11, SharedStatus);
    JS_Facebook_WatchVideos_Interaction++;
}

//BOTH FB AND TWITTER WATCH VIDEOS VIDEO CHANNEL
function FBTwitWatchVideoChannel(hexcode, MCUserID) {
    hexcode = FBScrubString(hexcode);
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is watching the ' + hexcode + ' music video channel at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/WatchVideos.aspx',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/Shows/WatchVideos_86x57.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'WatchVideos', hexcode, MCUserID, 11, SharedStatus);
    JS_Facebook_WatchVideos_Interaction++;
    JS_Twitter_WatchVideos_Interaction++;
}

//LISTEN TO MUSIC 
function FBListenToMusic(channelDisplayName, channel, MCUserID) {
    channelDisplayName = FBScrubString(channelDisplayName);
    var SharedStatus = "False";
    if (JS_Facebook_ListenToMusic_Interaction < 1) {
        SharedStatus = "True";
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is listening to ' + channelDisplayName + ' at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/ListenToMusic.aspx?channel=' + channel + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/AudioChannels/ID_' + channel + '.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('Facebook', 'ListenToMusic', channelDisplayName, MCUserID, 12, SharedStatus);
    JS_Facebook_ListenToMusic_Interaction++;
}

//BOTH FB AND TWITTER LISTEN TO MUSIC 
function FBTwitListenToMusic(channelDisplayName, channel, MCUserID) {
    channelDisplayName = FBScrubString(channelDisplayName);
    var SharedStatus = "False";
    if (JS_Facebook_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.');

            }
        });
        FB.getLoginStatus(function (response) {
            if (response.authResponse) {
                FB.api('/me/feed', 'post', { message: 'is listening to ' + channelDisplayName + ' at:',
                    name: 'MusicChoice.com',
                    link: 'http://www.musicchoice.com/ListenToMusic.aspx?channel=' + channel + '',
                    picture: 'http://www.musicchoice.com/Images/FBPictures/AudioChannels/ID_' + channel + '.png'
                },
             function (response) {
                 if (!response || response.error) {
                     //alert('Error occured');
                 } else {
                     //alert('Post ID: ' + response.id);
                 }
             });
            }
        });
    }
    JSPassSessionInteractionDataNonSWRV('FBTwit', 'ListenToMusic', channelDisplayName, MCUserID, 12, SharedStatus);
    JS_Facebook_ListenToMusic_Interaction++;
    JS_Twitter_ListenToMusic_Interaction++;
}


//Generic interactivity posting
function FBPostInteraction(counterVar, interactionDetails, siteName, showName, linkUrl, imageUrl) {
    var SharedStatus = "False";
    //alert("Before = " + counterVar.counter);

    if (counterVar.counter < 1) 
    {

        SharedStatus = "True";

        //Remove any breaking characters single quotes, double quotes, newlines.
        interactionDetails = FBScrubString(interactionDetails);
        showName = FBScrubString(showName);
        FB.getLoginStatus(function (response) 
        {
            if (response.authResponse) 
            {
                FB.api('/me/feed', 'post',
                { 
                    message: interactionDetails,
                    name: siteName,
                    link: linkUrl,
                    picture: imageUrl
                },
                function (response) 
                {
                    if (!response || response.error) 
                    {
                        //alert('Error occured');
                    }
                    else 
                    {
                        JSPassSessionInteractionData('Facebook', showName, SharedStatus);
                     //alert('Post ID: ' + response.id);
                    }
                });
            }
            else 
            {
                var confirmationAnswer = confirm("Your Facebook Session has expired.  Would you like to reconnect?");
                if (confirmationAnswer) 
                {
                    FBJSLogin();
                }
                else 
                {
                    alert("No further postings will be sent to Facebook during this session.");
                    //Basically using this as an "off" for interactions.  By setting this, the user will no longer be prompted by this game during this session.
                    JSPassSessionInteractionData('Facebook', showName, SharedStatus);
                }
            }
        });

        counterVar.counter++;
        //alert("After = " + counterVar.counter);
    }
    else
        JSPassSessionInteractionData('Facebook', showName, SharedStatus); //Post interaction that was not shared
}


//==== Utiltiy Functions ====//

//Set setSessionInteractionData

/*
function JSPassSessionInteractionData(SN_Type, ShowName) {
    //alert("SN_Type: " + SN_Type + " ShowName: " + ShowName);
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/setSessionInteractionData",
                data: '{ "SN_Type": "' + SN_Type + '","ShowName": "' + ShowName + '"}',
                processData: true,
                async: true
            });
}

function JSPassSessionInteractionDataNonSWRV(SN_Type, ShowName, interactionInfo, MCUserID, interactionType, SharedStatus) {
    //alert("SN_Type: " + SN_Type + " ShowName: " + ShowName + " MCUserID: " + MCUserID + " interactionType: " + interactionType + " SharedStatus: " + SharedStatus);
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/setSessionInteractionData",
                data: '{ "SN_Type": "' + SN_Type + '","ShowName": "' + ShowName + '","SharedStatus": "' + SharedStatus + '"}',
                processData: true,
                async: true
            });
    JSPassNonSWRVInteractionData(MCUserID, interactionType, interactionInfo);
}

function JSPassNonSWRVInteractionData(MCUserID, interactionType, interactionInfo) {
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/saveNonSWRVInteraction",
                data: '{ "MCUserID": "' + MCUserID + '","interactionType": "' + interactionType + '","interactionInfo": "' + interactionInfo + '"}',
                processData: true,
                async: true
            });
}

// 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 FBScrubString(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, "");
}
*/
//==== Utiltiy Functions ====//

//==== Utiltiy Functions ====//

//Set setSessionInteractionData


function JSPassSessionInteractionData(SN_Type, ShowName, SharedStatus) {
    //alert("SN_Type: " + SN_Type + " ShowName: " + ShowName);
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/setSessionInteractionData",
                data: '{ "SN_Type": "' + SN_Type + '","ShowName": "' + ShowName + '","SharedStatus": "' + SharedStatus + '"}',
                processData: true,
                async: true
            });
}

function JSPassSessionInteractionDataNonSWRV(SN_Type, ShowName, interactionInfo, MCUserID, interactionType, SharedStatus) {
    //alert("SN_Type: " + SN_Type + " ShowName: " + ShowName + " MCUserID: " + MCUserID + " interactionType: " + interactionType + " SharedStatus: " + SharedStatus);
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/setSessionInteractionData",
                data: '{ "SN_Type": "' + SN_Type + '","ShowName": "' + ShowName + '","SharedStatus": "' + SharedStatus + '"}',
                processData: true,
                async: true
            });
    JSPassNonSWRVInteractionData(MCUserID, interactionType, interactionInfo);
}

function JSPassNonSWRVInteractionData(MCUserID, interactionType, interactionInfo) {
    jQuery.ajax
            ({
                type: "POST",
                contentType: "application/json",
                url: "/AJAXServices/BBDBService.svc/saveNonSWRVInteraction",
                data: '{ "MCUserID": "' + MCUserID + '","interactionType": "' + interactionType + '","interactionInfo": "' + interactionInfo + '"}',
                processData: true,
                async: true
            });
}

// 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 FBScrubString(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, "");
}

//==== Utiltiy Functions ====//




