// DMV4 Comunicação
function init(){
	if(document.getElementById("bt-cardapio")){
		var bt = document.getElementById("bt-cardapio");
		bt.onclick=function(){
			abre_cardapio();
			return false;
		}
	}
	if(document.getElementById("bt-pop-kids")){
		var bt_kids = document.getElementById("bt-pop-kids");
		bt_kids.onclick=function(){
			pop_kids();
			return false;
		}
	}
}
function NovaJanela(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
function abre_cardapio(){
	NovaJanela('cardapio.php','cardapio_senhorpastel',810,744,'yes');
}
function pop_kids(){
	NovaJanela('kids.html','kids_senhorpastel',582,500,'yes');
}
function over(){
	if(document.getElementById("cardapio")){
		var tr = document.getElementsByTagName("tr");
		var corOn = "#fff";
		var corOff = "";
		if(/firefox/.test(navigator.userAgent.toLowerCase())){
			for(var i=0; i<tr.length; i++){
				if(tr[i].className!="cabecalho"){
					tr[i].onmouseover=function(){
						this.childNodes[1].style.backgroundColor=corOn;
						this.childNodes[3].style.backgroundColor=corOn;
						this.childNodes[5].style.backgroundColor=corOn;
						this.childNodes[7].style.backgroundColor=corOn;
						this.childNodes[9].style.backgroundColor=corOn;
						this.childNodes[11].style.backgroundColor=corOn;
					}
					tr[i].onmouseout=function(){
						this.childNodes[1].style.backgroundColor=corOff;
						this.childNodes[3].style.backgroundColor=corOff;
						this.childNodes[5].style.backgroundColor=corOff;
						this.childNodes[7].style.backgroundColor=corOff;
						this.childNodes[9].style.backgroundColor=corOff;
						this.childNodes[11].style.backgroundColor=corOff;
					}
				}
			}
		}
		else{
			for(var i=0; i<tr.length; i++){
				if(tr[i].className!="cabecalho"){
					tr[i].onmouseover=function(){
						this.childNodes[0].style.backgroundColor=corOn;
						this.childNodes[1].style.backgroundColor=corOn;
						this.childNodes[2].style.backgroundColor=corOn;
						this.childNodes[3].style.backgroundColor=corOn;
						this.childNodes[4].style.backgroundColor=corOn;
						this.childNodes[5].style.backgroundColor=corOn;
					}
					tr[i].onmouseout=function(){
						this.childNodes[0].style.backgroundColor=corOff;
						this.childNodes[1].style.backgroundColor=corOff;
						this.childNodes[2].style.backgroundColor=corOff;
						this.childNodes[3].style.backgroundColor=corOff;
						this.childNodes[4].style.backgroundColor=corOff;
						this.childNodes[5].style.backgroundColor=corOff;
					}
				}
			}
		}
	}
}
window.onload=function(){
	init();
	over();
}