function searchSubmit(){
	if( !document.searchFrm['cautare'].value.match(/^\d{15}$/) ){
		alert('Codul microcipului trebuie sa fie format din 15 cifre.');
		document.searchFrm['cautare'].focus();
		return false;
	}
	
	return true;
}

function getWindowHeight()
{
	if (window.innerHeight) { return window.innerHeight; }
 	if (document.body) { return document.body.clientHeight; }
}

function setFooter()
{
	if (!document.getElementById)
		return;
	var windowHeight = getWindowHeight();
	if (windowHeight <= 0) //no window :))
		return; 
	var contentHeight = document.getElementById('content').offsetHeight + 210; //210 == content.top
	var footerElement = document.getElementById('footer');
	var footerHeight  = footerElement.offsetHeight;
	var menuDiv = document.getElementById('menudiv');
	if (windowHeight - (contentHeight + footerHeight) >= 0) {
		footerElement.style.position = 'absolute';
		footerElement.style.top = (windowHeight - footerHeight) + 'px';
		
		menuDiv.style.height = (windowHeight + footerHeight) + 'px';
	}
	else 
	{
		footerElement.style.position = 'absolute';
		footerElement.style.top = (contentHeight + footerHeight) + 'px';
		menuDiv.style.height = (contentHeight + footerHeight * 2) + 'px';
	}
	footerElement.style.visibility = 'visible';
}
//positions the logo
//function setLogo()
//{
//	if (!document.getElementById)
//		return;
			
//	var width = window.innerWidth ? window.innerWidth : document.body.offsetWidth;
//	if (width <= 0)
//		return;
//	var logo = document.getElementById('logo');
//	logo.style.position = 'absolute';
//	logo.style.top = 25 + 'px';
//	if( width > 800 )
//		logo.style.left = (width - 125) + 'px';
//	else 
//		logo.style.left = (800 - 125) + 'px';
			
//}

function initPopups() 
{
	var popupli = document.getElementById('popup_li');

	popupli.onmouseover = function() 
	{
		ul = this.getElementsByTagName("UL");
		ul[0].style.left = '100px';
		//ul[0].style.zIndex = 6000;
	}
	popupli.onmouseout = function() 
	{
		ul = this.getElementsByTagName("ul");
		ul[0].style.left = '-500px';
	}
}

//event functions
window.onload = function() 
{
	setFooter();
//	setLogo();
	initPopups();
}
window.onresize = function() 
{
	setFooter();
//	setLogo();
}