arrSemana = new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado");
arrMes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro");
function data() {
	hoje = new Date();
	dia = hoje.getDate(); if (dia==1) dia+="&ordm";
	diaSem = arrSemana[hoje.getDay()];
	mes = arrMes[hoje.getMonth()];
	ano = hoje.getYear();
	if (ano<1900) ano+=1900;
	hora = hoje.getHours(); if (hora.toString().length<2) hora = "0"+hora;
	mins = hoje.getMinutes(); if (mins.toString().length<2) mins = "0"+mins;
	document.write(diaSem +", "+ dia +" de "+ mes +" de "+ ano +" - "+ hora +"h"+ mins);
}

//Menu
function abre(theURL,winName,features) {
	window.open(theURL,winName,features);
}

var bAnimate = true;
var nStep = 25;
var nDelay = 40;
var nChunk;
var mostra = 0;
var useragent = navigator.userAgent;

if (useragent.indexOf("MSIE")==-1) {
	window.location = nonie4;
} 
else if((navigator.appVersion.substring(0,1) < 4) || 
		(useragent.indexOf("Windows 3.1") != -1) || 
		(useragent.indexOf("X11") != -1) || 
		(useragent.indexOf("Mac") != -1)) {
	window.location = nonie4;
}

function doMenu(id, x, y) {
	var thisMenu = document.all(id);
	
	if (thisMenu == AnimatedMenu) {
		window.event.cancelBubble = true;return false;
	}
	
	if (AnimatedMenu != null) 	
		AnimatedMenu.style.display = "none";
	
	window.event.cancelBubble = true;
	
	if( x < 0) {
		x = document.body.clientWidth + x;
	}
	thisMenu.style.width = "92px"; 
	thisMenu.style.height = "64px";
	thisMenu.style.left = x;
	thisMenu.style.top = y;
	AnimatedMenu = thisMenu;
	
	if (bAnimate) {
		thisMenu.style.clip = "rect(0 0 0 0)";
		thisMenu.style.display = "block";
		nChunk = nStep;
		window.setTimeout("showMenu()", nDelay);
	}
	else {
		AnimatedMenu.style.display = "";
	}
}

function showMenu() {
	mostra=1;
	AnimatedMenu.style.clip = "rect(0 100% "+ nChunk + "% 0)"
	nChunk += nStep;
	nChunk<=100?window.setTimeout("showMenu()",nDelay):null	
}
function hideMenu() {
	if (mostra==1) {
		AnimatedMenu.style.display = "none";
		AnimatedMenu = StartMenu;
		window.event.cancelBubble = true;
	}
}

function keepMenu(){
	window.event.cancelBubble = true;
}

document.onmouseover = hideMenu;


function adicionarAcompanhante()
{
	var form = document.forms[0];
	var nome = form.nome.value;
	var acompanhantes = form.acompanhantes;
	acompanhantes.options[acompanhantes.length] = new Option(nome, nome);
	form.nome.value = "";
}


function removerAcompanhante() {
	
	var form = document.forms[0];
	var acompanhantes = form.acompanhantes;
	var nome = acompanhantes.options[acompanhantes.selectedIndex].value;
	form.nome.value = nome;
	acompanhantes.options[acompanhantes.selectedIndex] = null;
}

function selectAllAcompanhantes() {
	
	var form = document.forms[0];
	var acompanhantes = form.acompanhantes;
	var tamanho = acompanhantes.length;
	
	if(tamanho > 0) {
		for(var i = 0; i < tamanho; i++) {
			acompanhantes.options[i].selected = true;
		}
	}
}

function unselectAllAcompanhantes() {
	
	var form = document.forms[0];
	var acompanhantes = form.acompanhantes;
	var tamanho = acompanhantes.length;
	
	if(tamanho > 0) {
		for(var i = 0; i < tamanho; i++) {
			acompanhantes.options[i].selected = false;
		}
	}
}