var badge1w = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge1w.png" width="234" height="60" border="0"></img></a>';
var badge1g = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge1g.png" width="234" height="60" border="0"></img></a>';
var badge1b = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge1b.png" width="234" height="60" border="0"></img></a>';

var badge2w = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge2w.png" width="200" height="60" border="0"></img></a>';
var badge2g = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge2g.png" width="200" height="60" border="0"></img></a>';
var badge2b = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge2b.png" width="200" height="60" border="0"></img></a>';

var badge3w = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge3w.png" width="175" height="45" border="0"></img></a>';
var badge3g = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge3g.png" width="175" height="45" border="0"></img></a>';
var badge3b = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge3b.png" width="175" height="45" border="0"></img></a>';

var badge4w = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge4w.png" width="150" height="45" border="0"></img></a>';
var badge4g = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge4g.png" width="150" height="45" border="0"></img></a>';
var badge4b = '<a href="http://huckabeemomentum.com/pledges.htm"><img alt="Pledge for Huckabee" src="http://huckabeemomentum.com/public/badge4b.png" width="150" height="45" border="0"></img></a>';

var goldcode1 = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Gold Medal Volunteer" src="http://huckabeemomentum.com/public/gold1.png" width="150" height="150" border="0"></img></a>';
var goldcode2 = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Gold Medal Volunteer" src="http://huckabeemomentum.com/public/gold2.png" width="120" height="120" border="0"></img></a>';


function browserWorkarounds() {

	document.getElementById('badgesizelist').selectedIndex = 0;
	document.getElementById('medalsizelist').selectedIndex = 0;
	document.getElementById('badgecode').value = "(Click on an image below to generate your code)";
	document.getElementById('medalcode').value = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Bronze Medal Volunteer" src="http://huckabeemomentum.com/public/bronze1.png" width="150" height="150" border="0"></img></a>';
	
	for (n = 0; n < document.forms[1].length; n += 1) {	document.forms[1].elements[n].checked = false; }

}

function changeCode(imgcode) {

	document.getElementById("badgecode").value = imgcode;

}

function goldCode(goldcode) {

	document.getElementById("medalcode").value = goldcode;

}

function hofappWindow() {

    var appwinv = window.open("hofapp.php", "appwin", "scrollbars=yes,menubar=no,resizable=1,location=no,screenX=50,screenY=100,width=800,height=600");

    appwinv.focus();
	
}

function shareWebsite() {

    var sharewinv = window.open("share/default.php", "sharewin", "scrollbars=yes,menubar=no,resizable=1,location=no,screenX=50,screenY=100,width=800,height=600");

    sharewinv.focus();

}

function changeMedal(size) {

	var bronze1code = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Bronze Medal Volunteer" src="http://huckabeemomentum.com/public/bronze1.png" width="150" height="150" border="0"></img></a>';
	var bronze2code = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Bronze Medal Volunteer" src="http://huckabeemomentum.com/public/bronze2.png" width="120" height="120" border="0"></img></a>';
	var silver1code = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Silver Medal Volunteer" src="http://huckabeemomentum.com/public/silver1.png" width="150" height="150" border="0"></img></a>';
	var silver2code = '<a href="http://huckabeemomentum.com/medals.htm"><img alt="Silver Medal Volunteer" src="http://huckabeemomentum.com/public/silver2.png" width="120" height="120" border="0"></img></a>';
	var gold1code = 'To obtain a customized gold volunteer medal baring your own initials and date of completion, send an email to the administrator with that information:\n\nadmin@huckabeemomentum.com\n\nIf you own a copy of photoshop, you are welcome to download the project files and do this yourself.\n\nOtherwise, you can also use the generic gold volunteer medal shown below. Just click on it.';
	var gold2code = 'To obtain a customized gold volunteer medal baring your own initials and date of completion, send an email to the administrator with that information:\n\nadmin@huckabeemomentum.com\n\nIf you own a copy of photoshop, you are welcome to download the project files and do this yourself.\n\nOtherwise, you can also use the generic gold volunteer medal shown below. Just click on it.';


	var bronze1 = "<img alt='Bronze (Large)' src='images/bronze1.png' style='width:150px;height:150px;border:0px;'></img>";
	var bronze2 = "<img alt='Bronze (Small)' src='images/bronze2.png' style='width:120px;height:120px;border:0px;'></img>";
	var silver1 = "<img alt='Silver (Large)' src='images/silver1.png' style='width:150px;height:150px;border:0px;'></img>";
	var sliver2 = "<img alt='Silver (Small)' src='images/silver2.png' style='width:120px;height:120px;border:0px;'></img>";
	var gold1 = "<img alt='Gold (Large)' src='images/gold1.png' style='width:150px;height:150px;border:0px;' onclick='goldCode(goldcode1)'></img>";
	var gold2 = "<img alt='Gold (Small)' src='images/gold2.png' style='width:120px;height:120px;border:0px;' onclick='goldCode(goldcode2)'></img>";

	if (size == "bronzelarge") {

			document.getElementById("medalimage").innerHTML = bronze1;
			document.getElementById("medalcode").value = bronze1code;
		}

	if (size == "bronzesmall") {

			document.getElementById("medalimage").innerHTML = bronze2;
			document.getElementById("medalcode").value = bronze2code;
		}

	if (size == "silverlarge") {

			document.getElementById("medalimage").innerHTML = silver1;
			document.getElementById("medalcode").value = silver1code;
		}

	if (size == "silversmall") {

			document.getElementById("medalimage").innerHTML = sliver2;
			document.getElementById("medalcode").value = silver2code;
		}

	if (size == "goldlarge") {

			document.getElementById("medalimage").innerHTML = gold1;
			document.getElementById("medalcode").value = gold1code;
		}

	if (size == "goldsmall") {

			document.getElementById("medalimage").innerHTML = gold2;
			document.getElementById("medalcode").value = gold2code;
		}
			
}

function changeImages(sizes) {

	var badge1 = "<img alt='Badge (White)' src='images/badge1w.png' style='width:234px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge1w)'><br /></img><img alt='Badge (Gray)' src='images/badge1g.png' style='width:234px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge1g)'><br /></img><img alt='Badge (Black)' src='images/badge1b.png' style='width:234px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge1b)'></img>";
	var badge2 = "<img alt='Badge (White)' src='images/badge2w.png' style='width:200px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge2w)'><br /></img><img alt='Badge (Gray)' src='images/badge2g.png' style='width:200px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge2g)'><br /></img><img alt='Badge (Black)' src='images/badge2b.png' style='width:200px;height:60px;border:0px;cursor:pointer;' onClick='changeCode(badge2b)'></img>";
	var badge3 = "<img alt='Badge (White)' src='images/badge3w.png' style='width:175px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge3w)'><br /></img><img alt='Badge (Gray)' src='images/badge3g.png' style='width:175px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge3g)'><br /></img><img alt='Badge (Black)' src='images/badge3b.png' style='width:175px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge3b)'></img>";
	var badge4 = "<img alt='Badge (White)' src='images/badge4w.png' style='width:150px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge4w)'><br /></img><img alt='Badge (Gray)' src='images/badge4g.png' style='width:150px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge4g)'><br /></img><img alt='Badge (Black)' src='images/badge4b.png' style='width:150px;height:45px;border:0px;cursor:pointer;' onClick='changeCode(badge4b)'></img>";

	if (sizes == "largelong") {

			document.getElementById("badgeimages").innerHTML = badge1;
		}

	if (sizes == "largeshort") {

			document.getElementById("badgeimages").innerHTML = badge2;
		}

	if (sizes == "smalllong") {

			document.getElementById("badgeimages").innerHTML = badge3;
		}
	
	if (sizes == "smallshort") {

			document.getElementById("badgeimages").innerHTML = badge4;
		}
	
	document.getElementById("badgecode").value = "(Click on an image below to generate your code)";
	
}

function toggleDisplay(toggleid, imgobj, offimg, onimg) {

	if (document.getElementById(toggleid).style.display != "none") {
	

				document.getElementById(toggleid).style.display = "none";
				document.getElementById(imgobj).src = "images/" + offimg;

		} else {
		
				document.getElementById(toggleid).style.display = "block";
				document.getElementById(imgobj).src = "images/" + onimg;
			}

}

function computeCredits(credits, checkstatus) {
	
	if (checkstatus == true) {
		
			var content = document.getElementById("selectedcredits").innerHTML;
			var contentnumber = parseInt(content);
			var morecredits = parseInt(credits);
			var newcontent = contentnumber + morecredits;
			document.getElementById("selectedcredits").innerHTML = newcontent;
		}
	
	if (checkstatus == false) {
		
			var content = document.getElementById("selectedcredits").innerHTML;
			var contentnumber = parseInt(content);
			var lesscredits = parseInt(credits);
			var newcontent = contentnumber - lesscredits;
			if (newcontent < 0) { newcontent = 0; }
			document.getElementById("selectedcredits").innerHTML = newcontent;
		}
}