

function tsstatusconnect(host, port, channel, pass)
{
	var command = "ts3server://" + host + "/?port=" + port;
	var nick = document.getElementById("tsstatusNick").value;
	
	if(nick != "")
	{
		command += "&nickname=" + nick;
		var dateExpire = new Date;
		dateExpire.setMonth(dateExpire.getMonth()+1);
		document.cookie = escape("tsstatus_" + host) + "=" + escape(nick) + "; expires=" + dateExpire.toGMTString();
	}
	
	if(pass != "")
	{
		command += "&password=" + pass;
	}
	
	if(channel != undefined)
	{
		command += "&channel=" + channel;
	}

	var popup = window.open(command);
	popup.close();
}

