var selectedImageId = null;
var selectedImageSrc = null;

function main () {
	document.location.href = "index.php";
}

function selectLetter (letter) {
	document.location.href = "index.php?letter=" + letter;
}

function vote () {
	if (document.forms[0].option_id.value != "")
		document.forms[0].submit();
}

function forum () {
	window.open ("forum", "votenation_forum").focus ();
	return false;
}

function readMore () {
	wnd = window.open ("read_more.php", "votenation_read_more").focus ();
	return false;
}

function results () {
	document.location.href = "result.php";
}

function voteAgain () {
	document.location.href = "index.php";
}

function selectImage (id, newImageSrc) {
	if (selectedImageId != null)
		document.getElementById (selectedImageId).src = selectedImageSrc;

	selectedImageId = id;
	selectedImageSrc = document.getElementById (selectedImageId).src;
	document.getElementById (selectedImageId).src = newImageSrc;
	
}
function like (option_id) {
	document.forms[0].option_id.value = option_id;
	document.forms[0].vote.value = "like";
	selectImage("l_" + option_id, "images/like_on.gif");
	document.getElementById ("entered").focus ();
}

function dislike (option_id) {
	document.forms[0].option_id.value = option_id;
	document.forms[0].vote.value = "dislike";
	selectImage("d_" + option_id, "images/dislike_on.gif");
	document.getElementById ("entered").focus ();
}

function showAll () {
	document.location.href = "result.php?show=all";
}

function recent () {
	document.location.href = "index.php?mod=recent";
}

function showAll2 () {
	document.location.href = "bvcresults.php?show=all";
}

function bvcresults () {
	document.location.href = "bvcresults.php";
}