function showDetails(id,intCols){
	if(document.getElementById('charDetails' + id)){
		
		if(document.getElementById('displayed').value==id){
			document.getElementById('displayed').value ='0';
			document.getElementById('charDetails' + id).style.display = 'none';
//			document.getElementById('charDetailsRow' + id).style.display = 'none';
		} else {
		
			document.getElementById('roster').style.cursor = 'wait';
			
			if(document.getElementById('charDetails' + document.getElementById('displayed').value)){
				document.getElementById('charDetails' + document.getElementById('displayed').value).style.display = 'none';
//				document.getElementById('charDetailsRow' + document.getElementById('displayed').value).style.display = 'none';
			}
			
			writePage('/DDO/Custom3/Modules/Roster2/RenderCharDetails.asp?location=charDetailsRow' + id + '&intCols=' + intCols);
			
//			document.getElementById('charDetails' + id).style.display = 'table-row';
//			document.getElementById('charDetailsRow' + id).style.display = 'table-row';
			document.getElementById('displayed').value = id;
			
		}
	} else {
		alert(id);
	}
	
}

function dChar(id){
	if(confirm("Are you sure you want to delete this character?")){
		document.getElementById('deleteChar').value = id;
		return true;
	} else {
		window.event.returnValue = false;
		return false;
	}
}

function dHidden(){
	if(confirm("Are you sure you want to delete all hidden values? This cannot be undone.")){
		return true;
	} else {
		window.event.returnValue = false;
		return false;
	}
}

function checkGameId(id){
	if(id==''){
		alert("Please choose a game from above to add your character to first!");
		window.event.returnValue = false;
		return false;
	}
}

function setGameId(id){
	document.getElementById('game').value = id;
}

function removeMedal(id){
	var strMedals = '';
	var arrMedals;
	
	if(document.getElementById('currentMedals')){
		if(confirm('Do you wish to remove this medal?')){
		
			arrMedals = document.getElementById('currentMedals').value.split(",");
			for(var i=0; i < arrMedals.length; i++){
				if(arrMedals[i] != id){
					if(strMedals!=''){
						strMedals = strMedals + ',' + arrMedals[i];
					} else {
						strMedals = arrMedals[i];
					}
				}
			}
				
			document.getElementById('currentMedals').value = strMedals;
			document.getElementById('medal'+id).src = '';
			document.getElementById('medal'+id).name = '';

		}
	}
}
