// JavaScript Document

function writeMe(target, content) {
if (document.all) {document.all[target].innerHTML = content;} else {tmpString = document.getElementById(target);	tmpString.innerHTML = content;}
}

function hideThis(aa)
{
if (document.all) {document.all[aa].style.visibility = "hidden"; document.all[aa].style.display = "none";}
else if (document.layers) {document.layers[aa].visibility = "hide"; document.layers[aa].display = "none";}
else {document.getElementById(aa).style.visibility = "hidden"; document.getElementById(aa).style.display = "none";}
}

function showThis(bb)
{
if (document.all) {document.all[bb].style.visibility = "visible"; document.all[bb].style.display = "block";}
else if (document.layers) {document.layers[bb].visibility = "show"; document.layers[bb].display = "block";}
else {document.getElementById(bb).style.visibility = "visible"; document.getElementById(bb).style.display = "block";}
}

function hideThisClass(aa)
{
if (document.all) {document.all[aa].style.visibility = "hidden"; document.all[aa].style.display = "none";}
else if (document.layers) {document.layers[aa].visibility = "hide"; document.layers[aa].display = "none";}
else {document.getElementByClass(aa).style.visibility = "hidden"; document.getElementByClass(aa).style.display = "none";}
}

function showThisClass(bb)
{
if (document.all) {document.all[bb].style.visibility = "visible"; document.all[bb].style.display = "block";}
else if (document.layers) {document.layers[bb].visibility = "show"; document.layers[bb].display = "block";}
else {document.getElementByClass(bb).style.visibility = "visible"; document.getElementByClass(bb).style.display = "block";}
}

function openToggle()
{
showThis('langOpened');
hideThis('langClosed');
toggleCookieSet('Opened')
}

function closeToggle()
{
showThis('langClosed');
hideThis('langOpened');
toggleCookieSet('Closed')
}

function toggleCookieSet(yy)
{
var the_cookie = "toggleRA=";
var the_cookie = the_cookie + yy;
var the_cookie = the_cookie + ";path=/;expires=";
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = the_cookie + the_cookie_date; + ";";
document.cookie = the_cookie;
}

function toggleCookieTest()
{
var location = document.cookie.indexOf("toggleRA");
if (location == -1){openToggle();}
else {
var location = document.cookie.indexOf("toggleRA");
var temp = document.cookie.substring(location +9, location +15);
if (temp == 'Closed') {closeToggle();}
else {openToggle();}
}
}

function showNews(xx)
{
hideAllNews();
showThis(xx);
}

function showPrograms(xx)
{
hideAllPrograms();
showThis(xx);
}

function hideAllNews()
{
hideThis('news1');
hideThis('news2');
hideThis('news3');
hideThis('news4');
hideThis('news5');
}

function hideAllPrograms()
{
hideThis('guide1');
hideThis('guide2');
}

function listenNowMP3(xx,yy)
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?url='+xx, 'listenNow');
}

function listenNowMP3Fra(xx,yy)
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3_french.htm?url='+xx, 'listenNow');
}

function listenNow2011(xx)
{
if(xx == "english_asia")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_english_asia.htm','listenNow');
}
if(xx == "english_pacific")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_english_pacific.htm','listenNow');
}
if(xx == "burmese")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_burmese.htm','listenNow');
}
if(xx == "chinese")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_chinese.htm','listenNow');
}
if(xx == "french")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_french.htm','listenNow');
}
if(xx == "indonesian")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_indonesian.htm','listenNow');
}
if(xx == "khmer")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_khmer.htm','listenNow');
}
if(xx == "tok_pisin")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_tok_pisin.htm','listenNow');
}
if(xx == "vietnamese")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/ra_vietnamese.htm','listenNow');
}
}

function listenNow(xx)
{
if(xx == "podcasts")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm','listenNow');
}
if(xx == "podcasts_Ind")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3_indonesian.htm','listenNow');
}
if(xx == "podcasts_Fra")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3_french.htm','listenNow');
}
if(xx == "podcasts_Tok")
{
openListenNow2011('http://www.radioaustralia.net.au//listen/mp3_tok_pisin.htm','listenNow');
}
if(xx == "pacificbeat")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Pacific Beat','listenNow');
}
if(xx == "breakfastclub")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Radio Australia Today','listenNow');
}
if(xx == "intheloop")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=In the Loop','listenNow');
}
if(xx == "connectasia")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Connect Asia','listenNow');
}
if(xx == "asiapacific")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Asia Pacific','listenNow');
}
if(xx == "asiapacificbusiness")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Asia Pacific Business','listenNow');
}
if(xx == "australianbite")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=The Australian Bite','listenNow');
}
if(xx == "techstream")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Tech Stream','listenNow');
}
if(xx == "worldfootballweekly")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=World Football Weekly','listenNow');
}
if(xx == "pacificbreak")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Pacific Break','listenNow');
}
if (xx == "notebook")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Correspondents Notebook','listenNow');
}
if (xx == "innovations")
{
openListenNow2011('http://www.radioaustralia.net.au/listen/mp3.htm?pro=Innovations','listenNow');
}
}

function openListenNow(xx,yy) {
if (document.all){
var xMax = screen.width, yMax = screen.height;
var xOffset = (xMax - 526)/2, yOffset = (yMax - 373)/2;
}
popupWin = window.open(xx, yy, 'width=526,height=373,top='+yOffset+',left='+xOffset+',menubar=no,scrollbars=no,status=no,toolbar=no')
popupWin.focus()
}

function openListenNow2011(xx,yy) {
if (document.all){
var xMax = screen.width, yMax = screen.height;
var xOffset = (xMax - 600)/2, yOffset = (yMax - 355)/2;
}
popupWin = window.open(xx, yy, 'width=600,height=355,top='+yOffset+',left='+xOffset+',menubar=no,scrollbars=no,status=no,toolbar=no')
popupWin.focus()
}
