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 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 topvideo3(videourl,base)
		{
			var l_aukstis = 500 + 20;		// lango aukstis
			var l_plotis = 400 + 20;		// lango plotis
			var winl = screen.width/2-l_plotis/2;
			var wint = screen.height/2-l_aukstis/2;
			var newWindow = window.open(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 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 {
				
			}

	}
	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 submenu(id) {
		if (  document.getElementById(id).style.display == 'none' ) {
			document.getElementById(id).style.display = '';
			
		} else {
			document.getElementById(id).style.display = 'none';
		}
		
	}
	// Skalbimu tab perjungimas
	var oldtab_id = Number(10);
	oldtab_id = 'tab_01';
	
	function tabselect(id) {
		if ( oldtab_id!=0 ){
			document.getElementById(oldtab_id).style.borderBottom = '0px';
			document.getElementById(oldtab_id+'_layer').style.display = 'none';
		}
		document.getElementById(id).style.borderBottom = '1px solid #fff';
		document.getElementById(id+'_layer').style.display = '';
		oldtab_id = id;
	}
	//=======================
	
	// Naujienu Tab perjingims
	var oldnewstab_id = Number(10);
	oldnewstab_id = 'n_tab_01';
	
	function news_tabselect(id) {
		if ( oldnewstab_id!=0 ){
			document.getElementById(oldnewstab_id).style.borderBottom = '0px';
			document.getElementById(oldnewstab_id+'_layer').style.display = 'none';
		}
		document.getElementById(id).style.borderBottom = '1px solid #fff';
		document.getElementById(id+'_layer').style.display = '';
		oldnewstab_id = id;
	}
	//========================
	
	function badmessage(id) {
			if (confirm("Ar tikrai komentaras netinkamas?")) {
					document.getElementById('bad').value=id;
					document.getElementById('bad_coment').submit();
			} else {
				
			}

	}
	
	<!-- Begin TIme funciot
	var timerID = null;
	var timerRunning = false;
	function stopclock (){
	if(timerRunning)
	clearTimeout(timerID);
	timerRunning = false;
	}
	function showtime () {
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()
	var timeValue = "" + ((hours >12) ? hours :hours)
	if (timeValue == "0") timeValue = 0;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	//timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	timeValue += (hours >= 12) ? " " : " "
	//document.clock.face.value = timeValue;//data_container
	document.getElementById('time_now').innerHTML = timeValue;
	timerID = setTimeout("showtime()",1000);
	timerRunning = true;
	}
	function startclock() {
	stopclock();
	showtime();
	}
	// End -->
	
	var skelbimai_text = '';
	function symbols_max() {
			len = document.getElementById('text').value.length;
			document.getElementById('count_chars').innerHTML=len;
			if ( len>149 ) {
				document.getElementById('text').value = skelbimai_text;
			} else {
				skelbimai_text	= document.getElementById('text').value;
			}
	}
	
// AJAX FUNCTIONS
	
var old_id = Number(10);
var prev_id = Number(10);
var image_number = Number(100);
old_id=0;
image_number=1;

function pasiulymai() {
		
		document.getElementById('loading_image').style.display = '';
		document.getElementById('pasiulymai_din').className = 'loading_block_02'; 
	
	xmlHttp=createXmlHttpRequestObject();
	
	if (xmlHttp==null)
	{
		alert ("Narykle nepalaiko HTTP Request / Pasirinkimas neimanomas");
		return;
	} 
	var url="act/ajax.php";
	
	xmlHttp.onreadystatechange=function()
		{
			
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
				
				
				if ( xmlHttp.responseText!=='undefined' ) {
					
					var act_response = xmlHttp.responseText.split(':::');
					
						document.getElementById('pasiulymai_din').innerHTML = act_response[1];
						
						if ( document.getElementById('pasiulymai_din').innerHTML == 'undefined' ) {
							pasiulymai();
						}
						document.getElementById('loading_image').style.display = 'none';
						document.getElementById('pasiulymai_din').className = 'partneriai_block_context'; 
					
				} else {
					xmlHttp.open("POST",url,true);
				}
				
			}
		}
	xmlHttp.open("POST",url,true);
	
	
	parameters = '';
	
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", parameters.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(parameters);
	
	setTimeout('pasiulymai()',30000);
	
}
// AJAX FUNCTIONS