function open_it(id)
{
	if (document.getElementById)
	{
		var id2=id+"img";
		if(document.getElementById(id).style.display == 'none')
		{
      		document.getElementById(id).style.display = 'block';
			document.getElementById(id2).src="/tema/puls_dettaglio3.png";
    	}
		else
		{
      		document.getElementById(id).style.display = 'none';
			document.getElementById(id2).src="/tema/puls_dettaglio2.png";
    	}
  	}
	
}

function open_it_chat(id)
{
	if (document.getElementById)
	{
		if(document.getElementById(id).style.display == 'none')
		{
			document.getElementById(id).style.display = 'block';
		}
		else
		{
			document.getElementById(id).style.display = 'none';
		}
	}
}

function cambia_razza(razza, sesso, url)
{
	if(sesso=="0") sesso="m";
	if(sesso=="1") sesso="f";
	var lunghezza = 0;
	tipo = new Array();
	
	if(razza=="BloodElf")
	{
		lunghezza=7;
		tipo[0] = "Hunter";
		tipo[1] = "Mago";
		tipo[2] = "Paladino";
		tipo[3] = "Prete";
		tipo[4] = "Rouge";
		tipo[5] = "Warlock";
		tipo[6] = "DeathKnight";
	}
	if(razza=="Draenei")
	{
		lunghezza=7;
		tipo[0] = "Hunter";
		tipo[1] = "Mago";
		tipo[2] = "Paladino";
		tipo[3] = "Prete";
		tipo[4] = "Shamano";
		tipo[5] = "Warrior";
		tipo[6] = "DeathKnight";
	}
	if(razza=="Dwarf")
	{
		lunghezza=6;
		tipo[0] = "Hunter";
		tipo[1] = "Paladino";
		tipo[2] = "Prete";
		tipo[3] = "Rouge";
		tipo[4] = "Warrior";
		tipo[5] = "DeathKnight";
	}
	if(razza=="Gnome")
	{
		lunghezza=5;
		tipo[0] = "Mago";
		tipo[1] = "Rouge";
		tipo[2] = "Warlock";
		tipo[3] = "Warrior";
		tipo[4] = "DeathKnight";
	}
	if(razza=="Human")
	{
		lunghezza=7;
		tipo[0] = "Mago";
		tipo[1] = "Paladino";
		tipo[2] = "Prete";
		tipo[3] = "Rouge";
		tipo[4] = "Warlock";
		tipo[5] = "Warrior";
		tipo[6] = "DeathKnight";
	}
	if(razza=="NightElf")
	{
		lunghezza=6;
		tipo[0] = "Druido";
		tipo[1] = "Hunter";		
		tipo[2] = "Prete";
		tipo[3] = "Rouge";
		tipo[4] = "Warrior";
		tipo[5] = "DeathKnight";
	}
	if(razza=="Orc")
	{
		lunghezza=6;
		tipo[0] = "Hunter";
		tipo[1] = "Rouge";
		tipo[2] = "Shamano";
		tipo[3] = "Warlock";
		tipo[4] = "Warrior";
		tipo[5] = "DeathKnight";
	}
	if(razza=="Tauren")
	{
		lunghezza=5;
		tipo[0] = "Druido";
		tipo[1] = "Hunter";	
		tipo[2] = "Shamano";
		tipo[3] = "Warrior";
		tipo[4] = "DeathKnight";
	}
	if(razza=="Troll")
	{
		lunghezza=7;
		tipo[0] = "Hunter";
		tipo[1] = "Mago";
		tipo[2] = "Prete";
		tipo[3] = "Rouge";
		tipo[4] = "Shamano";
		tipo[5] = "Warrior";
		tipo[6] = "DeathKnight";
	}
	if(razza=="Undead")
	{
		lunghezza=6;
		tipo[0] = "Mago";
		tipo[1] = "Prete";
		tipo[2] = "Rouge";
		tipo[3] = "Warlock";
		tipo[4] = "Warrior";
		tipo[5] = "DeathKnight";
	}
	
	path = url + "/tema/avatar/" + sesso + "/" + razza + "/";
	while (lunghezza < document.form_iscrizione.tipo.options.length)
	{
		document.form_iscrizione.tipo.options[(document.form_iscrizione.tipo.options.length - 1)] = null;
	}
	
	for(var i=0; i<lunghezza; i++)
	{
		document.form_iscrizione.tipo.options[i] = new Option(tipo[i]);
		document.form_iscrizione.tipo.options[i].value = path + tipo[i] + ".gif";
	}
}



function cambia_avatar()
{
	document.form_iscrizione.img_avatar.src = document.form_iscrizione.tipo.options[document.form_iscrizione.tipo.selectedIndex].value;
	document.form_iscrizione.url_avatar.value=document.form_iscrizione.tipo.options[document.form_iscrizione.tipo.selectedIndex].value;
}


function cambia_avatar_gm(razza, url)
{
	path = url + "/tema/avatar/gm/" + razza + ".jpg";
	document.form_iscrizione.img_avatar.src = path;
	document.form_iscrizione.url_avatar.value=path;
}