function inTd(obj)
{
	obj.style.backgroundColor = "#add8e6"//"#FAFCB1";	
}

function outTd(obj)
{
	obj.style.backgroundColor = "";
	obj.style.cursor = "";	
}

 function inTdRelatorio(obj)
{
    obj.style.backgroundColor = "#ebebeb";	
}

function outTdRelatorio(obj)
{
    obj.style.backgroundColor = "";
    obj.style.cursor = "";
}


function inmnlateral(obj)
{
	obj.style.backgroundColor = "#ffffff";	
}

function outmnlateral(obj)
{
	obj.style.backgroundColor = "";
	obj.style.cursor = "";	
}
function changeLocation(url)
{
	location.href = url;
}

function HotKeys()
{	

}

function ffocus()
{
	for(var i = 0; i < document.forms[0].length; i ++)
	{
		var obj = document.forms[0][i];
		if(obj.type == "text" || obj.type == "textarea")
		{
			if(!obj.readOnly || !obj.disabled)
			{
				if(!obj.disabled)
				{
					if(!obj.readOnly)
					{
						obj.focus();
						break;
					}
				}
			}
		}
	}
}

function abrirCalendario(strField)
{
	var win = window.open('../AspxObjetos/DatePicker.aspx?field=' + strField,'calendarPopup','width=208,height=148,resizable=no');
	centraForm(win);
}

function centraForm(janela)
{
	janela.moveTo(((screen.width / 2) - (250 / 2)), ((screen.height / 2) - (228 / 2)));

}

document.onkeydown = HotKeys;
//document.onunload = finalizaSessao()289

ffocus();

function limita(obj, limite)
{
	if(obj.value.length > limite)
		obj.value = obj.value.substring(0, limite - 1);
}
function init()
			{
				var botao = document.getElementById("btnGravar");
				var botao2 = document.getElementById("btnExcluir");
				var botao3 = document.getElementById("btnClausula");
				if(botao!=null)
					botao.disabled = false;
				if (botao2!=null)
					botao2.disabled = false;
				if (botao3!=null)
					botao3.disabled = false;
			}
			
function verificaKeyUp(obj, max) 

{ 

    if (obj.value.length > max) 

  {

      obj.value = obj.value.substr(0,max); 

   } 

}
