
function ajax(id, src) {

    
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    }
    else {
        // code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            document.getElementById(id).innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET", src, true);
    xmlhttp.send();    
}


function Contestmail(domain, user, subject) {

    var strTo = "mailto:" + user + "@" + domain;
    document.location.href = strTo + "?subject=" + subject + "&body=Please provide: Name, Address, City, State, Zip, and Phone";

}

function mail(domain, user, subject) { 

    if (subject != "") {

	document.location.href = "mailto:" + user + "@" + domain + "?subject=" + subject;

	}

    else {
	document.location.href = "mailto:" + user + "@" + domain;

    }
}

function newsletter(domain, user) {

    document.location.href = "mailto:" + user + "@" + domain + "?subject=Send me a newsletter&body=Please send us your Name, Address, City, State and Zip code information (We are not able to send the newsletter out of the U.S.)";
}

function MailForm2(t, s, b) {
    // t is the addresses to be sent to. They will have a dash where the @ symbol should be and they will be replaced in the emailform.asp page.
    // s is for the subject and is optional
    // b is for the message body and is optional

    window.open("/mailform/redirect.asp?to=" + t + "&subject=" + s + "&body=" + b + "", "", "width=600,height=380,top=150,left=200");

}


function NowPlaying_Load() {

    var rand;
    rand = Math.random();
    ajax("NowPlayingText", "/player/nowplaying2010.aspx?rand=" + rand);    

}

function NowPlaying_Start() {

    NowPlaying_Load();
    setTimeout("NowPlaying_Start()", 10000);

}

function NowPlaying_Load2() {

    var rand;
    rand = Math.random();
    ajax("NowPlayingText", "/player/PlayVote2010.aspx?rand=" + rand);

}

function NowPlaying_Start2() {

    NowPlaying_Load2();
    setTimeout("NowPlaying_Start2()", 15000);

}

function VoteNow(sSongID, sStars) {
    ajax("NowPlayingText", "/Player/PlayVoter2010.aspx?SongID=" + sSongID + "&Stars=" + sStars);
}


function openpop(url, w, h, t, L, s) {
    if (s == "Yes") {
        window.open(url, "", "width=" + w + ",height=" + h + ",top=" + t + ",left=" + L + ",scrollbars=yes");
    }
    else {
        window.open(url, "", "width=" + w + ",height=" + h + ",top=" + t + ",left=" + L + "");
    }
}

function openPopup(url, w, h, t, L) {
    window.open(url, "", "width=" + w + ",height=" + h + ",top=" + t + ",left=" + L + "");
}


