// JavaScript Document

function openWindow(URL, windowName, windowFeatures){ 
	newWindow = window.open(URL, windowName, windowFeatures) 
}

function EnterContest() { 
	if (IsBand) 
	openWindow('http://ad.doubleclick.net/clk;126634087;18527524;k?http://creative.myspace.com/groups/_ms/xm/Contest/xmStep1.html', 'newWin', 'toolbar=0,width=800,height=800,scrollbars=yes'); 
	else 
	alert('You must have a MySpace band profile to enter.'); 
}


// loads the video player and then changes the text.
// width and height are optional
function OnVideoClick(videoId, nameId, songId) {
    LoadVideo(videoId, nameId, songId);
}

// loads the video player
// width and height are optional
function LoadVideo(videoId, nameId, songId) { 
    // change the video source   
    var videoPlayerContainer = document.getElementById('mp3Player');
    videoPlayerContainer.innerHTML = '<embed src="http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/mp3player.swf" flashvars="entryName=' + nameId + '&entrySong=' + songId +'&audioLocation=' + videoId + '" type="application/x-shockwave-flash" width="113" height="99" wmode="opaque"></embed>';

}

var entryLabel1 = 'http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/Songs/tanyamorgan.mp3';
var entryLabel2 = 'http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/Songs/metafore.mp3';
var entryLabel3 = 'http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/Songs/bstar.mp3';
var entryLabel4 = 'http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/Songs/nrp.mp3';
var entryLabel5 = 'http://creative.myspace.com/Client/XM/ShowUsWhatYaGot/Flash/Songs/mitchgunz.mp3';


//for Terms and Conditions Window
var win = null;
var index = 1;
function openDialog(id,w,h) {
    Dialog.alert($(id).innerHTML, {className: "alphacube",  width:w, height:h, id: "d" + index})
    index++;
}

function lastDialog(id) {
    Dialog.confirm($(id).innerHTML, {className: "alphacube",  width:250, okLabel: "Close All", ok: closeAllModalWindows})
}

function closeAllModalWindows() {
    Windows.closeAllModalWindows();
    //return true;
}

function copyit(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	therange=tempval.createTextRange()
	therange.execCommand("Copy")
}

