// JavaScript Document

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var now = new Date()
var hrs = now.getHours()
var min = now.getMinutes()
var user = -(now.getTimezoneOffset() / 60)
var day = new Date();
var currentTimeZoneOffsetInHours = - day.getTimezoneOffset()/60;
var ClockId = null;
var ClockRunning = false;
function TOfunc(){
	var timezone = document.clock.cityname[document.clock.cityname.selectedIndex].value;
	var today = new Date();
	var hours = today.getHours();
	var minutes = today.getMinutes();
	var secs = today.getSeconds();
	hours += parseInt(timezone) - currentTimeZoneOffsetInHours;
	today.setHours(hours);
	ST = today.toString();
	ST = ST.substring(4,10) + ". " + ST.substring(28,34) + ". " + ST.substring(10,19)
	document.clock.city.value = ST;
	ClockId = window.setTimeout( "TOfunc()", 1000 );
	ClockRunning = true;
}
function stopClock(){
	if(ClockRunning) clearTimeOut(ClockId); ClockRunning = false;
}

function citytime(){
	stopClock;
	TOfunc();
}

function xk_login() {
	missinginfo = "";
	if ((document.form_login.usuario.value == "") || (document.form_login.usuario.value == "usuario")) {
		missinginfo += "\n     -  Usuário";
	}
	if (document.form_login.senha.value == "") {
		missinginfo += "\n     -  Senha";
	}
	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"Você não preencheu corretamente:\n" +
		missinginfo + "\n_____________________________" +
		"\nPor favor, preencha novamente!";
		alert(missinginfo);
		return false;
	}
	else return true;

}

function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
	field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
}


