﻿

//var tickerString="Our streaming will be down for 2 days in order to facilitate our move to a new location. We do apologize for any inconvenience caused!";




function OpenNowPlaying() {
    window.open("nowplaying.aspx", "NowPlaying", "toolbar=0,width=350,height=400,scrollbars=0,resizable=0")
}


var i = 0;



var shoutoutTimer; 


function Button1_onclick() {

    reqViaProxy = Red2k10.Messages.SendShoutout(
                        document.getElementById("Text1").value,
                        document.getElementById("TextArea1").value,
                        OnComplete,
                        OnError,
                        OnTimeOut);
    return false;
}

function OnComplete(result) {

    if (result == "Bad") {
        alert("No Cursing Please!"); return;
    }


    document.getElementById("TextArea1").value = '';
}

var firstrun = true;
var firstLoad = true;

function Button2_onclick() {

    //if (firstLoad == true){
    //   Page_Load();
    // .. firstLoad = false;
    //}

    var input = document.getElementById('maxid').value;
    //input =  $get('maxid').value;


    Red2k10.Messages.GetShoutoutHtmlWithId(input, OnMsgComplete, OnError, OnTimeOut);
    //RedEnabledAjax.Messages.GetShoutoutHtml(OnMsgComplete,OnError,OnTimeOut);


}
function OnMsgComplete(data) {

    if (firstrun) {

        $get('shoutOutList').innerHTML = data;
        firstrun = false;
    }
    else
        $get('shoutOutList').innerHTML = data + $get('shoutOutList').innerHTML;
    var input = document.getElementById('shoutOutList').innerHTML;

   shoutoutTimer =  window.setTimeout('Button2_onclick()', 10000);

}


function OnError(result) {
    alert(result);
}
function OnTimeOut(results) {
    alert("timeout");
}
