
//  ######  Script copyright Patrick Lewis
//  ######  www.PatrickLewis.net
JVersion =  "2.0";


NewWindow=true;  //  Set to false to open the banner link in the same window.


linksIMG = new Array("autodj","autodj","indiepinoy","indiepinoy","penai","autodj","autodj","psychedelic","psychedelic","gbob","massline","autodj","autodj","barelylegal","barelylegal","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","mainit","itsallabout","indiepinoy","indiepinoy","penai","gbob","planet","psychedelic","psychedelic","basshour","massline","nursery","nursery","wanbol","pcr","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","mainit","itsallabout","indiepinoy","indiepinoy","penai","gbob","planet","psychedelic","psychedelic","basshour","massline","nursery","nursery","wanbol","bandslive","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","mainit","itsallabout","indiepinoy","indiepinoy","penai","gbob","planet","psychedelic","psychedelic","basshour","massline","nursery","nursery","wanbol","pcr","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","mainit","itsallabout","indiepinoy","indiepinoy","penai","gbob","planet","psychedelic","psychedelic","basshour","massline","nursery","nursery","wanbol","bandslive","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","mainit","itsallabout","indiepinoy","indiepinoy","penai","gbob","planet","psychedelic","psychedelic","basshour","massline","nursery","nursery","wanbol","pcr","jazz","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions","autodj","autodj","indiepinoy","indiepinoy","penai","linangan","linangan","psychedelic","psychedelic","gbob","massline","autodj","autodj","barelylegal","barelylegal","metal","jazz","jazz","autodj","chillout","chillout","autodj","autodj","bersions");
ImgPath = "sked/";
NewPage = new Array(); // holder for the dynamic links


days = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = new Date().getYear()/4;
if (year.toString().indexOf(".") == -1)  // ## Leap year check
	{days[1] = 29;}


function GetTimeVariables () {
day = new Date().getUTCDay();
hour = new Date().getUTCHours();
minute = new Date().getUTCMinutes();
second = new Date().getUTCSeconds();
date = new Date().getUTCDate();
month = new Date().getUTCMonth();
FirstDay = new Date(new Date().getYear(), 0, 1).getDay();
MinOfDay = (hour*60)+minute;
HourOfWk = (day*24)+hour;
SecOfHour = (hour*60)+second;

zdays=0;
for (kk=0;kk<month;kk++)
	{zdays += days[kk];}

DayOfYear = zdays + date;
zdays = DayOfYear + FirstDay;
week = Math.floor(zdays/7);
}

//  ###  BEGIN PAGE LOAD SECTION
GetTimeVariables();
//  ###  END PAGE LOAD SECTION


//  ###  BEGIN DYNAMIC SECTION
function AutoRotate() {
GetTimeVariables();

//  ### Begin Banner Sample
// ### GOING BY SECOND OF THE HOUR
ChangeNow = 3; //  How long in seconds each image will be visible
BannerChange = SecOfHour/ChangeNow;
if (BannerChange.toString().indexOf(".") == -1) {
	document.Rotate.BannerLink.src = ImgPath + linksIMG[BannerChange % linksIMG.length] +'.jpg';
	NewPage ["Banner"] = linksURL[BannerChange % linksURL.length];
	}
//  ### End Banner Sample


//  ### Begin Variable by Seconds Sample
// ### GOING BY SECOND OF THE HOUR
ChangeNow = document.Rotate.VSTime[document.Rotate.VSTime.selectedIndex].value;
VSChange = SecOfHour/ChangeNow;
if (VSChange.toString().indexOf(".") == -1) {
	document.Rotate.VSBanner.src = ImgPath + linksIMG[VSChange % linksIMG.length] +'.jpg';
	NewPage ["VSH"] = linksURL[VSChange % linksURL.length];
	}
//  ### End Variable by Seconds Sample


//  ### Begin Variable by Minutes Sample
// ### GOING BY Minutes OF THE Day
ChangeNow = document.Rotate.VMTime[document.Rotate.VMTime.selectedIndex].value;
VMChange = MinOfDay/ChangeNow;
if (VMChange.toString().indexOf(".") == -1) {
	document.Rotate.VMBanner.src = ImgPath + linksIMG[VMChange % linksIMG.length] +'.jpg';
	NewPage ["VMD"] = linksURL[VMChange % linksURL.length];
	}
//  ### End Variable by Minutes Sample


//  ###  Rotate images and update NewPage (link) array
document.Rotate.Dtime.value = new Date();
document.Rotate.HW.src = ImgPath + linksIMG[HourOfWk % linksIMG.length] +'.jpg'
NewPage ["HW"] = linksURL[HourOfWk % linksURL.length];



setTimeout("AutoRotate();",1000);
}


function OpenLink(which) {
if (NewWindow)	{window.open( NewPage[which] );}
else 		{window.location = NewPage[which];}
}

