<!--
var Renovis = new Object();
var gDir=null, gEsq;
var IE = document.all?true:false;
Renovis.Data = new Date();
var GalleryPos = {a:null, b:1};

Renovis.setMes = function(objMes)
{
	RenovisDia = this.Data.getDate();
	RenovisMes = this.Data.getMonth()+1;
	RenovisAno = this.Data.getFullYear();
	Renovis.$('TMPIFrame').setAttribute('src', 'includes/calendar_mes.php?ano=' + RenovisAno + '&mes=' + objMes.value);
}

Renovis.$ = function() 
{
	return document.getElementById(this.$.arguments[0]);
}


Renovis.goToURL = function(URL, strParam) {
	if(URL != "") {
		document.location = URL + '?idm=' + strParam;
	}
}

Renovis.gallery_MR = function(objParam, pathFotos) {
	var objG = Renovis.$('galleryGrande');
	objG.style.background = 'url(upload/'+pathFotos+'/'+objParam+') no-repeat';
}

Renovis.gallerySelect = function(rDir) {
	GalleryPos.a = parseInt(rDir)-1;
	GalleryPos.b = parseInt(rDir)+1;
	if(rDir != 0) {
		Renovis.$('fotosBtnAnterior').style.display = 'block';
	} else {
		Renovis.$('fotosBtnAnterior').style.display = 'none';
	}

	if(rDir != parseInt(arrImgs.length)-1) {
		Renovis.$('fotosBtnProxima').style.display = 'block';
	} else {
		Renovis.$('fotosBtnProxima').style.display = 'none';
	}
	Renovis.gallery_MR(arrImgs[rDir][0], pathImgs);
	var _currImg = Renovis.$('galleryGrande').style.backgroundImage;

	var offSetTop = 220
	if(window.innerHeight) {
		if(window.pageYOffset > offSetTop) {
			window.scrollTo(window.pageXOffset, offSetTop);
		}
	} else if(document.documentElement) {
		if(document.documentElement.scrollTop > offSetTop) {
			window.scrollTo(window.scrollTop, offSetTop);
		}
	} else if(document.body) {
		if(document.body.scrollTop > offSetTop) {
			window.scrollTo(window.scrollTop, offSetTop);
		}
	}
}

// ------ FORMULÁRIOS --------------------------
Renovis.getEmptyContent = function(objHtmlInput) {
	if(objHtmlInput.value == "") {
		return(false);
	}
	return(true);
}


// ----- DEPOIMENTOS ---------------------------
Renovis.checaDepoimentos = function(objForm) {
	var De, Para, Msg;

	De = objForm.de;
	if(!this.getEmptyContent(De)) {
		alert('Preencha o campo "De"!');
		De.focus();
		return(false);
	}

	Para = objForm.para;
	if(!this.getEmptyContent(Para)) {
		alert('Preencha o campo "Para"!');
		Para.focus();
		return(false);
	}

	Msg = objForm.mensagem;
	if(!this.getEmptyContent(Msg)) {
		alert('Preencha o campo "Mensagem"!');
		Msg.focus();
		return(false);
	}

	if(Msg.value.length < 10) {
		alert('O campo "Mensagem" deve conter pelo menos 10 caracteres!');
		Msg.focus();
		return(false);
	}
	this.sendDados(objForm);
	return(false);
}

Renovis.sendDados = function(objForm) {
	var De, Para, Msg
	De = objForm.de.value;
	Para = objForm.para.value;
	Msg = objForm.mensagem.value.replace(/\n/g,"!--");
	this.$('TMPIFrame').setAttribute('src', 'depoimentos_insert.php?de=' + De + '&para=' + Para + '&msg=' + Msg);
}
// ---------------------------------------------

// -------- FALE CONOSCO -----------------------
Renovis.checaFaleConosco = function(objForm) {
	var De, Para, Msg;

	Nome = objForm.nome;
	if(!this.getEmptyContent(Nome)) {
		alert('Preencha o campo Nome!');
		Nome.focus();
		return(false);
	}

	Email = objForm.email;
	if(!this.getEmptyContent(Email)) {
		alert('Preencha o campo E-mail!');
		Email.focus();
		return(false);
	}

	Assunto = objForm.assunto;
	if(!this.getEmptyContent(Assunto)) {
		alert('Preencha o campo Assunto!');
		Assunto.focus();
		return(false);
	}

	Msg = objForm.mensagem;
	if(!this.getEmptyContent(Msg)) {
		alert('Digite uma mensagem!');
		Msg.focus();
		return(false);
	}
	this.sendDadosFale(objForm);
	return(false);
}

Renovis.sendDadosFale = function(objForm) {
	var Nome, Email, Assunto, Encontro, Msg
	Nome = objForm.nome.value;
	Email = objForm.email.value;
	Assunto = objForm.assunto.value;
	Encontro = objForm.encontro.value;
	Msg = objForm.mensagem.value.replace(/\n/g,"!--");
	this.$('TMPIFrame').setAttribute('src', 'faleconosco_insert.php?nome=' + Nome + '&email=' + Email + '&assunto=' + Assunto + '&encontro=' + Encontro + '&msg=' + Msg);
}
// ----------------------------------

// ------- Mouse Over/Out -----------
document.onmouseover = mouseOver;
document.onmouseout  = mouseOut;

function mouseOver(e) {
	var ev = e || window.event;
	var target = ev.target || ev.srcElement;
	var title = target.title;
	if((!title == '') && title != null) {
		if(parseInt(title.indexOf(".gif")) >= 0 || parseInt(title.indexOf(".jpg")) >= 0) {
			if(title.indexOf("|") >= 0) {
				arrImage = title.split("|");
				imgOn = arrImage[1];
				target.setAttribute('src','images/'+imgOn);
			}
		}
	}
}

function mouseOut(e) {
	var ev = e || window.event;
	var target = ev.target || ev.srcElement;
	var title = target.title;
	if((!title == '') && title != null) {
		if(title.indexOf(".gif") >= 0 || title.indexOf(".jpg") >= 0) {
			arrImage = title.split("|");
			imgOff = arrImage[0];
			target.setAttribute('src','images/'+imgOff);
		}
	}
}

Renovis.setPageProg = function(e){
	var ev = e || window.event;
	var target = ev.target || ev.srcElement;
	var title = target.title;
	splitString = title.split("|");
	document.location = 'programacao_view.php?idprg=' + splitString[1];
}
//-->
