function afficherperso(X,Y,Pseudo,Camp,Compagnie,Matricule,Grade,VS,Arme,Pamax,Message,Id,tims ,pv, jourtour, debtour, fintour)
{
 with(document.details)
 {
  Name.value=Pseudo
  Weapon.value=Arme
  Rank.value=Grade
  TVS.value=VS
  MaxArmor.value=Pamax
  idperso.value=Id
  adate.value=tims
  number.value=Matricule
  matr.value=Camp+'-'+Compagnie+'-'+Matricule
  Position.value=X+'/'+Y
  
  PVMax.value=pv
  DateTour.value=jourtour
  TourDeb.value=debtour
  TourFin.value=fintour
 }
}
function afficheritem(X,Y,Pseudo,Arme)
{
 with(document.details)
 {
  Name.value=Pseudo
  Weapon.value=Arme
  Rank.value=''
  TVS.value=''
  MaxArmor.value=''
  idperso.value=''
  adate.value=''
  number.value=''
  matr.value=''
  Position.value=X+'/'+Y
 }
}
function expMenu(id) 
{
 var itm = null;
 if (document.getElementById) { itm = document.getElementById(id); } 
 else if (document.all) { itm = document.all[id]; }
 else if (document.layers) { itm = document.layers[id]; }

 if (!itm) { /* do nothing */ }
 else if (itm.style) {
  if (itm.style.display == "none") { itm.style.display = ""; }
  else { itm.style.display = "none"; }
 }
 else { itm.visibility = "show"; }
}
function copie()
{  //pseudo (matricule) camou en X/Y, PAMAX, le ....
 if (document.details.number.value !='')
 {
  with(document.details) { 	if(TourDeb.value!='')
							copinfos = Name.value+' ('+matr.value+') '+TVS.value+' VS, '+Weapon.value+', en '+Position.value+', '+MaxArmor.value+' PA Max, le '+ adate.value+', '+PVMax.value+' PV Min, regen le '+DateTour.value+' entre '+TourDeb.value+' et '+TourFin.value+' [url=http://www.combattre-ou-mourir.com/fiche.php?page=2&id=' + number.value + ']voir fiche[/url]';
							else
							copinfos = Name.value+' ('+matr.value+') '+TVS.value+' VS, '+Weapon.value+', en '+Position.value+', '+MaxArmor.value+' PA Max, le '+ adate.value+', '+PVMax.value+' PV Min'+' [url=http://www.combattre-ou-mourir.com/fiche.php?page=2&id=' + number.value + ']voir fiche[/url]';}
  temp = prompt( "Copiez manuellement les infos ci-dessous pour les stocker dans le presse-papier", copinfos );
  return false;
 }
 else { alert('Vous devez cliquer sur un perso pour pouvoir copier les infos qui lui correspondent!'); }
}
function soinssub()
{
 document.REPLIER.submit();
}

function lkopy(linkcy)
{
 temp = prompt( "Copiez manuellement les informations ci-dessous pour les stocker dans le presse-papier", linkcy );
}
function fantome(arg)
{
 window.open("fantome.php?act="+arg,"Fantôme",'width=400,height=300,scrollbars=1');
}

function masseSac()
{
	tdNode = document.getElementById('masseSac');
	
	while(tdNode.hasChildNodes())
		tdNode.removeChild(tdNode.firstChild);
		
	textAreaNode = document.createElement('textarea');
	
	listeSac = '';
	tabId = new Array();
	for(i in newListe['A'])
	{
		if(tabId[newListe['A'][i]] != '1')
		{
			listeSac += i + '\n';
			tabId[newListe['A'][i]] = '1';
		}
	}
	textAreaNode.value = listeSac;
	textAreaNode.rows = "1";
	textAreaNode.cols = "6";
	textAreaNode.id = "listeSac";
	tdNode.appendChild(textAreaNode);
	textAreaNode.focus();
	textAreaNode.select();
}

function openFiche(camp)
{
	formNode = document.getElementById("openFiche");
	param1 = document.getElementById("param1");
	param2 = document.getElementById("param2");
	last = '';
	
	for(i in newListe[camp])
	{
		if(last != '')
		{
			formNode.action = 'http://pof001.free.fr/com/etat.php';
			param1.name = 'un';
			param1.value = last;
			param2.name = 'deux';
			param2.value = i;
			formNode.submit();
			last = '';
		}
		else
			last = i;
	}

	if(last != '')
	{
		formNode.action = 'http://www.combattre-ou-mourir.com/fiche.php';
		param1.name = 'page';
		param1.value = 2;
		param2.name = 'id';
		param2.value = last;
		formNode.submit();
	}
	
}

function openEnnemi()
{
	openFiche('L');
	openFiche('E');
}
