function LaunchChat(channel_id){
	var height = window.screen.height - 250 ;
	var width = window.screen.width - 250;
	
	if(typeof chatUrl === 'undefined'){
		chatUrl = "http://chat.beta.lt/";
	}
	
	return openCenteredWindow(chatUrl + "?channel_id=" + channel_id, "chatWin", width, height, false, false, 'menu=no')
}

function LoginPlease(){
	alert('Norint pasinaudoti šią galimybę prašome prisijungti!');
}

function startwin(url){
	var height = window.screen.height - 150;
	var width = window.screen.width - 150;
	var top = 50;
	var left = 50;
	
	if(!height || !width){
		height = 420;
		widht = 550;
		top = 50;
		left = 50;
	}
	var rnd = (Math.round((Math.random()*999)+1));
	return window.open(url, "blt" + rnd, "toolbar=no,status=no,menu=no,scrollbars=1,resizable=1,height=" + height + ",width=" + width + ",top=" + top + ",left=" + left);
}

	function LaunchWin(){
	var top = Math.round(window.screen.height) / 2 - 80;
	var left = Math.round(window.screen.width) / 2 - 150;

	if(!top || !left){
		top = 50;
		left = 50;
	}

	window.open("", "launcher_win", "toolbar=no,status=no,menu=no,scrollbars=1,resizable=1,height=160,width=300,top=" + top + ",left=" + left);
}


function Login(){
	var d = document.forms["login"];
	if(d.elements["login"].value && d.elements["pass"].value){
		d.submit();
		return true;
	}
	return false;
}

function OpenWin(file){
	window.open(file, "pic", "toolbar=no,status=no,menu=no,scrollbars=1,resizable=1,height=330,width=468,top=100,left=100");
	return false;
}

function OpenPopupWindow(url,width,height) {
	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	var winname = window.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
	return false;
}