var xmlhttp, xmlhttp2;
var usernameInUse;
var loadAction, loadAction2, currentIMDBID;
var onMenu;
var	loadMediaDivID;

function startUp() {

}

function jumpto(x){
	if (document.form1.jumpmenu.value != "null") {
		document.location.href = x
	}
}

function loadAccordions() {
	new Accordian('sidebar-accordian',5,'header_highlight');
}

function setRecentDays(type, divID, numDays) {
	var theURL 		= baseURL + '/cgi-bin/showHome2.cgi?DAYS=' + numDays + '&TAB=' + type;
	window.location = theURL;
}



function musicShow(id, headerDivID) {
	hide('main-myCDs');
	hide('main-myOnlineMusic');
	hide('main-myMusicArtists');
	document.getElementById('tabHeaderCD').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderCD').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderMU').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderMU').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderArtistsMusic').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderArtistsMusic').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}

function wordsShow(id, headerDivID) {
	hide('main-myBooks');
	hide('main-myArtistsWords');
	document.getElementById('tabHeaderBO').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderBO').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderArtistsWords').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderArtistsWords').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}

function moviesShow(id, headerDivID) {
	hide('main-myMovies');
	hide('main-myInTheaters');
	hide('main-myArtistsMovies');
	document.getElementById('tabHeaderDV').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderDV').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderIT').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderIT').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderArtistsMovies').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderArtistsMovies').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}

function gamesShow(id, headerDivID) {
	hide('main-myDS');
	hide('main-myGB');
	hide('main-myPG');
	hide('main-myP2');
	hide('main-myP3');
	hide('main-myPS');
	hide('main-myWI');
	hide('main-myXB');
	hide('main-myX3');
	hide('main-myArtistsGames');
	document.getElementById('tabHeaderDS').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderDS').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderGB').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderGB').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderPG').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderPG').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderP2').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderP2').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderP3').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderP3').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderPS').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderPS').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderWI').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderWI').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderXB').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderXB').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderX3').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderX3').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderArtistsGames').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderArtistsGames').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}

function concertsShow(id, headerDivID) {
	hide('main-myCO');
	hide('main-myCO-ALL');
	hide('main-myConcertsArtists');
	document.getElementById('tabHeaderCO').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderCO').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderCO-ALL').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderCO-ALL').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderArtistsConcerts').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderArtistsConcerts').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}

function hotlistShow(id, headerDivID) {
	hide('main-myHLMUSIC');
	hide('main-myHLWORDS');
	hide('main-myHLMOVIES');
	hide('main-myHLGAMES');
	hide('main-myHLCONCERTS');
	document.getElementById('tabHeaderHLMUSIC').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderHLMUSIC').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderHLWORDS').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderHLWORDS').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderHLMOVIES').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderHLMOVIES').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderHLGAMES').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderHLGAMES').setAttribute("className", "tabHeader"); 
	document.getElementById('tabHeaderHLCONCERTS').setAttribute("class", "tabHeader"); 
	document.getElementById('tabHeaderHLCONCERTS').setAttribute("className", "tabHeader"); 
	document.getElementById(headerDivID).setAttribute("class", "tabHeader headerGlow"); 
	document.getElementById(headerDivID).setAttribute("className", "tabHeader headerGlow"); 
	show(id);
}


function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}



function harvestItem(ASIN, searchIndex) {
		
	document.getElementById('serverResponse').innerHTML = "Saving...";
	
	var theURL 		= baseURL + '/cgi-bin/harvestItem.cgi?ASIN=' + ASIN + '&SEARCHINDEX=' + searchIndex;
	
	loadAction		= "InsertNewFavArtistName";
	loadAndAct(theURL);
	
}

function show(id) {
	document.getElementById(id).style.display	= 'block';
}

function hide(id) {
	document.getElementById(id).style.display	= 'none';
}

function loadMovieInfo(IMDBID) {
	
	currentIMDBID = IMDBID;
	
	document.getElementById(IMDBID).innerHTML = "Loading...";
	theDiv 			= document.getElementById(IMDBID);
	theDiv.style.display	= 'block';
	
	var theURL 		= baseURL + '/cgi-bin/loadMovieInfo.cgi?IMDBID=' + IMDBID;
	
	loadAction		= "LoadMovieInfo";
	loadAndAct(theURL);


}




function addFavArtist(artistType) {
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
	
		document.getElementById('addFavGoButton').innerHTML = "<img border='0' src='art/goSaving.jpg'>";
		
		// Add to server Userlikes table
		var artistName	= document.getElementById('testinput_xml').value;
		var theURL 		= baseURL + '/cgi-bin/addFavArtistName.cgi?ARTIST=' + artistName + '&TYPE=' + artistType;
		loadAction		= "InsertNewFavArtistName";
		loadAndAct(theURL);
		document.getElementById('testinput_xml').value = "";
	}
}


function addToUserlikes(theID) {
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
		theDiv = theID;
		setImg(theDiv, 'addingToMyFavs.jpg');
		var theURL 		= baseURL + '/cgi-bin/addToUserlikes.cgi?VALUE=true&ID=' + theID;
		loadAction		= "InsertNewFavArtist";
		loadAndAct(theURL);
	}
}



function setArtistValue(theID, artistValue) {
	
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
		var theURL = baseURL + '/cgi-bin/addToUserlikes.cgi?VALUE='+artistValue+'&ID=' + theID;
		
		theDiv 			= document.getElementById('genreArtistsStatus');
		theDiv.innerHTML='<img style="padding-top:3px;" height="16" width="16" src="' + baseURL + '/art/loadingSmall.gif"> <span style="position:relative; top:-3px;">Saving...</span>';
		theDiv.style.display = 'block';
		
		loadAction2	= "SetArtistValue";
		loadAndAct2(theURL);
	}
}


function setPopularChoices(theName, theValue) {
	
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
		var theURL = baseURL + '/cgi-bin/addPopularChoicesToUserlikes.cgi?VALUE='+theValue+'&ID=' + theName;
		//alert(theURL);
		loadAction2	= "addPopularChoice";
		loadAndAct2(theURL);
	}
}


function setDVDValue(theID, itemValue) {
	
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
		var theURL = baseURL + '/cgi-bin/addToUserlikes.cgi?ID=' + theID + "&VALUE=" + itemValue;
		
		loadAction2	= "SetArtistValue";
		loadAndAct2(theURL);
	}

}



function insertOptionBefore(i, artistID, artistName)
{
  var elSel = document.MyFavsForm.ARTIST;
    var elOptNew = document.createElement('option');
    elOptNew.text = artistName;
    elOptNew.value = artistID;
    var elOptOld = elSel.options[i];  
    try {
      elSel.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
    }
    catch(ex) {
      elSel.add(elOptNew, i); // IE only
    }
}



function chooseMyFav(theSelect) {
	
	var box 		= document.MyFavsForm.ARTIST;
	var artistName 	= box.options[box.selectedIndex].text;
	var artistID 	= box.options[box.selectedIndex].value;
	
	// Show Detail Block.
	theDiv 			= document.getElementById('myFavsHelper');
	theDiv.style.display	= 'none';
	
	theDiv 			= document.getElementById('artistDetails');
	theDiv.style.display	= 'block';
	
	// Set selected Artist Name
	theDiv 			= document.getElementById('myFavsArtistName');
	theDiv.innerHTML = artistName;
	
	// Get Artist Summary
	var theURL 		= baseURL + '/cgi-bin/getArtistSummary.cgi?ARTISTID=' + artistID;
	loadAction		= "DisplayArtistSummary";
	loadAndAct(theURL);
	
	// Get Artist Similars
	var theURL 		= baseURL + '/cgi-bin/getSimilarArtists.cgi?ARTISTID=' + artistID;
	loadAction2		= "DisplaySimilarArtists";
	loadAndAct2(theURL);

}



function deleteFromMyFavs() {
	
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite artists. Why not join now? It's free!";
		alert(msg);
	}
	else {
	
		var box 		= document.MyFavsForm.ARTIST;
		var artistID 	= box.options[box.selectedIndex].value;
		
		setImg('deleteFromMyFavs', 'deletingFromMyFavs.jpg');
		
		var theURL 		= baseURL + '/cgi-bin/addToUserlikes.cgi?VALUE=false&ID=' + artistID;
		
		//alert(theURL);
		loadAction		= "DisplayArtistDeleted";
		loadAndAct(theURL);
	}
	
}


function checkAccess() {
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite things. Why not join now? It's free!";
		alert(msg);
		return false;
	}
	return true;
}


function setImg(theDivID, theImg) {

	theDiv 			= document.getElementById(theDivID);
	theDiv.src		= "art/" + theImg;
	
}








function setGameValue(thePlatform, theValue) {
	
	var theURL = baseURL + '/cgi-bin/setPlatformValue.cgi?PLATFORM=' + thePlatform + "&VALUE=" + theValue;
	
	userID = Cookie.get('MPOPS');
	if (userID == '1') {
		msg = "Sorry, only members can customize their favorite games. Why not join now? It's free!";
		alert(msg);
	}
	else {
		loadAndAct(theURL);
	}
}






function showJoinGlow() {
	
	var theArt = baseURL + '/art/trGlow.jpg';
	document.images.joinButton.src = theArt;

}


function hideJoinGlow() {
	
	var theArt = baseURL + '/art/tr.jpg';
	document.images.joinButton.src = theArt;

}


function swapButton(theButton) {
	
	if (theButton == onMenu) { return; }
	
	var theArt = baseURL + '/art/buttons/' + theButton + '.jpg';
	
	if (theButton == 'blues') 			{ document.images.blues.src = theArt; }
	if (theButton == 'broadway') 		{ document.images.broadway.src = theArt; }
	if (theButton == 'classical') 		{ document.images.classical.src = theArt; }
	if (theButton == 'country') 		{ document.images.country.src = theArt; }
	if (theButton == 'dance') 			{ document.images.dance.src = theArt; }
	if (theButton == 'folk') 			{ document.images.folk.src = theArt; }
	if (theButton == 'international') 	{ document.images.international.src = theArt; }
	if (theButton == 'jazz') 			{ document.images.jazz.src = theArt; }
	if (theButton == 'latin') 			{ document.images.latin.src = theArt; }
	if (theButton == 'newAge') 			{ document.images.newAge.src = theArt; }
	if (theButton == 'opera') 			{ document.images.opera.src = theArt; }
	if (theButton == 'pop') 			{ document.images.pop.src = theArt; }
	if (theButton == 'rap') 			{ document.images.rap.src = theArt; }
	if (theButton == 'rb') 				{ document.images.rb.src = theArt; }
	if (theButton == 'rock') 			{ document.images.rock.src = theArt; }
	
	
	if (theButton == 'arts') 			{ document.images.arts.src = theArt; }
	if (theButton == 'business') 		{ document.images.business.src = theArt; }
	if (theButton == 'childrens') 		{ document.images.childrens.src = theArt; }
	if (theButton == 'comics') 			{ document.images.comics.src = theArt; }
	if (theButton == 'computers') 		{ document.images.computers.src = theArt; }
	if (theButton == 'cooking') 		{ document.images.cooking.src = theArt; }
	if (theButton == 'entertainment') 	{ document.images.entertainment.src = theArt; }
	if (theButton == 'gay') 			{ document.images.gay.src = theArt; }
	if (theButton == 'health') 			{ document.images.health.src = theArt; }
	if (theButton == 'history') 		{ document.images.history.src = theArt; }
	if (theButton == 'homeGarden') 		{ document.images.homeGarden.src = theArt; }
	if (theButton == 'fiction') 		{ document.images.fiction.src = theArt; }
	if (theButton == 'mysteryThriller') { document.images.mysteryThriller.src = theArt; }
	if (theButton == 'nonfiction') 		{ document.images.nonfiction.src = theArt; }
	if (theButton == 'outdoorsNature') 	{ document.images.outdoorsNature.src = theArt; }
	if (theButton == 'parenting') 		{ document.images.parenting.src = theArt; }
	if (theButton == 'religion') 		{ document.images.religion.src = theArt; }
	if (theButton == 'romance') 		{ document.images.romance.src = theArt; }
	if (theButton == 'science') 		{ document.images.science.src = theArt; }
	if (theButton == 'scienceFiction') 	{ document.images.scienceFiction.src = theArt; }
	if (theButton == 'sports') 			{ document.images.sports.src = theArt; }
	if (theButton == 'teens') 			{ document.images.teens.src = theArt; }
	if (theButton == 'travel') 			{ document.images.travel.src = theArt; }
	
	if (theButton == 'actionAdventure') { document.images.actionAdventure.src = theArt; }
	if (theButton == 'animation') 		{ document.images.animation.src = theArt; }
	if (theButton == 'classics') 		{ document.images.classics.src = theArt; }
	if (theButton == 'comedy') 			{ document.images.comedy.src = theArt; }
	if (theButton == 'cultMovies') 		{ document.images.cultMovies.src = theArt; }
	if (theButton == 'documentary') 	{ document.images.documentary.src = theArt; }
	if (theButton == 'drama') 			{ document.images.drama.src = theArt; }
	//if (theButton == 'educational') 	{ document.images.educational.src = theArt; }
	if (theButton == 'fitness') 		{ document.images.fitness.src = theArt; }
	if (theButton == 'gayLesbian') 		{ document.images.gayLesbian.src = theArt; }
	if (theButton == 'horror') 			{ document.images.horror.src = theArt; }
	if (theButton == 'internationalMovie') { document.images.internationalMovie.src = theArt; }
	if (theButton == 'kidsFamily') 		{ document.images.kidsFamily.src = theArt; }
	if (theButton == 'militaryWar') 	{ document.images.militaryWar.src = theArt; }
	if (theButton == 'musicals') 		{ document.images.musicals.src = theArt; }
	if (theButton == 'musicVideo') 		{ document.images.musicVideo.src = theArt; }
	if (theButton == 'mysterySuspense') { document.images.mysterySuspense.src = theArt; }
	if (theButton == 'scienceFictionMovie') 	{ document.images.scienceFictionMovie.src = theArt; }
	if (theButton == 'sportsMovie') 	{ document.images.sportsMovie.src = theArt; }
	if (theButton == 'westerns') 		{ document.images.westerns.src = theArt; }
	
	
}
	
	
	

function swapOver(theButton) {
	
	if (theButton == onMenu) { return; }
	
	var theArt = baseURL + '/art/buttons/' + theButton + 'Glow.jpg';
	
	if (theButton == 'blues') 			{ document.images.blues.src = theArt; }
	if (theButton == 'broadway') 		{ document.images.broadway.src = theArt; }
	if (theButton == 'classical') 		{ document.images.classical.src = theArt; }
	if (theButton == 'country') 		{ document.images.country.src = theArt; }
	if (theButton == 'dance') 			{ document.images.dance.src = theArt; }
	if (theButton == 'folk') 			{ document.images.folk.src = theArt; }
	if (theButton == 'international') 	{ document.images.international.src = theArt; }
	if (theButton == 'jazz') 			{ document.images.jazz.src = theArt; }
	if (theButton == 'latin') 			{ document.images.latin.src = theArt; }
	if (theButton == 'newAge') 			{ document.images.newAge.src = theArt; }
	if (theButton == 'opera') 			{ document.images.opera.src = theArt; }
	if (theButton == 'pop') 			{ document.images.pop.src = theArt; }
	if (theButton == 'rap') 			{ document.images.rap.src = theArt; }
	if (theButton == 'rb') 				{ document.images.rb.src = theArt; }
	if (theButton == 'rock') 			{ document.images.rock.src = theArt; }

	if (theButton == 'arts') 			{ document.images.arts.src = theArt; }
	if (theButton == 'business') 		{ document.images.business.src = theArt; }
	if (theButton == 'childrens') 		{ document.images.childrens.src = theArt; }
	if (theButton == 'comics') 			{ document.images.comics.src = theArt; }
	if (theButton == 'computers') 		{ document.images.computers.src = theArt; }
	if (theButton == 'cooking') 		{ document.images.cooking.src = theArt; }
	if (theButton == 'entertainment') 	{ document.images.entertainment.src = theArt; }
	if (theButton == 'gay') 			{ document.images.gay.src = theArt; }
	if (theButton == 'health') 			{ document.images.health.src = theArt; }
	if (theButton == 'history') 		{ document.images.history.src = theArt; }
	if (theButton == 'homeGarden') 		{ document.images.homeGarden.src = theArt; }
	if (theButton == 'fiction') 		{ document.images.fiction.src = theArt; }
	if (theButton == 'mysteryThriller') { document.images.mysteryThriller.src = theArt; }
	if (theButton == 'nonfiction') 		{ document.images.nonfiction.src = theArt; }
	if (theButton == 'outdoorsNature') 	{ document.images.outdoorsNature.src = theArt; }
	if (theButton == 'parenting') 		{ document.images.parenting.src = theArt; }
	if (theButton == 'religion') 		{ document.images.religion.src = theArt; }
	if (theButton == 'romance') 		{ document.images.romance.src = theArt; }
	if (theButton == 'science') 		{ document.images.science.src = theArt; }
	if (theButton == 'scienceFiction') 	{ document.images.scienceFiction.src = theArt; }
	if (theButton == 'sports') 			{ document.images.sports.src = theArt; }
	if (theButton == 'teens') 			{ document.images.teens.src = theArt; }
	if (theButton == 'travel') 			{ document.images.travel.src = theArt; }
	
	if (theButton == 'actionAdventure') { document.images.actionAdventure.src = theArt; }
	if (theButton == 'animation') 		{ document.images.animation.src = theArt; }
	if (theButton == 'classics') 		{ document.images.classics.src = theArt; }
	if (theButton == 'comedy') 			{ document.images.comedy.src = theArt; }
	if (theButton == 'cultMovies') 		{ document.images.cultMovies.src = theArt; }
	if (theButton == 'documentary') 	{ document.images.documentary.src = theArt; }
	if (theButton == 'drama') 			{ document.images.drama.src = theArt; }
	//if (theButton == 'educational') 	{ document.images.educational.src = theArt; }
	if (theButton == 'fitness') 		{ document.images.fitness.src = theArt; }
	if (theButton == 'gayLesbian') 		{ document.images.gayLesbian.src = theArt; }
	if (theButton == 'horror') 			{ document.images.horror.src = theArt; }
	if (theButton == 'internationalMovie') { document.images.internationalMovie.src = theArt; }
	if (theButton == 'kidsFamily') 		{ document.images.kidsFamily.src = theArt; }
	if (theButton == 'militaryWar') 	{ document.images.militaryWar.src = theArt; }
	if (theButton == 'musicals') 		{ document.images.musicals.src = theArt; }
	if (theButton == 'musicVideo') 		{ document.images.musicVideo.src = theArt; }
	if (theButton == 'mysterySuspense') { document.images.mysterySuspense.src = theArt; }
	if (theButton == 'scienceFictionMovie') 	{ document.images.scienceFictionMovie.src = theArt; }
	if (theButton == 'sportsMovie') 	{ document.images.sportsMovie.src = theArt; }
	if (theButton == 'westerns') 		{ document.images.westerns.src = theArt; }
}
	



function swapOn(theButton) {

	var theArt = baseURL + '/art/buttons/' + theButton + 'On.jpg';
	
	resetGenreMenus();
	
	if (theButton == 'blues') 			{ document.images.blues.src = theArt; }
	if (theButton == 'broadway') 		{ document.images.broadway.src = theArt; }
	if (theButton == 'classical') 		{ document.images.classical.src = theArt; }
	if (theButton == 'country') 		{ document.images.country.src = theArt; }
	if (theButton == 'dance') 			{ document.images.dance.src = theArt; }
	if (theButton == 'folk') 			{ document.images.folk.src = theArt; }
	if (theButton == 'international') 	{ document.images.international.src = theArt; }
	if (theButton == 'jazz') 			{ document.images.jazz.src = theArt; }
	if (theButton == 'latin') 			{ document.images.latin.src = theArt; }
	if (theButton == 'newAge') 			{ document.images.newAge.src = theArt; }
	if (theButton == 'opera') 			{ document.images.opera.src = theArt; }
	if (theButton == 'pop') 			{ document.images.pop.src = theArt; }
	if (theButton == 'rap') 			{ document.images.rap.src = theArt; }
	if (theButton == 'rb') 				{ document.images.rb.src = theArt; }
	if (theButton == 'rock') 			{ document.images.rock.src = theArt; }

	if (theButton == 'arts') 			{ document.images.arts.src = theArt; }
	if (theButton == 'business') 		{ document.images.business.src = theArt; }
	if (theButton == 'childrens') 		{ document.images.childrens.src = theArt; }
	if (theButton == 'comics') 			{ document.images.comics.src = theArt; }
	if (theButton == 'computers') 		{ document.images.computers.src = theArt; }
	if (theButton == 'cooking') 		{ document.images.cooking.src = theArt; }
	if (theButton == 'entertainment') 	{ document.images.entertainment.src = theArt; }
	if (theButton == 'gay') 			{ document.images.gay.src = theArt; }
	if (theButton == 'health') 			{ document.images.health.src = theArt; }
	if (theButton == 'history') 		{ document.images.history.src = theArt; }
	if (theButton == 'homeGarden') 		{ document.images.homeGarden.src = theArt; }
	if (theButton == 'fiction') 		{ document.images.fiction.src = theArt; }
	if (theButton == 'mysteryThriller') { document.images.mysteryThriller.src = theArt; }
	if (theButton == 'nonfiction') 		{ document.images.nonfiction.src = theArt; }
	if (theButton == 'outdoorsNature') 	{ document.images.outdoorsNature.src = theArt; }
	if (theButton == 'parenting') 		{ document.images.parenting.src = theArt; }
	if (theButton == 'religion') 		{ document.images.religion.src = theArt; }
	if (theButton == 'romance') 		{ document.images.romance.src = theArt; }
	if (theButton == 'science') 		{ document.images.science.src = theArt; }
	if (theButton == 'scienceFiction') 	{ document.images.scienceFiction.src = theArt; }
	if (theButton == 'sports') 			{ document.images.sports.src = theArt; }
	if (theButton == 'teens') 			{ document.images.teens.src = theArt; }
	if (theButton == 'travel') 			{ document.images.travel.src = theArt; }
	
	if (theButton == 'actionAdventure') { document.images.actionAdventure.src = theArt; }
	if (theButton == 'animation') 		{ document.images.animation.src = theArt; }
	if (theButton == 'classics') 		{ document.images.classics.src = theArt; }
	if (theButton == 'comedy') 			{ document.images.comedy.src = theArt; }
	if (theButton == 'cultMovies') 		{ document.images.cultMovies.src = theArt; }
	if (theButton == 'documentary') 	{ document.images.documentary.src = theArt; }
	if (theButton == 'drama') 			{ document.images.drama.src = theArt; }
	//if (theButton == 'educational') 	{ document.images.educational.src = theArt; }
	if (theButton == 'fitness') 		{ document.images.fitness.src = theArt; }
	if (theButton == 'gayLesbian') 		{ document.images.gayLesbian.src = theArt; }
	if (theButton == 'horror') 			{ document.images.horror.src = theArt; }
	if (theButton == 'internationalMovie') { document.images.internationalMovie.src = theArt; }
	if (theButton == 'kidsFamily') 		{ document.images.kidsFamily.src = theArt; }
	if (theButton == 'militaryWar') 	{ document.images.militaryWar.src = theArt; }
	if (theButton == 'musicals') 		{ document.images.musicals.src = theArt; }
	if (theButton == 'musicVideo') 		{ document.images.musicVideo.src = theArt; }
	if (theButton == 'mysterySuspense') { document.images.mysterySuspense.src = theArt; }
	if (theButton == 'scienceFictionMovie') { document.images.scienceFictionMovie.src = theArt; }
	if (theButton == 'sportsMovie') 	{ document.images.sportsMovie.src = theArt; }
	if (theButton == 'westerns') 		{ document.images.westerns.src = theArt; }
}



function resetGenreMenus() {
	
	if (document.getElementById("blues")) {
		resetMusicMenus(); 
	}
	
	if (document.getElementById("arts")) {
		resetAuthorMenus(); 
	}
	
	if (document.getElementById("actionAdventure")) {
		resetDVDMenus(); 
	}
}


function resetDVDMenus() {

	document.images.actionAdventure.src 		= baseURL + '/art/buttons/actionAdventure.jpg';
	document.images.animation.src 				= baseURL + '/art/buttons/animation.jpg';
	document.images.classics.src 				= baseURL + '/art/buttons/classics.jpg';
	document.images.comedy.src 					= baseURL + '/art/buttons/comedy.jpg';
	document.images.cultMovies.src 				= baseURL + '/art/buttons/cultMovies.jpg';
	document.images.documentary.src 			= baseURL + '/art/buttons/documentary.jpg';
	document.images.drama.src 					= baseURL + '/art/buttons/drama.jpg';
	//document.images.educational.src 			= baseURL + '/art/buttons/educational.jpg';
	document.images.fitness.src 				= baseURL + '/art/buttons/fitness.jpg';
	document.images.gayLesbian.src 				= baseURL + '/art/buttons/gayLesbian.jpg';
	document.images.horror.src 					= baseURL + '/art/buttons/horror.jpg';
	document.images.internationalMovie.src 		= baseURL + '/art/buttons/internationalMovie.jpg';
	document.images.kidsFamily.src 				= baseURL + '/art/buttons/kidsFamily.jpg';
	document.images.militaryWar.src 			= baseURL + '/art/buttons/militaryWar.jpg';
	document.images.musicals.src 				= baseURL + '/art/buttons/musicals.jpg';
	document.images.musicVideo.src 				= baseURL + '/art/buttons/musicVideo.jpg';
	document.images.mysterySuspense.src 		= baseURL + '/art/buttons/mysterySuspense.jpg';
	document.images.scienceFictionMovie.src 	= baseURL + '/art/buttons/scienceFictionMovie.jpg';
	document.images.sportsMovie.src 			= baseURL + '/art/buttons/sportsMovie.jpg';
	document.images.westerns.src 				= baseURL + '/art/buttons/westerns.jpg';
	
}


function resetMusicMenus() {

	document.images.blues.src 		= baseURL + '/art/buttons/blues.jpg';
	document.images.broadway.src 	= baseURL + '/art/buttons/broadway.jpg';
	document.images.classical.src 	= baseURL + '/art/buttons/classical.jpg';
	document.images.country.src 	= baseURL + '/art/buttons/country.jpg';
	document.images.dance.src 		= baseURL + '/art/buttons/dance.jpg';
	document.images.folk.src 		= baseURL + '/art/buttons/folk.jpg';
	document.images.international.src = baseURL + '/art/buttons/international.jpg';
	document.images.jazz.src 		= baseURL + '/art/buttons/jazz.jpg';
	document.images.latin.src 		= baseURL + '/art/buttons/latin.jpg';
	document.images.newAge.src 		= baseURL + '/art/buttons/newAge.jpg';
	document.images.opera.src 		= baseURL + '/art/buttons/opera.jpg';
	document.images.pop.src 		= baseURL + '/art/buttons/pop.jpg';
	document.images.rap.src 		= baseURL + '/art/buttons/rap.jpg';
	document.images.rb.src 			= baseURL + '/art/buttons/rb.jpg';
	document.images.rock.src 		= baseURL + '/art/buttons/rock.jpg';
}



function resetAuthorMenus () {

	document.images.arts.src 		= baseURL + '/art/buttons/arts.jpg';
	document.images.business.src 	= baseURL + '/art/buttons/business.jpg';
	document.images.childrens.src 	= baseURL + '/art/buttons/childrens.jpg';
	document.images.comics.src 		= baseURL + '/art/buttons/comics.jpg';
	document.images.computers.src 	= baseURL + '/art/buttons/computers.jpg';
	document.images.cooking.src 	= baseURL + '/art/buttons/cooking.jpg';
	document.images.entertainment.src = baseURL + '/art/buttons/entertainment.jpg';
	document.images.gay.src 		= baseURL + '/art/buttons/gay.jpg';
	document.images.health.src 		= baseURL + '/art/buttons/health.jpg';
	document.images.history.src 	= baseURL + '/art/buttons/history.jpg';
	document.images.homeGarden.src 	= baseURL + '/art/buttons/homeGarden.jpg';
	document.images.fiction.src 	= baseURL + '/art/buttons/fiction.jpg';
	document.images.mysteryThriller.src = baseURL + '/art/buttons/mysteryThriller.jpg';
	document.images.nonfiction.src 	= baseURL + '/art/buttons/nonfiction.jpg';
	document.images.outdoorsNature.src 	= baseURL + '/art/buttons/outdoorsNature.jpg';
	document.images.parenting.src 	= baseURL + '/art/buttons/parenting.jpg';
	document.images.religion.src 	= baseURL + '/art/buttons/religion.jpg';
	document.images.romance.src 	= baseURL + '/art/buttons/romance.jpg';
	document.images.science.src 	= baseURL + '/art/buttons/science.jpg';
	document.images.scienceFiction.src 	= baseURL + '/art/buttons/scienceFiction.jpg';
	document.images.sports.src 		= baseURL + '/art/buttons/sports.jpg';
	document.images.teens.src 		= baseURL + '/art/buttons/teens.jpg';
	document.images.travel.src 		= baseURL + '/art/buttons/travel.jpg';
}



function doButtonClick(theButton) {
	var theURL;
	
	onMenu = theButton;
	
	swapOn(theButton);
	
	theURL = baseURL + '/cgi-bin/loadGenreArtistsNew.cgi?GENRE=' + theButton;
	
	loadGenreArtists(theURL);
	
	
}


function doAuthorButtonClick(theButton) {

	onMenu = theButton;
	
	swapOn(theButton);
	
	var theURL = baseURL + '/cgi-bin/loadGenreAuthors.cgi?GENRE=' + theButton;
	
	loadGenreAuthors(theURL);
	
	
}

function doDVDButtonClick(theButton) {

	onMenu = theButton;
	
	swapOn(theButton);
	
	var theURL = baseURL + '/cgi-bin/loadTopDVDs.cgi?GENRE=' + theButton;
	
	loadGenreAuthors(theURL);
	
	
}


function loadMedia(type, page, divID) {
	
	hide(divID);
	show('loading');
	
	url = baseURL + '/cgi-bin/showMedia.cgi?MEDIA='+ type +'&PN='+ page;
	url = url + '&r=' + Math.floor( Math.random ( ) * 10000 + 1 )
	loadMediaDivID 		= divID;
	
	xmlhttp=null;
	if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest() }
	else if (window.ActiveXObject)
	  { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") }
	if (xmlhttp!=null) {
	  	xmlhttp.onreadystatechange=loadMediaStateChange;
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  }
}


function loadMediaStateChange() {
	if (xmlhttp.readyState==4) {	
		document.getElementById(loadMediaDivID).innerHTML = xmlhttp.responseText;
		hide('loading');
		show(loadMediaDivID);
	}
}




function doBookmarkClick(theID, userID, type) {
	
	theBookmarkText = theID + "-bookmark";
	theText 		= document.getElementById(theBookmarkText);
	var theURL 		= baseURL + "/cgi-bin/saveBookmark.cgi?ID=" + theID;
	
	loadAndAct(theURL);
	
	// Increment navbar bookmark count
	theBookmarkID = "bookmarkNumbers";
	theNumber 		= document.getElementById(theBookmarkID);
	tmp = parseInt( theNumber.innerHTML );
	tmp++;
	theNumber.innerHTML = tmp;
	
	if (type == 'List') { name = 'unHotlistItList.jpg'; }
	else { name = 'unHotlist.jpg'; }
	
	theText.innerHTML = "<a href=\"javascript:doBookmarkUnClick('" + theID + "', "+ userID + ", '" + type + "');\"><img border='0' src='art/" + name + "'></a>";
	
}


function doBookmarkUnClick(theID, userID, type) {
	
	theBookmarkText = theID + "-bookmark";
	theText 		= document.getElementById(theBookmarkText);
	
	var theURL 		= baseURL + "/cgi-bin/deleteBookmark.cgi?ID=" + theID;
	loadAndAct(theURL);
	theText.innerHTML = '';
	
	// Decrement navbar bookmark count
	theBookmarkID = "bookmarkNumbers";
	theNumber 		= document.getElementById(theBookmarkID);
	tmp = parseInt( theNumber.innerHTML );
	tmp--;
	theNumber.innerHTML = tmp;
	
	if (type == 'List') { name = 'hotlistItList.jpg'; }
	else { name = 'hotlistIt.jpg'; }
	
	theText.innerHTML = "<a href=\"javascript:doBookmarkClick('" + theID + "', "+ userID + ", '" + type + "');\"><img border='0' src='art/" + name + "'></a>";
}


function doStarClick(theID, theNumber, isSurvey) {
	
	theRatingText 	= theID + "-rateMe";
	theText 		= document.getElementById(theRatingText);
	
	var theURL 		= baseURL + "/cgi-bin/saveStarRating.cgi?ID=" + theID + "&RATING=" + theNumber;
	var theResult 	= loadAndAct(theURL);
	theResult = "<span class='ratingSaved'>Saved!</span><br>"; 
	theText.innerHTML = theResult;
	
	s 				= theID + "-star";
	theStar 		= document.getElementById(s);
	theStar.alt		= theNumber;
	
	if (isSurvey == 'T') {
		//theURL 		= baseURL + "/cgi-bin/buildNewSurvey.cgi";
		//loadNewSurvey(theURL);
		window.location.reload();
	}
	
	
}



 function loadNewSurvey(url)
{
	xmlhttp=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	xmlhttp.onreadystatechange=state_Change3
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
function state_Change3()
	{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {
	  	theSurveyDiv	= document.getElementById("surveyChunk");
		theSurveyDiv.innerHTML = xmlhttp.responseText;
		
		//alert(xmlhttp.responseText);
	  }
 }
 
 

	
 function loadGenreArtists(url)
{
	xmlhttp=null
	theGenreDiv	= document.getElementById("genreArtists");
	theGenreDiv.innerHTML = 'Loading...';
		
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	xmlhttp.onreadystatechange=state_ChangeGA
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
function state_ChangeGA()
	{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {
	  	theGenreDiv	= document.getElementById("genreArtists");
		theGenreDiv.innerHTML = xmlhttp.responseText;
		
		//alert(xmlhttp.responseText);
	  }
 }
 
 
 
 
  function loadGenreAuthors(url)
{
	xmlhttp=null
	
	theGenreDiv	= document.getElementById("genreArtists");
	theGenreDiv.innerHTML = 'Loading...';
		
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	xmlhttp.onreadystatechange=state_ChangeGAuthors
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
function state_ChangeGAuthors()
	{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {
	  	theGenreDiv	= document.getElementById("genreArtists");
		theGenreDiv.innerHTML = xmlhttp.responseText;
		
		//alert(xmlhttp.responseText);
	  }
 }
 
 
 

 
 
function doStarSwap(theID, theNumber) {

	s 				= theID + "-star";
	theStar 		= document.getElementById(s);
	s 				= 'art/' + theNumber + '-star.gif';
	theStar.src 	= s;
	
	theRatingText 	= theID + "-rateMe";
	theText 		= document.getElementById(theRatingText);
	if (theNumber == '1') { theText.innerHTML = "I hate it!<br>"; }
	if (theNumber == '2') { theText.innerHTML = "I don't like it.<br>"; }
	if (theNumber == '3') { theText.innerHTML = "It's ok.<br>"; }
	if (theNumber == '4') { theText.innerHTML = "I like it.<br>"; }
	if (theNumber == '5') { theText.innerHTML = "I love it!<br>"; }
	
}



function doStarRevert(theID, theNumber) {

	s 				= theID + "-star";
	theStar 		= document.getElementById(s);
	theRating 		= theStar.alt;
	
	s 				= 'art/' + theRating + '-star.gif';
	theStar.src 	= s;
	
	theRatingText 	= theID + "-rateMe";
	theText 		= document.getElementById(theRatingText);
	if (theRating == 'unrated') { theText.innerHTML = "Rate me:<br>"; }
	else { theText.innerHTML = "My Rating:<br>"; }
}





function checkFields() {
	// Check Join fields.
	
	if (document.submitform.EMAIL.value == "") { 
		alert("Please enter an email address.");
		return false;
	}
	
	if (document.submitform.USERNAME.value == "") { 
		alert("Please enter a username.");
		return false;
	}
	
	if (document.submitform.PASSWORD.value == "") { 
		alert("Please enter a password.");
		return false;
	}
	
	if (document.submitform.ZIP.value == "") { 
		alert("Please enter your zip code.");
		return false;
	}
	
	if (document.submitform.CITY.value == "") { 
		alert("Please enter a city.");
		return false;
	}
	
	if (document.submitform.STATE.value == "*") { 
		alert("Please enter a state.");
		return false;
	}
	
	if (usernameInUse == true) {
		alert("Please choose a username that isn't in use already.");
		return false;
	}
	
	
	return true;
}


function loadAndAct(url)
{

	url = url + '&r=' + Math.floor( Math.random ( ) * 10000 + 1 )
	xmlhttp=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	xmlhttp.onreadystatechange=state_Change2
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  	
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
function state_Change2()
	{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {	  	
	  	
	  	if (loadAction == 'LoadMovieInfo') {
	  		theDiv 			= document.getElementById(currentIMDBID);
			theDiv.innerHTML = xmlhttp.responseText;
	  	}
	  	
	  	
	  	if (loadAction == 'DisplayArtistSummary') {
	  		theDiv 			= document.getElementById('myFavsArtistDetails');
			theDiv.innerHTML = xmlhttp.responseText;
	  	}
	  	
	  	if (loadAction == 'DisplayArtistDeleted') {
	  		setImg('deleteFromMyFavs', 'deletedFromMyFavs.jpg');
	  		box = document.forms['MyFavsForm'].ARTIST;
	  		box.options[box.selectedIndex] = null;
	  		theDiv 			= document.getElementById('artistDetails');
			theDiv.style.display	= 'none';
			setImg('deleteFromMyFavs', 'deleteFromMyFavs.jpg');
	  	}
	  	
	  	if (loadAction == 'DisplaySimilarArtists') {
	  		theDiv 			= document.getElementById('similarArtists');
			theDiv.innerHTML = xmlhttp.responseText;
	  	}
	  	
	  	if (loadAction == 'InsertNewFavArtist') {
			var box 		= document.MyFavsForm.ARTIST;
			var i;
			var itemSet = 'F'
			var mySplitResult = xmlhttp.responseText.split("|");
			var artistID = mySplitResult[0];
			var artistName = mySplitResult[1];
			var theDiv = artistID;	
			for (i = box.length - 1; i>=0; i--) {
				theText = box.options[i].text;
				
				if (theText < artistName) {
					insertOptionBefore(i+1, artistID, artistName);
					setImg(theDiv, 'artistAddedToFavs.jpg');
					itemSet = 'T'
					break;
				}
			}
			if(itemSet == 'F') { insertOptionBefore(0, artistID, artistName); setImg(theDiv, 'artistAddedToFavs.jpg');}
  		}
  		
  		if (loadAction == 'InsertNewFavArtistName') {
  			var text=xmlhttp.responseText;
  			var tmp=text.indexOf('Which');
			var tmp2=text.indexOf('Sorry');
			if ((tmp != -1) || (tmp2 != -1)) {
				showServerResponse();
				document.getElementById('serverResponse').innerHTML		= xmlhttp.responseText;
			}
			else {
				showEnterName();
			}
			var box 		= document.MyFavsForm.ARTIST;
			var i;
			var mySplitResult = xmlhttp.responseText.split("|");
			var artistID = mySplitResult[0];
			var artistName = mySplitResult[1];
			var artistType = mySplitResult[2];
			var theDiv = artistID;		
			
			document.getElementById('addFavGoButton').innerHTML = "<a href=\"javascript:addFavArtist('"+artistType+"');\"><img border='0' src='art/goSearch.jpg'></a>";
			
			for (i = box.length - 1; i>=0; i--) {
				theText = box.options[i].text;
				if (theText < artistName) {
					insertOptionBefore(i+1, artistID, artistName);
					break;
				}
			}
			if(typeof(artistName)!="undefined") { insertOptionBefore(0, artistID, artistName); }
  		}
  	
  		
  		if (loadAction == 'DisplayCurrentStats') {
  			var newcontent = document.createElement('p');
  			newcontent.setAttribute('class', 'itemText');
			newcontent.id = 'CurrentStatsData';
			newcontent.appendChild(document.createTextNode(xmlhttp.responseText));
			var scr = document.getElementById('CurrentStats');
			scr.parentNode.insertBefore(newcontent, scr);
  		}
  		

	  	loadAction = '';
	  }
 }
 
 
function showServerResponse() {
 	document.getElementById('enterName').style.display 		= 'none';
	document.getElementById('serverResponse').style.display = 'block';
}

function showEnterName() {
	document.getElementById('serverResponse').style.display = 'none';
 	document.getElementById('enterName').style.display 		= 'block';
}

 
 function loadAndAct2(url)
{
	url = url + '&r=' + Math.floor( Math.random ( ) * 10000 + 1 )
	
	xmlhttp2=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp2=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp2 != null)
	  {
	  
	  	xmlhttp2.onreadystatechange=state_ChangeLoad2
	  	xmlhttp2.open("GET",url,true)
	  	xmlhttp2.send(null)
	  	
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
function state_ChangeLoad2()
	{
	// if xmlhttp shows "loaded"
	if (xmlhttp2.readyState==4)
	  {
	  	
	  	if (loadAction2 == 'DisplaySimilarArtists') {
	  		theDiv 			= document.getElementById('similarArtists');
			theDiv.innerHTML = xmlhttp2.responseText;
	  	}
	  	
	  	if (loadAction2 == 'SetArtistValue') {
	  		theGenreDiv	= document.getElementById("genreArtistsStatus");
			theGenreDiv.innerHTML='<img style="padding-top:3px;" height="16" width="16" src="' + baseURL + '/art/blank.gif"> <span style="position:relative; top:-3px;">Saved.</span>';
	  	}
	  	
	  	
	  	if (loadAction2=='addPopularChoice') {
	  		//tmp = xmlhttp2.responseText;
	  		//alert(tmp);
	  	}
	  	
	  	
	  	loadAction2 = '';
	  }
 }


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function getArgs() { 
	var args = new Object(); 
	var query = location.search.substring(1); 
	var pairs = query.split("&"); 
	for(var i = 0; i < pairs.length; i++) { 
		var pos = pairs[i].indexOf('='); 
		if (pos == -1) continue; 
		var argname = pairs[i].substring(0,pos); 
		var value = pairs[i].substring(pos+1); 
		args[argname] = unescape(value); 
	} 
	return args; 
} 



function load(url, theDiv)
{
	
	// Ajax GET loader
	el = document.getElementById(theDiv);
	el.innerHTML = "Checking...";
	
	
	xmlhttp=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  	xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	xmlhttp.onreadystatechange=state_Change
	  	xmlhttp.open("GET",url,true)
	  	xmlhttp.send(null)
	  	
	  }
	else
	  {
	  	alert("Your browser does not support XMLHTTP.")
	  }
	}
	function state_Change()
	{
	
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {
	  // if "OK"
	  
	  if (xmlhttp.status==200)
		{
			el.innerHTML = xmlhttp.responseText; 
			
			if (xmlhttp.responseText == "Already in use...") {
				// New account username in use already.
				usernameInUse = true;
			}
			else {
				usernameInUse = false;
			}	
			
		}
	  else
		{
			alert("Problem retrieving XML data")
		}
	  }
 }




function checkUsername(theUsername) {
	// Does username exist already?
	var theURL = "http://mediapops.com/cgi-bin/checkUsername.cgi?USERNAME=" + theUsername;
	var theDiv = "checkUsername";
	var theMsg = "Checking...";
	load(theURL, theDiv, theMsg);
}






function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
mustInitImg = true;
function initImgID() {di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}
function findElement(n,ly) {
	d = document;
	if (browserVers < 4)		return d[n];
	if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; 
	var cd = ly ? ly.document : d;
	var elem = cd[n];
	if (!elem) {
		for (var i=0;i<cd.layers.length;i++) {
			elem = findElement(n,cd.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}


function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}


var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		over_music = newImage(/*URL*/'art/musicGlow.jpg');
		over_words = newImage(/*URL*/'art/wordsGlow.jpg');
		over_movies = newImage(/*URL*/'art/moviesGlow.jpg');
		over_games = newImage(/*URL*/'art/gamesGlow.jpg');
		over_concerts = newImage(/*URL*/'art/concertsGlow.jpg');
		over_tv = newImage(/*URL*/'art/tvGlow.jpg');
		over_favs = newImage(/*URL*/'art/favsGlow.jpg');
		preloadFlag = true;
	}
}


