$(document).ready(function(){

	$('.pop-up-aberta').hide();

	$(".pop-up").hover(
	  function () {
       	qual = $(this).attr("title")

		$('.pop-up-aberta').hide();
		
		$('#p-'+qual).show();
		
      }, 
       function () {
        qual = $(this).attr("title")
		
				$('#p-'+qual).hover(
			  	   function () {		   }, 
			       function () {
					   
		  			$('#p-'+qual).hide();
			   });
      }
    );

	$("#topo").hover( function () {
		$('.pop-up-aberta').hide();
	});	
});



// Ajax ###
var req;
function loadXMLMenu(pagina,div){
    req = null;
	divi = div;
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChangeMenu;
        req.open("GET", pagina, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChangeMenu;
            req.open("GET", pagina, true);
            req.send();
        }
    }
}
function processReqChangeMenu(){
	if (req.readyState == 1){
		document.getElementById(divi).innerHTML = "<div align='center'><font face='Verdana' size='-1'><strong>Carregando...</strong></font>";
	}
    if (req.readyState == 4) {
		document.getElementById(divi).innerHTML = "Carregando...";
        if (req.status == 200) {
            document.getElementById(divi).innerHTML = req.responseText;
        } else {
            alert("Houve um problema ao obter os dados:\n" + req.statusText);
			document.getElementById('text').innerHTML = "";
        }
    }

}

function ajax(pagina,div){
	loadXMLMenu(pagina,div);
}

// Flash ###

function flash(nome,width,height){
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+width+"' height='"+height+"'>");
   document.write("<param name='movie' value='"+ nome +"'>");
   document.write("<param name='quality' value='high'>");
   document.write("<embed src='"+ nome +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
   document.write("</object>");
}
function flasht(nome,width,height){
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+width+"' height='"+height+"'>");
   document.write("<param name='movie' value='"+ nome +"'>");
   document.write("<param name='quality' value='high'>");
   document.write("<param name='wmode' value='transparent'/>");
   document.write("<embed src='"+ nome +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' wmode='transparent'></embed>");
   document.write("</object>");
}



function enquete(){
	var desktop = window.open('../enquete/default.asp', '_blank', 'width=436,height=350,top=130,left=180,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no')
}

function tocado(titulo)
{
	var desktop = window.open('../faleconosco/tocado.asp?titulo='+titulo, '_blank', 'width=436,height=540,top=130,left=180,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no')
}

function imprimir(cod,tab)
{
	var desktop = window.open('../faleconosco/imprimir.asp?cod='+cod+'&tab='+tab, '_blank', 'left=150,top=80,width=440,height=360,toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=no')
}



	

