function selectAll(cbList,bSelect) {
  for (var i=0; i<cbList.length; i++)
    cbList[i].selected = cbList[i].checked = bSelect
}

function reverseAll(cbList) {
  for (var i=0; i<cbList.length; i++) {
    cbList[i].checked = !(cbList[i].checked)
    cbList[i].selected = !(cbList[i].selected)
  }
}



/* For the Embedded player!!!!  */
function PopPlayer(mp3_path,UserID,station_id)
{
    window.open("mr_embeddable.php?station_id="+station_id+"&mp3_path="+mp3_path+"&UserID="+UserID, "", "height=160, width=360, left=0, channelmode=no, directories=no, location=no, menubar=no, resizable=no, status=no, scrollbars=yes, toolbar=no",false);
}

function updateParent(newURL)
{
 opener.document.location = newURL
}


function PopUpRedirect(ref)
{
	var strFeatures="toolbar=no,status=no,menubar=no,location=no"
	strFeatures=strFeatures+",scrollbars=no,resizable=yes,height=320,width=500"

	window.open("redirect.php?"+ref,"Loyal Ears",strFeatures);
}



/* for the pop-up help window */
function popup(mylink, windowname)
{

if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}



/* for text rollover */
function toggle(id,text){
d=document.getElementById(id);
d.innerHTML=text;
}


function admin_popup(task,key,val)
{
    window.open("admin.php?task="+task+"&key="+key+"&value="+val, "", "height=400, width=400, left=0, channelmode=no, directories=no, location=no, menubar=no, resizable=no, status=no, scrollbars=yes, toolbar=no",false);
}



function toggle_switch_link(contentId,switchId) {
	var c = document.getElementById(contentId);
	var s = document.getElementById(switchId);
	if(c.style.display == 'none')
	{
		c.style.display = 'block';
		s.innerHTML			= 'hide link';
	} else {
		c.style.display = 'none';
		s.innerHTML			= 'show link';
	}
}
