	function topimg(l_plotis,l_aukstis,imgurl,base)
	{
		var l_aukstis2 = l_aukstis + 20;		// lango aukstis
		var l_plotis2 = l_plotis + 20;			// lango plotis
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var n = Math.random();
		var newWindow = window.open(''+base+'inc/topimg.php?'+imgurl+'..','I','height='+l_aukstis2+',width='+l_plotis2+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topprod(l_plotis,l_aukstis,imgurl,base)
	{
		var l_aukstis2 = l_aukstis;		// lango aukstis
		var l_plotis2 = l_plotis;			// lango plotis
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var n = Math.random();
		var newWindow = window.open(''+base+'inc/topprod.php?'+imgurl+'..','P','height='+l_aukstis2+',width='+l_plotis2+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topvideo(videourl,base)
		{
			var l_aukstis = 240 + 80;		// lango aukstis
			var l_plotis = 320 + 20;		// lango plotis
			var winl = screen.width/2-l_plotis/2;
			var wint = screen.height/2-l_aukstis/2;
			var newWindow = window.open('http://www.kvadratu.lt/inc/topvideo.php?video='+videourl,'0','height='+l_aukstis+',width='+l_plotis+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topvideo2(videourl,base)
		{
			var l_aukstis = 240 + 101;		// lango aukstis
			var l_plotis = 320 + 20;		// lango plotis
			var winl = screen.width/2-l_plotis/2;
			var wint = screen.height/2-l_aukstis/2;
			var newWindow = window.open('http://www.kvadratu.lt/inc/topvideo2.php?video='+videourl,'0','height='+l_aukstis+',width='+l_plotis+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topvideo3(videourl,base)
		{
			var l_aukstis = 240 + 101;		// lango aukstis
			var l_plotis = 320 + 20;		// lango plotis
			var winl = screen.width/2-l_plotis/2;
			var wint = screen.height/2-l_aukstis/2;
			var newWindow = window.open('http://www.kvadratu.lt/inc/topvideo3.php?video='+videourl,'0','height='+l_aukstis+',width='+l_plotis+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topaudio(audiourl,base)
	{
		var l_aukstis = 30 + 10;		// lango aukstis
		var l_plotis = 210 + 10;		// lango plotis
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var n = Math.random();
		var newWindow = window.open(''+base+'inc/topaudio.php?'+audiourl+'..','I','height='+l_aukstis+',width='+l_plotis+',top='+wint+',left='+winl+',  buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no');
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function topimgx(l_plotis,l_aukstis,imgurl,title,base)
	{
		var l_aukstis2 = l_aukstis + 20;		// lango aukstis
		var l_plotis2 = l_plotis + 20;			// lango plotis
		if (title!=true) { var title2 = (Math.round((Math.random()*999)+1)); }	else { var title2="mg"; }
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var newWindow = window.open(" "+base+"inc/topimg.php?image="+imgurl+"&title="+title+"","","height="+l_aukstis+",width="+l_plotis+",top="+wint+",left="+winl+", buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no, titlebar=no");
	}
	function topimgx_news(l_plotis,l_aukstis,imgurl,title,base)
	{
		var l_aukstis2 = l_aukstis + 20;		// lango aukstis
		var l_plotis2 = l_plotis + 20;			// lango plotis
		if (title!=true) { var title2 = (Math.round((Math.random()*999)+1)); }	else { var title2="mg"; }
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var newWindow = window.open("/inc/topimg_news.php?image="+imgurl+"&title="+title+"","","height="+l_aukstis+",width="+l_plotis+",top="+wint+",left="+winl+", buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no, titlebar=no");
	}
	function topimgx_news2(l_plotis,l_aukstis,imgurl,title,base)
	{
		var l_aukstis2 = l_aukstis + 20;		// lango aukstis
		var l_plotis2 = l_plotis + 20;			// lango plotis
		if (title!=true) { var title2 = (Math.round((Math.random()*999)+1)); }	else { var title2="mg"; }
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var newWindow = window.open("/inc/topimg_news_02.php?image="+imgurl+"&title="+title+"","","height="+l_aukstis+",width="+l_plotis+",top="+wint+",left="+winl+", buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no, titlebar=no");
	}
	/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
	function toppage(l_plotis,l_aukstis,id,base)
	{
		var winl = screen.width/2-l_plotis/2;
		var wint = screen.height/2-l_aukstis/2;
		var n = Math.random();
		var newWindow = window.open('http://'+top.location.host+'/inc/print.php?print='+id+'&b='+base,'P','height='+l_aukstis+',width='+l_plotis+',top='+wint+',left='+winl+', buttons=no, scrollbars=yes, location=yes, menubar=no, resizable=no, status=yes, directories=no, toolbar=no');
	}
	function setsmile(smiley)
	{
		document.getElementById('text').value+=smiley;
	}
	function replay_message(replay)
	{
		document.getElementById('text').value+=":replay:"+replay+":replay:";
	}
	
	function badmessage(id) {
			if (confirm("Ar tikrai komentaras netinkamas?")) {
					document.getElementById('bad').value=id;
					document.getElementById('bad_coment').submit();
			} else {
				
			}

	}