var newwindow;

function poptastic(url)
{
	newwindow=window.open(url,'Popup','height=600,width=600');
	if (window.focus) {newwindow.focus()}
}

function loading()
{
 tab_height=document.getElementById('maintab').offsetHeight;
 win_height=document.documentElement.clientHeight; 
 
 createCookie('aukstis',tab_height,1)
 
 if (win_height > tab_height && tab_height>=779) height=win_height;
 else height=tab_height;
 
 
 margin=height-779; if (margin<0) margin=0;
 document.getElementById("left-bottom").style.marginTop=margin + "px";
 document.getElementById("right-bottom").style.marginTop=margin + "px";	
 document.getElementById("centerleft-bottom").style.marginTop=margin + "px";
}

function resizing()
{
 
 win_height=document.documentElement.clientHeight; 
 
 tab_height=readCookie('aukstis');
 //alert(tab_height);
 
 if (win_height > tab_height && tab_height>=779) height=win_height;
 else height=tab_height;
 
 
 margin=height-779; if (margin<0) margin=0;
 document.getElementById("left-bottom").style.marginTop=margin + "px";
 document.getElementById("right-bottom").style.marginTop=margin + "px";	
 document.getElementById("centerleft-bottom").style.marginTop=margin + "px";
}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
