function novaJanela(url,nome,w,h)
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
    window.open(url,nome,'toolbar=false,scrollbars=yes,menubar=false,top='+wint+',left='+winl+',width='+w+',height='+h+'');
}
function fecharjanela()
{        
                    
//            opener.__doPostBack('ctl00$ContentPlaceHolder1$linque','');
              if (navigator.appName == "Netscape")                                   
              opener.__doPostBack('ctl00$ContentPlaceHolder1$linque1','');            
              else
              opener.__doPostBack('ctl00$ContentPlaceHolder1$linque',''); 
              
              window.close();        
}

function CompararDataMenor(source, arguments) 
{

	var dataInicio = document.getElementById('ctl00$ContentPlaceHolder1$DetailsView1$txtDataInicio').value; 
	
	var df = arguments.Value.split("/");
	var df = new Date( parseInt(df[2]) , parseInt(df[1]-1) , parseInt(df[0]) );
	var di = dataInicio.split("/");
	var di = new Date( parseInt(di[2]) , parseInt(di[1]-1) , parseInt(di[0]) );
	
	arguments.IsValid = df < di ? false : true; 

}


// Limita a quantidade de caracteres em um campo multiline

function textCounter(field,MaxLength) { 
obj = document.all(field); 
if (MaxLength !=0) { 
if (obj.value.length > MaxLength) 
obj.value = obj.value.substring(0, MaxLength); 
} 
} 
