/* ------- Generic pop up code - please use this only unless you really need something different -------*/
function popUpPage(url, parameters, name)
{
	var day = new Date();
	var pageName = name ? name : day.getTime()

	eval("bbc"+pageName+" = window.open('"+url+"','"+pageName+"','"+parameters+"')");

	if (eval("bbc"+pageName) && window.focus) eval("bbc"+pageName).focus();
}

/* Radio Player tag for PodCasting */
window.name="main";
function aodpopup(URL){
window.open(URL,'aod','width=693,height=525,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=yes,left=60,screenX=60,top=100,screenY=100');
}
if(location.search.substring(1)=="focuswin"){
	window.focus();
}


/* launch code for avconsole */


function popup(url) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=370,height=220');");
} 




// picture Gallery background colours
var currentPicColor = '#6A6dbe';
var unselectedColor = '#009';
var deadLinkColor = '#ccc';


function goToOtherBandwidth(theLink)
{
 var foundLink = false;
 var links = document.getElementsByTagName("link");
 
 for (var i = 0; i < links.length; i++) {
  if (links[i].getAttribute("title") == "Low Graphics" || links[i].getAttribute("title") == "High Graphics") {
  foundLink = true;
  window.location.href = links[i].getAttribute("href");
  }
 }
  
 if (!foundLink) {
  window.location.href = theLink.getAttribute("href");
 }
 
 return false;
}

/* Media Selector pop up code for WS AV links */
function popwin(aPage, aTarget, w, h, var1, var2){
	        window.open (aPage,aTarget,'status=no,scrollbars=no,resizable=yes,width='+w+',height='+h);
}

function toggleCollapsable(linkId, contentId) {
	
	if (document.getElementById(contentId).style.display == "none") {
		
		for (var i = 2; i < arguments.length; i+=2) {	
			document.getElementById(arguments[i]).innerHTML = collapsableShowText ;
			document.getElementById(arguments[i]).className = 'show'; 
			document.getElementById(arguments[i+1]).style.display = "none";
		}
		document.getElementById(linkId).innerHTML = collapsableHideText ;
		document.getElementById(linkId).className = 'hide'; 
		document.getElementById(contentId).style.display = "";
	} else {
		document.getElementById(linkId).innerHTML = collapsableShowText;
		document.getElementById(linkId).className = 'show'; 
		document.getElementById(contentId).style.display = "none";
	}
}
























