//********************************************************
//**		Couleur des lignes tableau					**
//********************************************************
var select = 0;
var temp;


function transp(ligne)
{
	if (ligne.style.background!='red') ligne.style.background='transparent';
}

function lavend(ligne)
{
	if (ligne.style.background!='red') ligne.style.background='lavender';
}

function selec(ligne)
{
	if (!select)
	{	select = 1;
		ligne.style.background='red';
		temp = ligne;
	}
	else 
	{
		if (ligne.style.background=='red') 
		{	select = 0;
			ligne.style.background='transparent';
		}
		else
		{	temp.style.background='transparent';
			ligne.style.background='red';
			temp=ligne;
		}
	}
}

//********************************************************
//**		Connexion teamspeak     					**
//********************************************************
function ts2connect(ip, port)
{
	var commande = "teamspeak://"+ip+"?port="+port;
	var nick = document.getElementById("pseudo_ts2").value;
	
	if(nick != "")
	{
		commande += "&nickname="+nick;
		//if(channel != undefined)
		//{
		//	commande += "&channel="+channel;
		//}

		var popup = window.open(commande);
		popup.close();
	}
	else
	{
		alert("Merci de choisir un pseudo");
	}
}


function ts3connect(ip, port)
{
	var commande = "ts3server://"+ip+"?port="+port;
	var nick = document.getElementById("pseudo_ts3").value;
	
	if(nick != "")
	{
		commande += "&nickname="+nick;
		//if(channel != undefined)
		//{
		//	commande += "&channel="+channel;
		//}

		var popup = window.open(commande);
		popup.close();
	}
	else
	{
		alert("Merci de choisir un pseudo");
	}
}

// ***********************************************************
// ******************[ DEMANDE CONFIRMATION ]*****************
// ***********************************************************

// ###### => Cofirmation parti serveur <= ########################################################################################

function alerte_action_srv(num,message,service,action)
{
	if(confirm(message))
	{
		document.location.href='?service='+service+'&action='+action+'&sid='+num;
	}
	else
	{
	}
			
}

// ***********************************************************
// ******************[ OUVERTURE POPUP ]**********************
// ***********************************************************

function app(lien)
{
	window.open(lien,"LOG","menubar=no, resizable=yes, scrollbars=yes, statusbar=no, width=800, height=400");
}
