// date and time javascript
var isnMonths=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
var isnDays= new Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sun");
today=new Date();
var now = new Date();
var day = now.getDay();
var hour = now.getHours();
var minutes = now.getMinutes();
var year = now.getFullYear();
var whathour;
	if (hour == 13) whathour = "1";
	if (hour == 14) whathour = "2";
	if (hour == 15) whathour = "3";
	if (hour == 16) whathour = "4";
	if (hour == 17) whathour = "5";
	if (hour == 18) whathour = "6";
	if (hour == 19) whathour = "7";
	if (hour == 20) whathour = "8";
	if (hour == 21) whathour = "9";
	if (hour == 22) whathour = "10";
	if (hour == 23) whathour = "11";
	if (hour == 0)  whathour = "12";
	if (hour >0 && hour <=12) whathour = hour
var whatminutes;
	if (minutes >=10) whatminutes = minutes
	else whatminutes = ("0" + minutes)
var houraorp = now.getHours();
var amorpm
	if (houraorp <=11) amorpm = "am";
	else amorpm = "pm"


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::			     Mega Popup Window Script       	  :::
// :::::			   Created by Justin Stephenson   		  :::
// :::::			 6/29/01; last revised 06/29/01 		  :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

var megaPopupWin = null;
lastName = null;

function megaPopup(URL,flexType,windowType,width,height,screenHorizPosition,screenVertPosition,stackOrder,temporaryName) {
	if	(screenHorizPosition == 'center')	{ leftPosition = (screen.width) ? (screen.width - width)/2:100; }
		else { leftPosition = screenHorizPosition; }
	if	(screenVertPosition == 'center')	{ topPosition = (screen.height) ? (screen.height - height)/2:100; }
		else { topPosition = screenVertPosition; }
	if (windowType == 'full') { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; } else if (windowType == 'basic') { styleAttributes = "toolbar=yes,location=no,directories=no,menubar=no,status=no"; } else if (windowType == 'bare') { styleAttributes = "toolbar=no,location=no,directories=no,menubar=no,status=no"; } else { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; }
	if (flexType == 'frozen') { flexAttributes = "scrollbars=no,resizable=no"; } else if (flexType == 'rigid') { flexAttributes = "scrollbars=yes,resizable=no"; } else if (flexType == 'loose') { flexAttributes = "scrollbars=yes,resizable=yes"; } else { flexAttributes = "scrollbars=yes,resizable=yes"; }
	if (width == 'total') { width = screen.width; }
	if (height == 'total') { height = screen.height; }
	// *** consider a browser sniff to serve screenX and screenY to Navigator 4 ***
	windowAttributes = 'width=' + width + ',height=' + height + ',top=' + topPosition + ',left=' + leftPosition + ',' + styleAttributes + ',' + flexAttributes;
	// if the temporary and last names match, the popup is repopulating an existing window; the existing window must be closed to allow its replacement to use new and different style, flexibility, and position attributes
	if (temporaryName == lastName) { if (megaPopupWin != null && !megaPopupWin.closed) { oldWin = megaPopupWin; oldWin.name = "oldWin"; oldWin.close(); } }
	lastName = temporaryName;
	megaPopupWin = window.open(URL,temporaryName,windowAttributes);
	if (stackOrder == 'top') { megaPopupWin.focus(); megaPopupWin.location = URL; }
		else if (stackOrder == 'bottom') { megaPopupWin.blur(); megaPopupWin.location = URL; megaPopupWin.blur(); self.focus(); }
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::			   Picture Popup Window Script            :::
// :::::			  Created by Justin Stephenson            :::
// :::::			 09/21/01; last revised 09/21/01          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

var picPopupWin = null;

function picPopup(URL) {
	width=420;
	height=425;
	leftPosition = (screen.width) ? (screen.width - width)/2:100;
	topPosition = (screen.height) ? (screen.height - height)/2:100;
	picPopupWin = window.open(URL,'photo_loading','width=' + width + ',height=' + height + ',top=' + topPosition + ',left=' + leftPosition + ',toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no');
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::				  Closewindow Script		          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function closeWin()
	{
		self.close();
		PrintWindow = null;
	}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::				  Preload - Rollover		          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


imagesPreloaded = false;

function rollOver(imageName) {
	overImage = 'http://www.q101.com/images/nav/lit/' + imageName + '.gif';
	changeImages(imageName, overImage);
	return true;
}

function rollOff(imageName) {
	offImage = 'http://www.q101.com/images/nav/def/' + imageName + '.gif';
	changeImages(imageName, offImage);
	return true;
}

function newImage(theSource) {
	if (document.images) {
		theImage = new Image();
		theImage.src = theSource;
		return theImage;
	}
}

function changeImages() {
	if (document.images && (imagesPreloaded)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

<!-- Begin 2 State Preload Script -->
litPath = "http://www.q101.com/images/nav/lit/";
defPath = "http://www.q101.com/images/nav/def/";

imagesToPreload = new Array();
imagesToPreload['nav'] = new Array("video_channels", "kevin_manno", "sherman_tingle", "ryan_manno", "songsjustplayed", "listen_live", "tattoo", "morning_show", "sportbikeshowroom", "local_music", "traffic", "behind_scenes", "beep.gif", "electra.gif", "my_shuffle.gif", "career_channel.gif", "gadgets.gif", "half_price_deals.gif", "contact_us.gif", "careers.gif", "interviews.gif", "new_music_first.gif", "photo_gallery.gif", "airstaff.gif", "101club.gif", "meet_market.gif", "cd_reviews.gif", "concert_calendar.gif", "movies.gif", "music_news.gif", "q101_events.gif", "weather.gif", "win_check.gif");

defImages = new Array();
litImages = new Array();

function preload(prefix) {
	if (document.images) {

		litImages.length = 0;
		defImages.length = 0;

		numToPreload = imagesToPreload[prefix].length;
		
		for (i=0; i<numToPreload; i++) {

			imgName = imagesToPreload[prefix][i];

			litURL = litPath + imgName;
			litImages[i] = new Image();
			litImages[i].src = litURL;

			defURL = defPath + imgName;
			defImages[i] = new Image();
			defImages[i].src = defURL;

		}
	}
	imagesPreloaded = true;
}