// JavaScript Document
function clearReportSelections()
	{
		elementDivs = document.getElementById('video').getElementsByTagName('a');

		for (x=0;x<elementDivs.length;x++)
		{
			if(elementDivs[x].className=='studiojamlink_on') elementDivs[x].className='studiojamlink';
		}
	}

	function selectReport(reportLink,videoID,videoSize)
	{
		clearReportSelections();
		reportLink.className='studiojamlink_on';
		try
		{
			LoadPlaylist('channelreportplayer', videoID,videoSize);
		}
		catch(err)
		{	
			setTimeout('LoadPlaylist(\'channelreportplayer\',' + videoID + ',\'' + videoSize + '\');',500);
		}
	}
	
	function randomizeContent(classname)
		{
		var contents=randomizeContent.collectElementbyClass(classname)
		contents.text.sort(function() {return 0.5 - Math.random();})
		var tbodyref=contents.ref[0].tagName=="td"? contents.ref[0].parentNode : new Object()
		for (var i=0; i<contents.ref.length; i++){
		if (tbodyref.moveRow) //if IE
		tbodyref.moveRow(0, Math.round(Math.random()*(tbodyref.rows.length-1)))
		else
		contents.ref[i].innerHTML=contents.text[i]
		contents.ref[i].style.visibility="visible"
		}
	}
	
	randomizeContent.collectElementbyClass=function(classname){ //return two arrays containing elements with specified classname, plus their innerHTML content
		var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
		var contentobj=new Object()
		contentobj.ref=new Array() //array containing references to the participating contents
		contentobj.text=new Array() //array containing participating contents' contents (innerHTML property)
		var alltags=document.all? document.all : document.getElementsByTagName("*")
		for (var i=0; i<alltags.length; i++){
		if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1){
		contentobj.ref[contentobj.ref.length]=alltags[i]
		contentobj.text[contentobj.text.length]=alltags[i].innerHTML
		}
	}
	return contentobj
	}
	
	function SelecText(copytext)
		{
		document.getElementById("copytext").select()
	}
		
	function ClipBoard() 
		{
		holdtext.innerText = copytext.innerText;
		Copied = holdtext.createTextRange();
		Copied.execCommand("Copy");
	}
    
    function display(title){
		document.getElementById('song').innerHTML=
		'<div id="inner">You&rsquo;re watching <strong>'+title+'</strong></div>'
	}
	
	window.onload=function(){
	var elm= document.getElementById('song');
	elm.innerHTML=
	'<div id="inner">You&rsquo;re watching <strong>Studio Jam</strong></div>'
}
    
	
	window.onload=function(){
	var elm= document.getElementById('song_live');
	elm.innerHTML=
	'<div id="inner">You&rsquo;re watching <strong>Studio Jam at the Help Haiti CI Event</strong></div>'
}


	function myspace(name){
		document.getElementById('myspaceLink').innerHTML=
		'<div id="inner2">Check out their MySpace Page: <a href="'+name+'" target="_blank">'+name+'</a></div>'
			var div = document.getElementById('websiteLink');
			while(div.firstChild)
			{
		
			div.removeChild(div.firstChild);
	
			}
	}
	
	function myspace2(name){
		document.getElementById('myspaceLink').innerHTML=
		'<div id="inner2">Check out his MySpace Page: <a href="'+name+'" target="_blank">'+name+'</a></div>'
			var div = document.getElementById('websiteLink');
			while(div.firstChild)
			{
		
			div.removeChild(div.firstChild);
	
			}
	}
	
	
		function website(name){
		document.getElementById('websiteLink').innerHTML=
		'<div id="inner2">Check out his website: <a href="'+name+'" target="_blank">'+name+'</a></div>'
	    var div = document.getElementById('myspaceLink');
		while(div.firstChild)
		{
		
		div.removeChild(div.firstChild);
	
		}
	}
		
		function intro(name){
		document.getElementById('introHeader').innerHTML=
		'<div id="inner">You&rsquo;re watching<b> '+name+'</b></div>'
	}

