<!--
window.onerror = errHandle;
function errHandle() {
    return true
}

s= "no" ;
var popUpWindow = null;
var undefinedVariable;
var undefType = typeof undefinedVariable;
function pop(url,w,h,s){
   if (popUpWindow!=null) {
     var windowHasBeenClosed = (typeof popUpWindow.location == undefType ) ;
     if (!windowHasBeenClosed ){
     	 popUpWindow.close();
   	 }
   }
   settings="resizable=yes,toolbar=no,scrollbars=" + s + ", width=" + w +",height=" + h + ",status=no";
   var time = new Date();
   winName="emaPopUp" + time.getTime()
   popUpWindow = open(url,winName, settings);
   if ( navigator.appVersion.indexOf("MSIE")==-1 ) {
     popUpWindow.resizeTo(w, h);
   }
}


/* FIX ROLLOVERS ONCE AND FOR ALL */
if (document.images){
var homeOn = new Image();
var homeOff = new Image();
var newsOn = new Image();
var newsOff = new Image();
var showsOn = new Image();
var showsOff = new Image();
var musicOn = new Image();
var musicOff = new Image();
var funOn = new Image();
var funOff = new Image();
var insideOn = new Image();
var insideOff = new Image();
var eventsOn = new Image();
var eventsOff = new Image();

homeOn.src   = "/mtv.tv/images/nav_home_f2.gif";
homeOff.src   = "/mtv.tv/images/nav_home.gif";
newsOn.src   = "/mtv.tv/images/nav_news_f2.gif";
newsOff.src   = "/mtv.tv/images/nav_news.gif";
showsOn.src  = "/mtv.tv/images/nav_shows_f2.gif";
showsOff.src  = "/mtv.tv/images/nav_shows.gif";
musicOn.src  = "/mtv.tv/images/nav_music_f2.gif";
musicOff.src  = "/mtv.tv/images/nav_music.gif";
funOn.src    = "/mtv.tv/images/nav_fun_f2.gif";
funOff.src    = "/mtv.tv/images/nav_fun.gif";
insideOn.src = "/mtv.tv/images/nav_inside_f2.gif";
insideOff.src = "/mtv.tv/images/nav_inside.gif";
eventsOn.src = "/mtv.tv/images/nav_events_f2.gif";
eventsOff.src = "/mtv.tv/images/nav_events.gif";
}

function act(ImageName) {
  if (document.images)
    document.images[ImageName].src = eval(ImageName + "On.src");
}

function inact(ImageName) {
  if (document.images)
    document.images[ImageName].src = eval(ImageName + "Off.src");
}

/* END FIX */

function photopop(url,w,h,s,r){
   if (popUpWindow!=null) {
     var windowHasBeenClosed = (typeof popUpWindow.location == undefType ) ;
     if (!windowHasBeenClosed ){
     	 popUpWindow.close();
   	 }
   }
   settings="resizable=" + r + ",toolbar=no,scrollbars=" + s + ", width=" + w +",height=" + h + ",status=no";
   var time = new Date();
   winName="emaPopUp" + time.getTime()
   popUpWindow = open(url,winName, settings);
   if ( navigator.appVersion.indexOf("MSIE")==-1 ) {
     popUpWindow.resizeTo(w, h);
   }
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function getNewDay() {
	document.frmWeekDay.submit();
}

function arrVJs(vjID){
VJFirstName = vjID.split(" ");
return	("/mtv.tv/images/vjs/thumb_"+VJFirstName[0].toLowerCase()+".jpg")
}

function swapVJImage(vjID) {
	MM_swapImage('vjCont','',arrVJs(vjID),1)
}

function doFlipBook(url) {
	newWin = window.open(url, "newWin", "width=468,height=468");
}

function loadTodaysSchedule(){
	var now   = new Date();
	var year  = now.getFullYear();
	var month = now.getMonth() + 1;
	var day	  = now.getDate();
	if (year < 2003){
		alert('Your computer clock is wrong!\nThe schedules pages need your computer clock to be set correctly. The right date is shown at the top of this page. Please adjust your computer clock accordingly and try again.\n\nOn a Windows PC, this can be done by choosing the Date/Time option from the Control Panel. On a Mac, from the Apple Menu, open the System Preferences window and click the Date & Time icon in the System section of the window.');
	}else{
		if(month < 10){month = "0"+month;}
		if(day < 10){day = "0" + day;}
		
		var filename = "/mtv.tv/dynamo/shells/schedule.jhtml?fixed=/mtv.tv/shows/schedules/schedules-" + year + "-" + month + "-" + day + ".jhtml";
		document.location = filename;
	}
}

function doSchedules(button){
// Work out which one is today's button
	var now = new Date();
	var today = now.getDay();

	if (now.getFullYear() < 2003){
		alert('Your computer clock is wrong!\nThe schedules pages need your computer clock to be set correctly. The right date is shown at the top of this page. Please adjust your computer clock accordingly and try again.\n\nOn a Windows PC, this can be done by choosing the Date/Time option from the Control Panel. On a Mac, from the Apple Menu, open the System Preferences window and click the Date & Time icon in the System section of the window.');
		return false;
	}
// Fiddle so Sunday is 7 not 0.
	if(today==0)today=7;	
// Work out different between today and button number
	var daysOffset = button - today;
// Work out the timestamp for today
	var todayTimestamp = now.valueOf();
// Work out the timestamp for the offset
// daysOffset * 60s * 60m * 24h *1000ms
	var offsetTimestamp = daysOffset * 3600 * 24 * 1000;
// Make the new date
	var finalTimestamp = todayTimestamp + offsetTimestamp;
	var navDate = new Date(finalTimestamp);
	
	var filename = "/mtv.tv/dynamo/shells/schedule.jhtml?fixed=/mtv.tv/shows/schedules/schedules-" + navDate.getFullYear() + "-" + ((navDate.getMonth() + 1) < 10 ? "0"+(navDate.getMonth() + 1) : (navDate.getMonth() + 1)) + "-" + (navDate.getDate() <10 ? "0"+navDate.getDate() : navDate.getDate())+".jhtml";

	document.location = filename;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */



//-->
