document.write('<style type="text/css">#newbie {display:none;}</style>');

var state;
var warLength;
var diploState;
var newbState;

function ChallengeNewbie() {
	if(newbState==1){
		document.getElementById('newbie').style.display = 'none';
		if(document.getElementById('warChestLine')){
			document.getElementById('warChestLine').style.display = 'none';
		}
		newbState = 0;
		document.getElementById("defender").selectedIndex = 0;
	}else{
		document.getElementById('newbie').style.display = 'block';
		newbState = 1;
		document.getElementById("defender").selectedIndex = document.getElementById("defender").length - 1;
	}
}

function allowBid(checkbox) {
	
	if(!checkbox.checked){
		document.getElementById('bidTimeSpan').style.display = 'none';
		document.getElementById('bidDisclaimer').style.visibility = 'hidden';
		state = 0;
	}else{
		document.getElementById('bidTimeSpan').style.display = 'inline';
		document.getElementById('bidDisclaimer').style.visibility = 'visible';
		state = 1;
	}
}

function retainDiplomacy(checkbox) {
	if(!checkbox.checked){
		document.getElementById('diplomaticSpan').style.display = 'none';
		diploState = 0;
	}else{
		document.getElementById('diplomaticSpan').style.display = 'inline';
		diploState = 1;
	}
}

/*function setWarLength(hours) {
	warLength = hours/24;
	if (warLength>7){warLength =7;}
	var optionList ="<option>(select length)</option>";
	for(var i=1; i<=warLength; i++){
		if(i!=1){var s="s";}else{s="";}
		optionList += "<option>"+i+" day"+s+"</option>";
	}
	document.getElementById('bidTime').innerHTML = optionList;

}*/