var shownow=new Date();
var day=shownow.getDay();
var hours=shownow.getHours();
var mins=shownow.getMinutes();
var pname;
var ppic;
var plink;
var palt;






//Sunday



//Sunday morning - Next programme at 10
if (day==0 && hours<10)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else

//10 til 12 - The Mid Morning Show
if (day==0 && hours>=10 && hours<12 && every_other(new Date(2007,5,3))=="True")
{
	pname = "The Mid Morning Show";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "The Mid Morning Show";
}
else

//10 til 12 - Craig Cowell
if (day==0 && hours>=10 && hours<12)
{
	pname = "Craig Cowell";
	ppic = "cc.png";
	plink = "cc.html";
	palt = "Craig Cowell";
}
else

//12 til 1 - Steve Wood
if (day==0 && hours>=12 && hours<13)
{
	pname = "Steve Wood";
	ppic = "sw.png";
	plink = "sw.html";
	palt = "Steve Wood";
}
else

//1 til 4 - Gavin Blunt
if (day==0 && hours>=13 && hours<16)
{
	pname = "<br>Gavin Blunt";
	ppic = "gb.png";
	plink = "ss.html";
	palt = "Gavin Blunt";
}
else

//Sunday night - Next programme tomorrow
if (day==0 && hours>=16)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else




//Monday



//Monday day - Next programme at 5
if (day==1 && hours<17)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else

//5 til 7 - Mick Capewell
if (day==1 && hours>=17 && hours<19)
{
	pname = "Mick Capewell";
	ppic = "mickc.png";
	plink = "mickc.html";
	palt = "Mick Capewell";
}
else

//7 til 9 - Paul Brown
if (day==1 && hours>=19 && hours<21)
{
	pname = "Paul Brown";
	ppic = "nophoto.png";
	plink = "pb.html";
	palt = "Paul Brown";
}
else

//9 til 12 - Mick Capewell
if (day==1 && hours>=21)
{
	pname = "Mick Capewell";
	ppic = "mickc.png";
	plink = "mickc.html";
	palt = "Mick Capewell";
}
else




//Tuesday



//Tuesday day - Next programme at 6
if (day==2 && hours<18)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else

//6 til 8 - Steve Hatt
if (day==2 && hours>=18 && hours<20)
{
	pname = "Steve Hatt";
	ppic = "sh.png";
	plink = "sh.html";
	palt = "Steve Hatt";
}
else

//8 til 10 - Iain Fraser
if (day==2 && hours>=20 && hours<22)
{
	pname = "Iain Fraser";
	ppic = "if.png";
	plink = "if.html";
	palt = "Iain Fraser";
}
else

//Tuesday night - Next programme tomorrow
if (day==2 && hours>=22)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else




//Wednesday



//Wednesday day - Next programme at 8
if (day==3 && hours<20)
{
        pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else

//8 til 12 - Mick Capewell
if (day==3 && hours>=20)
{
	pname = "Mick Capewell";
	ppic = "mickc.png";
	plink = "mickc.html";
	palt = "Mick Capewell";
}
else




//Thursday



//Thursday - Next programme Saturday
if (day==4 && hours<24)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else




//Friday



//Friday - Next programme tomorrow
if (day==5 && hours<24)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else




//Saturday



//Saturday morning - Next programme at 10
if (day==6 && hours<10)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}
else

//10 til 12 - Saturday Spin
if (day==6 && hours>=10 && hours<12 && every_other(new Date(2007,5,2))=="True")
{
	pname = "Saturday Spin";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Saturday Spin";
}
else

//10 til 12 - Saturday Spin
if (day==6 && hours>=10 && hours<12)
{
	pname = "Saturday Spin";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Saturday Spin";
}
else

//12 til 1 - Damon Oldacre
if (day==6 && hours>=12 && hours<13)
{
	pname = "Damon Oldacre";
	ppic = "do.png";
	plink = "do.html";
	palt = "Damon Oldacre";
}
else


//12 til 1 - Damon Oldacre
if (day==6 && hours>=13 && hours<14 && mins<15)
{
	pname = "Damon Oldacre";
	ppic = "do.png";
	plink = "do.html";
	palt = "Damon Oldacre";
}
else

//1.15 til 1.30 - Tim and Chris Liggins (OTHBB)
if (day==6 && hours>=13 && hours<14 && mins>=15 && mins<30)
{
	pname = "On the Herne Bay Beat";
	ppic = "tcl.png";
	plink = "tcl.html";
	palt = "On the Herne Bay Beat";
}

else

//1.30 til 2 - Anthony Wiles
if (day==6 && hours>=13 && hours<14 && mins>=30)
{
	pname = "Anthony Wiles";
	ppic = "aw.png";
	plink = "aw.html";
	palt = "Anthony Wiles";
}
else

//2 til 3 - Anthony Wiles
if (day==6 && hours>=14 && hours<15)
{
	pname = "Anthony Wiles";
	ppic = "aw.png";
	plink = "aw.html";
	palt = "Anthony Wiles";
}
else

//3 til 6 - Tony Fox
if (day==6 && hours>=15 && hours<18)
{
	pname = "Tony Fox";
	ppic = "tf.png";
	plink = "tf.html";
	palt = "Tony Fox";
}
else

//Saturday night - Next programme tomorrow
if (day==6 && hours>=18)
{
	pname = "Radio Cabin<br>Jukebox";
	ppic = "rcj.png";
	plink = "rcj.html";
	palt = "Radio Cabin Jukebox";
}












function onnow(){

if (ppic=="offair.png")
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>Off Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><img src='images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></div>";
}
else
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>On Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><a href='" + plink + "'><img src='images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></a></div>";
}


setTimeout('onnow()',60000);

}



function onnow_player(){

if (ppic=="offair.png")
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>Off Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><img src='../images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></div>";
}
else
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>On Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><img src='../images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></div>";
}


setTimeout('onnow_player()',60000);

}



function onnow_members(){

if (ppic=="offair.png")
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>Off Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><img src='../images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></div>";
}
else
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>On Air:&nbsp;</span>" + pname + "</div><div class='on_now_img'><a href='../" + plink + "'><img src='../images/faces/" + ppic + "' alt='" + palt + "' title='" + palt + "' height='48'></a></div>";
}


setTimeout('onnow_members()',60000);

}





function every_other(startdate)
{
var today= new Date();
var d= Math.floor((today- startdate)/86400000); // The difference in days since the startdate

if(d%14==0){
return ("True")
}

}
