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 = "At 10am";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//10 til 12 - Craig Cowell
if (day==0 && hours>=10 && hours<12 && every_other(new Date(2007,5,3))=="True")
{
	pname = "Craig Cowell";
	ppic = "cc.png";
	plink = "cc.html";
	palt = "Craig Cowell";
}
else

//10 til 12 - Max Goddard
if (day==0 && hours>=10 && hours<12)
{
	pname = "Adam McVey";
	ppic = "am.png";
	plink = "am.html";
	palt = "Adam McVey";
}
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 3 - Gavin Blunt
if (day==0 && hours>=13 && hours<15)
{
	pname = "<br>Sunday Stereo";
	ppic = "ss.png";
	plink = "ss.html";
	palt = "Sunday Stereo";
}

else

//3 til 5 - James Hannaford
if (day==0 && hours>=15 && hours<17 && every_other(new Date(2007,5,3))=="True")
{
	pname = "James Hannaford";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "James Hannaford";
}

else
//4 til 7 - Peter Jell
if (day==0 && hours>=17 && hours<19 && every_other(new Date(2007,5,3))=="True")
{
	pname = "Tony Fox";
	ppic = "tf.png";
	plink = "tf.html";
	palt = "Tony Fox";
}

else

//4 til 7 - Tony Fox
if (day==0 && hours>=16 && hours<19)
{
	pname = "Dave Christie";
	ppic = "dc.png";
	plink = "dc.html";
	palt = "Dave Christie";
}
else

//7 til 10 - Nathan & Ed
if (day==0 && hours>=19 && hours<22)
{
	pname = "Nathan &<br>Ed - Audio Storm";
	ppic = "aud_strm.png";
	plink = "nw.html";
	palt = "Nathan Willcock & Ed Goodson";
}
else

//Sunday night - Next programme tomorrow
if (day==0 && hours>=22)
{
	pname = "Tomorrow at 4pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else




//Monday



//Monday day - Next programme at 6
if (day==1 && hours<16)
{
	pname = "At 4pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//4 til 6 - Adam & Brian Black
if (day==1 && hours>=16 && hours<18)
{
	pname = "Peter Jell";
	ppic = "pj.png";
	plink = "pj.html";
	palt = "Peter Jell";
}
else

//6 til 9 - Adam & Brian Black
if (day==1 && hours>=18 && hours<21)
{
	pname = "Adam &<br>Brian Black";
	ppic = "abb.png";
	plink = "ab.html";
	palt = "Adam & Brian Black";
}
else

//9 til 11 - The Three Musketeers
if (day==1 && hours>=21 && hours<23)
{
	pname = "The Three Musketeers";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "The Three Musketeers";
}

else

//Monday night - Next programme tomorrow
if (day==1 && hours>=23)
{
	pname = "Tomorrow at 6pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else



//Tuesday



//12 til 1 - Joe 90

//Tuesday day - Next programme at 6
if (day==2 && hours<18)
{
	pname = "At 6pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
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 9 - Gary Slade
if (day==2 && hours>=20 && hours<21)
{
	pname = "Josh Coombs";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Josh Coombs";
}
else

//9 til 11 - Paul Darragh
if (day==2 && hours>=21 && hours<23)
{
	pname = "Paul Darragh";
	ppic = "pd.png";
	plink = "pd.html";
	palt = "Paul Darragh";
}
else

//Tuesday night - Next programme tomorrow
if (day==2 && hours>=23)
{
	pname = "Tomorrow at 6pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else




//Wednesday



//Wednesday day - Next programme at 6
if (day==3 && hours<18)
{
	pname = "At 6pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//6 til 8 - Max Goddard
if (day==3 && hours>=18 && hours<20)
{
	pname = "Max Goddard";
	ppic = "mg.png";
	plink = "mg.html";
	palt = "Max Goddard";
}
else

//8 til 10 - Dominic Alexander & Sam Wise
if (day==3 && hours>=20 && hours<23)
{
	pname = "James Hannaford";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "James Hannaford";
}
else

//Wednesday night - Next programme tomorrow
if (day==3 && hours>=23)
{
	pname = "Tomorrow at 5pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else




//Thursday



//Thursday day - Next programme at 5
if (day==4 && hours<17)
{
	pname = "At 5pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//5 til 7 - Millie Pettman 
if (day==4 && hours>=17 && hours<19)
{
	pname = "Millie Pettman ";
	ppic = "mp.png";
	plink = "index.html";
	palt = "Millie Pettman ";
}
else

//7 til 9 - Gavin Blunt
if (day==4 && hours>=19 && hours<22)
{
	pname = "<br>Thursday Talkback";
	ppic = "tt.png";
	plink = "tt.html";
	palt = "Thursday Talkback";
}
else

//Thursday night - Next programme tomorrow
if (day==4 && hours>=22)
{
	pname = "Tomorrow at 5pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else




//Friday



//Friday day - Next programme at 7
if (day==5 && hours<17)
{
	pname = "At 5pm";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//5 til 6 - Jason Bassant
if (day==5 && hours>=17 && hours<18)
{
	pname = "Jason Bassant";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Jason Bassant";
}
else

//5 til 7 - Adam McVey
if (day==5 && hours>=18 && hours<19)
{
	pname = "Adam McVey";
	ppic = "am.png";
	plink = "am.html";
	palt = "Adam McVey";
}
else

//7 til 9 - Mark Cross
if (day==5 && hours>=19 && hours<21)
{
	pname = "Mark Cross";
	ppic = "mc.png";
	plink = "mc.html";
	palt = "Mark Cross";
}
else

//9 til 11 - Dave Christie
if (day==5 && hours>=21 && hours<23)
{
	pname = "Dave Christie ";
	ppic = "dc.png";
	plink = "dc.html";
	palt = "Dave Christie ";
}
else

//Friday night - Next programme tomorrow
if (day==5 && hours>=23)
{
	pname = "Tomorrow at 10am";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else




//Saturday



//Saturday morning - Next programme at 10
if (day==6 && hours<10)
{
	pname = "At 10am";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}
else

//10 til 12 - Max Goddard
if (day==6 && hours>=10 && hours<12 && every_other(new Date(2007,5,2))=="True")
{
	pname = "Max Goddard";
	ppic = "mg.png";
	plink = "mg.html";
	palt = "Max Goddard";
}
else

//10 til 12 - Andy Garland
if (day==6 && hours>=10 && hours<12)
{
	pname = "Andy Garland";
	ppic = "ag.png";
	plink = "ag.html";
	palt = "Andy Garland";
}
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

//1 til 1.15 - 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 (OTHBB)
if (day==6 && hours>=13 && hours<14 && mins>=15 && mins<30)
{
	pname = "On the Herne Bay Beat";
	ppic = "tcl.png";
	plink = "tl.html";
	palt = "Tim and Christine Liggins";
}

else

//1.30 til 2 - Tom Foreman
if (day==6 && hours>=13 && hours<14 && mins>=30)
{
	pname = "Tom Foreman & Tony Wiles";
	ppic = "tomf.png";
	plink = "tomf.html";
	palt = "Tom Foreman & Tony Wiles";
}
else

//2 til 3 - Tom Foreman
if (day==6 && hours>=14 && hours<15)
{
	pname = "Tom Foreman & Tony Wiles";
	ppic = "tomf.png";
	plink = "tomf.html";
	palt = "Tom Foreman & Tony Wiles";
}
else

//3 til 5 - Tony Fox
if (day==6 && hours>=15 && hours<17)
{
	pname = "Tony Fox";
	ppic = "tf.png";
	plink = "tf.html";
	palt = "Tony Fox";
}
else

//5 til 5.30 - Tony Fox
if (day==6 && hours>=17 && hours<18 && mins<30)
{
	pname = "Tony Fox";
	ppic = "tf.png";
	plink = "tf.html";
	palt = "Tony Fox";
}
else

//5.30 til 6 - Roders
if (day==6 && hours>=17 && hours<18 && mins>=30 && every_other(new Date(2009,0,10))=="True")
{
	pname = "Rodders & Vicky";
	ppic = "rodders.png";
	plink = "rod.html";
	palt = "Rodders & Vicky";
}
else

//5.30 til 6 - Rambo & Grumps
if (day==6 && hours>=17 && hours<18 && mins>=30)
{
	pname = "Rambo & Grumps";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Rambo & Grumps";
}
else

//6 til 8 - Roders
if (day==6 && hours>=18 && hours<20 && every_other(new Date(2009,0,10))=="True")
{
	pname = "Roders & Vicky";
	ppic = "rodders.png";
	plink = "rod.html";
	palt = "Roders & Vicky";
}

else

//6 til 8 - Rambo & Grumps
if (day==6 && hours>=18 && hours<20)
{
	pname = "Rambo & Grumps";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Rambo & Grumps";
}
else


//8 til 10 - Terence Brown
if (day==6 && hours>=20 && hours<22)
{
	pname = "Terence Brown";
	ppic = "nophoto.png";
	plink = "index.html";
	palt = "Terence Brown";
}
else

//Saturday night - Next programme tomorrow
if (day==6 && hours>=22)
{
	pname = "Tomorrow at 10am";
	ppic = "offair.png";
	plink = "index.html";
	palt = "Off Air";
}













function onnow(){

if (ppic=="offair.png")
{
	document.getElementById('onair').innerHTML = "<div class='on_now_text'><span class='onairred'>Next Show:&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 Now:&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'>Next Show:&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 Now:&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'>Next Show:&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 Now:&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")
}

}