function SetCResolution(cookieValue)
{
    var cookieName = "VBResolution";
    var today = new Date();
    var expire = new Date();
 
    expire.setTime(today.getTime() + 3600000 * 24 * 360);
    document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}

function GetResolution(scr)
{
	var width, height;
	var nVer = navigator.appVersion;
	var nAgt = navigator.userAgent;
	var fullVersion  = 0;
	var url = "http://www.vilniausbustas.lt/";	
	
	if ((verOffset = nAgt.indexOf("MSIE")) != -1)
 	{		
  		fullVersion = parseFloat(nAgt.substring(verOffset + 5));		
	
		if (fullVersion > 6)
		{			
			width = window.screen.availWidth;
			height = window.screen.availHeight;
		}
		else
		{
			width = screen.width;
  			height = screen.height;
		}
 	}
	else
	{
  		width = screen.width;
  		height = screen.height;
	}

  	if (scr == 0)
  	{
		if ((width == 800) && (height == 600))
			location.href = url + "index.php?scr=1";
		else
		{
			if ((width == 1024) && (height == 768))
				location.href = url + "index.php?scr=2";
			else
			{
				if ((width == 1152) && (height == 864))
					location.href = url + "index.php?scr=3";
				else
				{
					if ((width == 1280) && (height == 720))
						location.href = url + "index.php?scr=4";
					else
					{
						if ((width == 1280) && (height == 768))
							location.href = url + "index.php?scr=5";
						else
						{
							if ((width == 1280) && (height == 960))
								location.href = url + "index.php?scr=6";
							else
							{
								if ((width == 1280) && (height == 1024))
									location.href = url + "index.php?scr=7";
								else
								{
									if ((width == 1440) && (height == 900))
										location.href = url + "index.php?scr=8";
									else
										location.href = url + "index.php?scr=2";
								}
							}
						}
					}
		
				}
	  		}
		}
  	}
}

function MeniuFlats()
{						
	document.getElementById("meniu1").style.display = "none";
	document.getElementById("meniu33").style.display = "none";
	document.getElementById("meniu36").style.display = "none";
	document.getElementById("meniu31").style.display = "block";
}

function MeniuNewFlats()
{						
	document.getElementById("meniu1").style.display = "none";
	document.getElementById("meniu31").style.display = "none";
	document.getElementById("meniu33").style.display = "none";
	document.getElementById("meniu36").style.display = "block";
}

function MeniuFacilities()
{
	document.getElementById("meniu1").style.display = "none";
	document.getElementById("meniu31").style.display = "none";
	document.getElementById("meniu36").style.display = "none";
	document.getElementById("meniu33").style.display = "block";
}
					
function MeniuActive(id)
{
	var meniu = "meniu" + id;
	var lnk = "link" + id;
	
	if ((id == 31) || (id == 33) || (id == 36))
	{		
		document.getElementById("meniu1").style.display = "none";
		document.getElementById("meniu31").style.display = "none";	
		document.getElementById("meniu33").style.display = "none";
		document.getElementById("meniu36").style.display = "none";
		document.getElementById(meniu).style.display = "block";
	}		
	
	if ((id == 32) || (id == 34) || (id == 35))
	{
		if (document.all)  		
  			document.getElementById(lnk).setAttribute("className", "mitems"); 	
	}	
}

function win(page,nam,wid,hit)
{
	var  windo=eval('window.open("'+page+'","'+nam+'","status=no,toolbar=no,resizable=no,scrollbars=yes,menubar=no,width='+wid+',height='+hit+',top=10,left=10")');
}