// JavaScript Document
function loadPreview(url){ 
	load = document.getElementById("preview");
	
	image = document.createElement("img");
	image.setAttribute("id", "loadPhoto");
	image.setAttribute("src", url);
	image.setAttribute("border", "1");
	
	load.appendChild(image);
	
}

function unloadPreview(){ 
	load = document.getElementById("preview");
	img = document.getElementById("loadPhoto");
	load.removeChild(img);
}


function sendVoteR11_Left(){ 
	var option_A = document.getElementById("R11_Left_A");
	var option_B = document.getElementById("R11_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR12_Left(){ 
	var option_A = document.getElementById("R12_Left_A");
	var option_B = document.getElementById("R12_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R12_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R12_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR13_Left(){ 
	var option_A = document.getElementById("R13_Left_A");
	var option_B = document.getElementById("R13_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R13_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R13_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR14_Left(){ 
	var option_A = document.getElementById("R14_Left_A");
	var option_B = document.getElementById("R14_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R14_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R14_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR11_Right(){ 
	var option_A = document.getElementById("R11_Right_A");
	var option_B = document.getElementById("R11_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR12_Right(){ 
	var option_A = document.getElementById("R12_Right_A");
	var option_B = document.getElementById("R12_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R12_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R12_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR13_Right(){ 
	var option_A = document.getElementById("R13_Right_A");
	var option_B = document.getElementById("R13_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R13_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R13_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteR14_Right(){ 
	var option_A = document.getElementById("R14_Right_A");
	var option_B = document.getElementById("R14_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=R14_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=R14_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteQ11_Left(){ 
	var option_A = document.getElementById("Q11_Left_A");
	var option_B = document.getElementById("Q11_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=Q11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=Q11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteQ12_Left(){ 
	var option_A = document.getElementById("Q12_Left_A");
	var option_B = document.getElementById("Q12_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=Q12_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=Q12_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteQ11_Right(){ 
	var option_A = document.getElementById("Q11_Right_A");
	var option_B = document.getElementById("Q11_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=Q11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=Q11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteQ12_Right(){ 
	var option_A = document.getElementById("Q12_Right_A");
	var option_B = document.getElementById("Q12_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=Q12_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=Q12_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteS11_Left(){ 
	var option_A = document.getElementById("S11_Left_A");
	var option_B = document.getElementById("S11_Left_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=S11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=S11_Left&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteS11_Right(){ 
	var option_A = document.getElementById("S11_Right_A");
	var option_B = document.getElementById("S11_Right_B");
	
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
	
	var url = "php/validateVote.php?round=S11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=S11_Right&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

function sendVoteFinal(){ 
	var option_A = document.getElementById("Final_A");
	var option_B = document.getElementById("Final_B");
		
	if(option_A.checked && option_B.checked){
		alert("You can only select one photo by game...");
		return;
	}
	
	if(!option_A.checked && !option_B.checked){
		alert("You have to select one photo by game...");
		return;
	}
		
	var url = "php/validateVote.php?round=Final&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
	document.location = "php/validateVote.php?round=Final&option_A=" + option_A.checked + "&option_B=" + option_B.checked + "";
}

