// JavaScript Document

function vidChangeCustom(){
	var str = _g6CurrChannel;
			
	if (str=='Music News' || str=='Music Interviews' && str!='undefined'){
		document.getElementById('PLNAV').src="images/plnav-playlistonly.jpg";
		document.getElementById('PLNAV').useMap='#map8';	
		document.getElementById('nonMusicVideoDesc').style.visibility = "visible";
		document.getElementById('Information').style.visibility = "hidden";
		//return false;
	}
	else if (str=='AC' || str=='Classic Rock' || str=='Dance' || str=='Metal' || str=='Pop' || str=='Rock' || str=='Urban' && str!='undefined'){
		moveover1();
		document.getElementById('PLNAV').useMap='#map2';
		document.getElementById('nonMusicVideoDesc').style.visibility = "hidden";
		document.getElementById('Information').style.visibility = "visible";
		//return false;
	}
}

function onLoadDisplay(){
	document.getElementById('nonMusicVideoDesc').style.visibility = "visible";
	//document.getElementById('songTitleDiv').style.visibility = "visible";		
}

function moveover1(){
	G6_PlayListMenuItemClick('ArtistProfileButton');
	document.getElementById('PLNAV').src="images/plnav-profile-on.jpg";
	//return false;
}

function moveover2(){
	G6_PlayListMenuItemClick('AlbumReviewButton');
	document.getElementById('PLNAV').src="images/plnav-reviews-on.jpg";
	//return false;
}

function moveover3(){
	G6_PlayListMenuItemClick('ArtistPicsButton');
	document.getElementById('PLNAV').src="images/plnav-pics-on.jpg";
	//return false;
}

function moveover6(){
	//G6_ChannelSurfMusic();
	var str = _g6CurrChannel;
	
	G6_LoadPlayList(str);
	
	if (str=='Music News' || str=='Music Interviews' && str!='undefined'){
		document.getElementById('PLNAV').src="images/plnav-playlistonly.jpg";
		document.getElementById('PLNAV').useMap='#map8';	
	}
	else if (str=='AC' || str=='Classic Rock' || str=='Dance' || str=='Metal' || str=='Pop' || str=='Rock' || str=='Urban' && str!='undefined'){
		document.getElementById('PLNAV').src="images/plnav-playlist-on.jpg";
		document.getElementById('PLNAV').useMap='#map2';
		//return false;
	}
	
}

function hideInfoPanel() {
	document.getElementById('Information').style.visibility = "hidden";
	document.getElementById('nonMusicVideoDesc').style.visibility = "hidden";
	//return false;		
}

function showInfoPanel() {
	var str = _g6CurrChannel;
			
	if (str=='Music News' || str=='Music Interviews' && str!='undefined'){
		document.getElementById('nonMusicVideoDesc').style.visibility = "visible";
		document.getElementById('Information').style.visibility = "hidden";
		//return false;
	}
	//else if (str=='Music Videos' && str!='undefined')
	else {
		document.getElementById('nonMusicVideoDesc').style.visibility = "hidden";
		document.getElementById('Information').style.visibility = "visible";
		//return false;
	}
}

function setDisplayTab(mode){
			var toolBarImage = document.getElementById('NAV_INFO');
			switch(mode){
				case "info":
					toolBarImage.src="images/nav-info-on.jpg";
					showInfoPanel();
					break;
				case "settings":
					toolBarImage.src="images/nav-settings-on.jpg";
					hideInfoPanel();
					break;		
				case "bookmark":
					toolBarImage.src="images/nav-bookmark-on.jpg";
					hideInfoPanel();
					break;
				case "tools":
					toolBarImage.src="images/nav-tools-on.jpg";
					hideInfoPanel();
					break;
					
			}
			return false;
		}

function getFlashCode(id,w,h){
	var str = "";
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	
	// Handle all the FSCommand messages in a Flash movie.
	document.write('<script language="javascript">');
	document.write('function '+id+'_DoFSCommand(command, args) {\n');
	document.write('eval(args);\n');
	document.write('}\n');
	document.write('</script\>\n');	
	
	// Hook for Internet Explorer.
	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
		document.write('<script language="VBScript"\>\n');
		document.write('On Error Resume Next\n');
		document.write('Sub '+id+'_FSCommand(ByVal command, ByVal args)\n');
		document.write('	Call '+id+'_DoFSCommand(command, args)\n');
		document.write('End Sub\n');
		document.write('</script\>\n');
	}
	
	//	Somehow caching prevents the flash object from playing?
	var ran = Math.random();	//		HACK ALERT!		random variable added to QS to prevent caching in IE
	str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
	str += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ';
	str += 'width="'+w+'" height="'+h+'" id="'+id+'" align="middle"\> \n';
	str += '<param name="allowScriptAccess" value="sameDomain" /\> \n';
	str += '<param name="base" value="./files" /\> \n';
	str += '<param name="movie" value="./files/'+id+'.swf?isInternetExplorer=' + isInternetExplorer + '&ran=' + ran + '" /\> \n';
	str += '<param name="quality" value="high" /\> \n';
	str += '<param name="wmode" value="transparent" /\> \n';
	str += '<param name="bgcolor" value="#999999" /\> \n';
	str += '<param name="scale" value="noscale" /\> \n';
	str += '<param name="salign" value="lt" /\> \n';
	str += '<embed src="./files/'+id+'.swf" \n';
	str += 'allowScriptAccess="sameDomain" \n';
	str += 'base="./files" \n';
	str += 'quality="high" \n';
	str += 'wmode="transparent" \n';
	str += 'scale="noscale" \n';
	str += 'salign="lt" \n';
	str += 'bgcolor="#999999" \n';
	str += 'FlashVars="isInternetExplorer=' + isInternetExplorer + '" \n';
	str += 'width="'+w+'" height="'+h+'" name="'+id+'" align="middle" \n';
	str += 'type="application/x-shockwave-flash" \n';
	str += 'pluginspage="http://www.macromedia.com/go/getflashplayer" /\> \n';
	str += '</object\>\n';
	return str;
}