
function menuclick(e){
    if(typeof(e)=='undefined')var e=window.event
    source=e.target?e.target:e.srcElement
    if(source.nodeType==3)source=source.parentNode
    n=source.getAttribute("href").replace(/.*=/,"")
    carrega(parseInt(n))
    return false
}

<!--
        function validaContato(frm){

			 if(frm.nome.value.replace(/\s/gi,"")==""){
                frm.nome.focus();
                alert("Por favor, informe seu nome.");
                return false;
            }

            if(frm.email.value.indexOf("@")==-1){
                frm.email.focus();
                alert("Por favor, informe seu email.");
                return false;
            }

            if(frm.mensagem.value.replace(/\s/gi,"")==""){
                frm.mensagem.focus();
                alert("Digite sua mensagem.");
                return false;
            }

            return true;
        }

function init(){
    //Sub menu dos produtos
	document.getElementById("btProdutos").onmouseover = function(){
		document.getElementById("subProdutos").style.display = 'block';
	}; 
	document.getElementById("btProdutos").onmouseout = function(){
		document.getElementById("subProdutos").style.display = 'none';
	}; 
	document.getElementById("subProdutos").onmouseout = function(){
		document.getElementById("subProdutos").style.display = 'none';
	}; 
	document.getElementById("subProdutos").onmouseover = function(){
		document.getElementById("subProdutos").style.display = 'block';
	};
	
	//Sub menu do snooker
	document.getElementById("btSub").onmouseover = function(){
		document.getElementById("subSub").style.display = 'block';
	}; 
	document.getElementById("btSub").onmouseout = function(){
		document.getElementById("subSub").style.display = 'none';
	}; 
	document.getElementById("subSub").onmouseout = function(){
		document.getElementById("subSub").style.display = 'none';
	}; 
	document.getElementById("subSub").onmouseover = function(){
		document.getElementById("subSub").style.display = 'block';
	};
	
	//Sub menu do Regras
	document.getElementById("btRegras").onmouseover = function(){
		document.getElementById("subRegras").style.display = 'block';
	}; 
	document.getElementById("btRegras").onmouseout = function(){
		document.getElementById("subRegras").style.display = 'none';
	}; 
	document.getElementById("subRegras").onmouseout = function(){
		document.getElementById("subRegras").style.display = 'none';
	}; 
	document.getElementById("subRegras").onmouseover = function(){
		document.getElementById("subRegras").style.display = 'block';
	};
	
	
	
	CarregaThumbs()
	

}
// JavaScript Document

var Largura=1
var Altura=1

if (document.getElementById || document.all)
document.write('<div id="DivThumb" style="position:absolute;visibility:hidden;left:0px;top:-1000px;width:auto;height:auto;border:none;background:none;z-index:9999;overflow:hidden;"><img id="ImagemThumb" style="margin-top:5px;border: 3px solid #624301;" src="img/produtos/acessorios/vazio.gif" /></div>')

function getObjThumb()
{
	if (document.getElementById) return document.getElementById("DivThumb").style
	else if (document.all) return document.all.DivThumb.style
}

function varCorpoDoc()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function EscondeThumb()
{
	document.onmousemove=""
	document.getElementById('ImagemThumb').src='img/produtos/acessorios/vazio.gif'
	getObjThumb().visibility="hidden"
	getObjThumb().left=-1000
	getObjThumb().top=0
}

function MostraThumb(e)
{	if(typeof(e)=='undefined')var e=window.event;
	var objOrigem = (e.target) ? e.target : e.srcElement;
	var strOrigem = getNomeImagem(objOrigem.src);
	var ObjImagemThumb = document.getElementById('ImagemThumb');
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		
		ObjImagemThumb.src='img/produtos/acessorios/'+strOrigem;
		Largura=ObjImagemThumb.width;
		Altura=ObjImagemThumb.height;
		getObjThumb().visibility="visible";
		document.onmousemove=SegueMouse;
	}
}


function SegueMouse(e)
{

	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{

		var intCoordX=20
		var intCoordY=20

		if (typeof e != "undefined")
		{
			intCoordX+=e.pageX
			intCoordY+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			intCoordX+=varCorpoDoc().scrollLeft+event.clientX
			intCoordY+=varCorpoDoc().scrollTop+event.clientY
		}

		var DocLargura=document.all? varCorpoDoc().scrollLeft+varCorpoDoc().clientWidth : pageXOffset+window.innerWidth-15
		var DocAltura=document.all? Math.max(varCorpoDoc().scrollHeight, varCorpoDoc().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

		if (intCoordX+Largura+3>DocLargura)
		intCoordX=intCoordX-Largura-(20*2)
		if (intCoordY-varCorpoDoc().scrollTop+Altura>varCorpoDoc().clientHeight)
		intCoordY=intCoordY-Altura-20;
		getObjThumb().left=intCoordX+"px"
		getObjThumb().top=intCoordY+"px"

	}

}

function CarregaThumbs()	{
	var objPai = document.getElementsByTagName("a");
	for(i=0; i< objPai.length;i++){
		if(objPai[i].getAttribute("rel")=="imagemT"){
		var ThumbObj = objPai[i].getElementsByTagName("img")[0];
		ThumbObj.onmouseover = MostraThumb;
		ThumbObj.onmouseout = EscondeThumb;
		}
	}
	
	
	
}
function getNomeImagem(strCaminho){
	var strStr = strCaminho.substring(strCaminho.lastIndexOf("/")+1,strCaminho.length);
	return strStr.replace('_p','_g');
}
try{xmlhttp=new XMLHttpRequest();}catch(ee){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}}

function limpa(){
	base=document.getElementById("galeriadefotos").getElementsByTagName("ul");
	for(i=0;i<base.length;i++){
		if(document.getElementById("sub"+[i])){
			document.getElementById("sub"+[i]).style.display="none";
		};
	}
}
function mostra(obj){
	limpa();
	document.getElementById(obj.id.replace("cat","")).style.display="block";
}
//var objOverlay=null;

/*function puxaFoto(obj){
	//Apaga o div caso ele exista
	if(document.getElementById("destino")){
		document.getElementById("destino").parentNode.removeChild(document.getElementById("destino"))
	}
	//insere o div abaixo do objeto atual

	
	//chama o conteudo referente ao objeto clicado
	xmlhttp.open("GET", "request.php?id="+obj.id,true);
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			document.getElementById("auxiliar").value = String(xmlhttp.responseText)
			//retorna o conteudo do ajax no div criado
		}
	}
	xmlhttp.send();

	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','destino');
	objOverlay.innerHTML = document.getElementById("auxiliar").value;
	obj.parentNode.appendChild(objOverlay);
	//alert(objOverlay);
	//document.reload(true)
		//document.body.innerHTML = document.body.innerHTML;

	initLightbox();
}

function menuclick(e){
    if(typeof(e)=='undefined')var e=window.event
    source=e.target?e.target:e.srcElement
    if(source.nodeType==3)source=source.parentNode
    n=source.getAttribute("href").replace(/.*=/,"")
    carrega(parseInt(n))
    return false
}


function mostraSub(e){
	//if(document.getElementById("destino")){
	//	document.getElementById("destino").parentNode.removeChild(document.getElementById("destino"))
	//}

    if(typeof(e)=='undefined')var e=window.event;
    source=e.target?e.target:e.srcElement;
    if(source.nodeType==3)source=source.parentNode;
    n=source.getAttribute("id");
	
	//obj=document.createElement("div");
	//obj.setAttribute("id","destino");
	//obj.innerHTML = "teste";
	

	//document.getElementById(n).parentNode.appendChild(obj);
	limpa();
	fotos = document.getElementById(n.replace("cat","")).getElementsByTagName("img");
		for(x=0;x<fotos.length;x++){
			MM_preloadImages(fotos[x].src);
		}
	document.getElementById(n.replace("cat","")).style.display="block";
	
}
function limpa(){
	base=document.getElementById("galeriadefotos").getElementsByTagName("ul");
	for(i=0;i<base.length;i++){
		if(document.getElementById("sub"+[i])){
			document.getElementById("sub"+[i]).style.display="none";
		};
	}
}
function sconfigLinks(){
	base=document.getElementById("galeriadefotos").getElementsByTagName("a");
	for(i=0;i<base.length;i++){
		if(document.getElementById("catsub1"+[i])){
		document.getElementById("catsub1"+[i]).href="javascript:void(0);";
		document.getElementById("catsub1"+[i]).onclick=mostraSub;
	}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}//MM_preloadImages('')

function permiteLinks(){
document.getElementById("catsub1").onclick=function(){limpa();document.getElementById("sub1").style.display="block";}
document.getElementById("catsub2").onclick=function(){limpa();document.getElementById("sub2").style.display="block";}
document.getElementById("catsub3").onclick=function(){limpa();document.getElementById("sub3").style.display="block";}
document.getElementById("catsub4").onclick=function(){limpa();document.getElementById("sub4").style.display="block";}
document.getElementById("catsub5").onclick=function(){limpa();document.getElementById("sub5").style.display="block";}
document.getElementById("catsub6").onclick=function(){limpa();document.getElementById("sub6").style.display="block";}
document.getElementById("catsub7").onclick=function(){limpa();document.getElementById("sub7").style.display="block";}
document.getElementById("catsub8").onclick=function(){limpa();document.getElementById("sub8").style.display="block";}
document.getElementById("catsub9").onclick=function(){limpa();document.getElementById("sub9").style.display="block";}
document.getElementById("catsub10").onclick=function(){limpa();document.getElementById("sub10").style.display="block";}
document.getElementById("catsub11").onclick=function(){limpa();document.getElementById("sub11").style.display="block";}
document.getElementById("catsub12").onclick=function(){limpa();document.getElementById("sub12").style.display="block";}
document.getElementById("catsub13").onclick=function(){limpa();document.getElementById("sub13").style.display="block";}
document.getElementById("catsub14").onclick=function(){limpa();document.getElementById("sub14").style.display="block";}
document.getElementById("catsub15").onclick=function(){limpa();document.getElementById("sub15").style.display="block";}
document.getElementById("catsub16").onclick=function(){limpa();document.getElementById("sub16").style.display="block";}
document.getElementById("catsub17").onclick=function(){limpa();document.getElementById("sub17").style.display="block";}
document.getElementById("catsub18").onclick=function(){limpa();document.getElementById("sub18").style.display="block";}
document.getElementById("catsub19").onclick=function(){limpa();document.getElementById("sub19").style.display="block";}
document.getElementById("catsub20").onclick=function(){limpa();document.getElementById("sub20").style.display="block";}
document.getElementById("catsub21").onclick=function(){limpa();document.getElementById("sub21").style.display="block";}
document.getElementById("catsub22").onclick=function(){limpa();document.getElementById("sub22").style.display="block";}
document.getElementById("catsub23").onclick=function(){limpa();document.getElementById("sub23").style.display="block";}
document.getElementById("catsub24").onclick=function(){limpa();document.getElementById("sub24").style.display="block";}
document.getElementById("catsub25").onclick=function(){limpa();document.getElementById("sub25").style.display="block";}
document.getElementById("catsub26").onclick=function(){limpa();document.getElementById("sub26").style.display="block";}
document.getElementById("catsub27").onclick=function(){limpa();document.getElementById("sub27").style.display="block";}
document.getElementById("catsub28").onclick=function(){limpa();document.getElementById("sub28").style.display="block";}
document.getElementById("catsub29").onclick=function(){limpa();document.getElementById("sub29").style.display="block";}
document.getElementById("catsub30").onclick=function(){limpa();document.getElementById("sub30").style.display="block";}
document.getElementById("catsub31").onclick=function(){limpa();document.getElementById("sub31").style.display="block";}
document.getElementById("catsub32").onclick=function(){limpa();document.getElementById("sub32").style.display="block";}
document.getElementById("catsub33").onclick=function(){limpa();document.getElementById("sub33").style.display="block";}
document.getElementById("catsub34").onclick=function(){limpa();document.getElementById("sub34").style.display="block";}
document.getElementById("catsub35").onclick=function(){limpa();document.getElementById("sub35").style.display="block";}
document.getElementById("catsub36").onclick=function(){limpa();document.getElementById("sub36").style.display="block";}
document.getElementById("catsub37").onclick=function(){limpa();document.getElementById("sub37").style.display="block";}
}
*/
window.onload=init