//Event.observe(window, 'load', loadForumBlock, false);
function JumpToGenre(GenreID) {
	window.location='artist_map-genre-'+GenreID+'.html';
}
function SB_smilie(smilecode) {
	var CurrentMessage = document.getElementById('MPIII_ShoutMsg').value;
	var NewMessage = CurrentMessage+" "+smilecode+" ";
	document.getElementById('MPIII_ShoutMsg').value = NewMessage;
}
function updateShout(url, theFormName) {
	var shoutMessage = Form.Element.getValue('MPIII_ShoutMsg');	
	if(shoutMessage == "" || shoutMessage == null) {
		alert("You did not enter a message");
		return false;
	}
	new Ajax.Updater({ success: 'shoutbox_data', failure: 'shoutbox_data' }, url, {
		method:'post',
		parameters: Form.serialize(theFormName)
	});
	Form.Element.clear('MPIII_ShoutMsg');
}
function deleteShout(id) {
	new Ajax.Updater({ success: 'shoutbox_data', failure: 'shoutbox_data' }, 'shout_delete.php', {
		method:'get',
		parameters: '?id='+id
	});
}
function loadForumBlock(url) {
	new Ajax.Updater({ success: 'forumBlock', failure: 'forumBlock' }, 'ajax_forum.php', {
		method:'get'
	});
}
function updateNewest(genre) {
	new Ajax.Updater({ success: 'newestBlock', failure: 'newestBlock' }, 'ajax_newest.php', {
		method:'post',
		parameters: '?genre='+genre
	});
}
function updateLatest(genre) {
	new Ajax.Updater({ success: 'latestBlock', failure: 'latestBlock' }, 'ajax_latest.php', {
		method:'post',
		parameters: '?genre='+genre
	});
}
function SiteSearch() {
	MPIIISearchForm = $('MPIII_SearchForm');
	var MPIIISearchType = Form.Element.getValue('MPIII_SearchType');
	var MPIIISearchText = Form.Element.getValue('search_keywords');
	if(MPIIISearchText.length < 3) {
		alert("Search word needs to be more than 3 characters");
		return false;
	}
	if(MPIIISearchType == "all") {
		MPIIISearchForm.action='search.php';
	} else if(MPIIISearchType == "downloads") {
		MPIIISearchForm.action='search_downloads.php';
	} else if(MPIIISearchType == "bios") {
		MPIIISearchForm.action='search_bios.php';
	} else if(MPIIISearchType == "news") {
		MPIIISearchForm.action='search_news.php';
	} else if(MPIIISearchType == "faq") {
		MPIIISearchForm.action='search_faq.php';	
	} else if(MPIIISearchType == "forum") {
		MPIIISearchForm.action='/mpiiiforum/search.php';
	} else if(MPIIISearchType == "reviews") {
		MPIIISearchForm.action='search_reviews.php';
	} else if(MPIIISearchType == "members") {
		MPIIISearchForm.action='search_members.php';
	} else if(MPIIISearchType == "tracks") {
		MPIIISearchForm.action='search_tracks.php';
	} else if(MPIIISearchType == "beatport") {
		MPIIISearchForm.action='beatport.php';
	}
	return true;
}
