# [SOLVED] ON AIR NOW script help



## superstar2k9 (Mar 30, 2009)

hi guys need some help here i am not very good with java script my code below brings up a bit of text dispalying on air now and the presenters name rather than dispalying the text can i not change it to diplay an image instead.

for example replace this below with an image i need the code to pull up the image required for that time.

----'<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';-----
------------------------------------------------------------------------


also maybe there is a way to simplify this code.

thank you in advance.
------------------------------------------------------------------------
</style> 

<script type="text/javascript">

/* NOT CURRENTLY USED
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();

var GMT = new Date().getTimezoneOffset();
var offsetGMT = -5 * new Date().getTimezoneOffset()/60;
*/

// Sun=0 1 2 3 4 5 Sat=6
var DayOfWeek = new Array('Weekend','Monday','Tuesday','Wednesday','Thursday','Friday','Weekend');

var NoShow = 'No Show Scheduled<br />for KSWH';
var DH = new Array (7);
for (d=0; d<7; d++) {
DH[d] = new Array (24);
for (h=0; h<24; h++) { DH[d][h] = ''; }
}

DH[1][09] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[1][10] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[1][11] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[1][12] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[1][13] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[1][14] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[1][15] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[1][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[1][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[1][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[1][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[1][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[1][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';

DH[2][09] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[2][10] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[2][11] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[2][12] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[2][13] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[2][14] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[2][15] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[2][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[2][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[2][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[2][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[2][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[2][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';

DH[3][09] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[3][10] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[3][11] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[3][12] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[3][13] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[3][14] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[3][15] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[3][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[3][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[3][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[3][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[3][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[3][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';

DH[4][09] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[4][10] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[4][11] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[4][12] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[4][13] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[4][14] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[4][15] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[4][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[4][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[4][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[4][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[4][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[4][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';

DH[5][09] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[5][10] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[5][11] = '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm';
DH[5][12] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[5][13] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[5][14] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[5][15] = '<b>ON AIR NOW<b> cheryle dale 12pm to 4pm';
DH[5][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[5][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[5][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[5][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';
DH[5][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[5][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';


// Add more when schedule is known. Note: there may be better ways to do this when information is known.


function OnNow() {
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();
// alert(dayofweek+':'+hourofday+'<br />'+DH[dayofweek][hourofday]);
var showOn = DH[dayofweek][hourofday];
if (showOn == '') { showOn = thedate+'\n\nNo Show Scheduled'; }
alert(showOn);
}

function NowON() {
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();
var showOn = DH[dayofweek][hourofday];
if (showOn == '') { showOn = thedate+'<p />No Show Scheduled'; }
document.getElementById('NowOn').innerHTML = showOn;
} 
</script>
<strong></strong>
</head>
<BODY onLoad="NowON()">
<!-- Unhide this if table display desired
<script type="text/javascript">
document.write(TableStationSchedule())
</script>
-->
<script type="text/javascript">
document.write(NowON());
</script>
<div id='NowOn' onClick="NowON()">Cool Fm ON AIR NOW</div> 
</body>


----------



## superstar2k9 (Mar 30, 2009)

*Re: ON AIR NOW script help*

sorry solved lol i simply replaced 

THIS: '<b>ON AIR NOW<B> Dean sharp breakfast show 9am to 12pm' 

WITH

THIS: '<img src="Iimage.jpg" width=100 height=80 border=1>'


thanks for reading anyway hope this helps others.


----------



## astevens93 (Jul 12, 2012)

Hey

This is a great script and serves our station well for our special pop out player! We added photos like your last post!

Quick question... is there anyway to use SERVER TIME rather than the clients' LOCAL time?

i.e. if a show is on 07:00-10:00 GMT.... but the client is on GMT - 5 then it will show the show schedule for 00:00-07:00.... can this script take server time and load it in?

I've been looking for ways to incorporate this into the script myself but with no luck!

Hope you can help thanks


----------



## djultra (May 9, 2013)

hi there i have the same script but can someone tell me if its ok just to have the code like this.




</style> 

<script type="text/javascript">

/* NOT CURRENTLY USED
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();

var GMT = new Date().getTimezoneOffset();
var offsetGMT = -5 * new Date().getTimezoneOffset()/60;
*/

// Sun=0 1 2 3 4 5 Sat=6
var DayOfWeek = new Array('Weekend','Monday','Tuesday','Wednesday','Thursday','Friday','Weekend');

var NoShow = 'No Show Scheduled<br />for KSWH';
var DH = new Array (7);
for (d=0; d<7; d++) {
DH[d] = new Array (24);
for (h=0; h<24; h++) { DH[d][h] = ''; }
}

DH[1][09] = '<img src="Iimage.jpg" width=100 height=80 border=1> Dean sharp breakfast show 9am to 12pm';
DH[1][10] = '<img src="Iimage.jpg" width=100 height=80 border=1> Dean sharp breakfast show 9am to 12pm';
DH[1][11] = '<img src="Iimage.jpg" width=100 height=80 border=1> Dean sharp breakfast show 9am to 12pm';
DH[1][12] = '<img src="Iimage.jpg" width=100 height=80 border=1> cheryle dale 12pm to 4pm';
DH[1][13] = '<img src="Iimage.jpg" width=100 height=80 border=1> cheryle dale 12pm to 4pm';
DH[1][14] = '<img src="Iimage.jpg" width=100 height=80 border=1> cheryle dale 12pm to 4pm';
DH[1][15] = '<img src="Iimage.jpg" width=100 height=80 border=1> cheryle dale 12pm to 4pm';
DH[1][16] = '<img src="Iimage.jpg" width=100 height=80 border=1> Jessie brooke evening show 4pm to 8pm';
DH[1][17] = '<img src="Iimage.jpg" width=100 height=80 border=1> Jessie brooke evening show 4pm to 8pm';
DH[1][18] = '<img src="Iimage.jpg" width=100 height=80 border=1> Jessie brooke evening show 4pm to 8pm';
DH[1][19] = '<img src="Iimage.jpg" width=100 height=80 border=1> Jessie brooke evening show 4pm to 8pm';
DH[1][20] = '<img src="Iimage.jpg" width=100 height=80 border=1> Zenith classic rock 8pm to 10pm';
DH[1][21] = '<img src="Iimage.jpg" width=100 height=80 border=1> Zenith classic rock 8pm to 10pm';


// Add more when schedule is known. Note: there may be better ways to do this when information is known.


function OnNow() {
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();
// alert(dayofweek+':'+hourofday+'<br />'+DH[dayofweek][hourofday]);
var showOn = DH[dayofweek][hourofday];
if (showOn == '') { showOn = thedate+'\n\nNo Show Scheduled'; }
alert(showOn);
}

function NowON() {
var thedate = new Date();
var dayofweek = thedate.getDay();
var hourofday = thedate.getHours();
var showOn = DH[dayofweek][hourofday];
if (showOn == '') { showOn = thedate+'<p />No Show Scheduled'; }
document.getElementById('NowOn').innerHTML = showOn;
} 
</script>
<strong></strong>
</head>
<BODY onLoad="NowON()">
<!-- Unhide this if table display desired
<script type="text/javascript">
document.write(TableStationSchedule())
</script>
-->
<script type="text/javascript">
document.write(NowON());
</script>
<div id='NowOn' onClick="NowON()">Destiny106 FM ON AIR NOW</div> 
</body>


----------



## djultra (May 9, 2013)

this is to superstar2k9 

that script you use 
for you're popup player, is there anyway that i can change the texts colour at all from black to red? 

and also you put pictures in you're code, how can i get the script to say on air now even with the picture and time. cos i want the dj pic to show as well as the time that i'm on say 12pm till 4pm GMT


----------



## wmorri (May 29, 2008)

This thread is very old, please don't post in old threads. If you are having your own problem or issues, make a new thread and we will do our best to help you.


----------

