function swf_menu_topo(){
document.write('<object type="application/x-shockwave-flash" data="img/topo5.swf" width="776" height="205">');
document.write('<param name="movie" value="img/topo5.swf" />');
document.write('<param name="allowScriptAcess" value="sameDomain" />');
document.write('<param name="quality" value="best" />');
document.write('<param name="wmode" value="transparent">');
document.write('</object>');	
}
function swf_banner(){
document.write('<object type="application/x-shockwave-flash" data="img/banner_index.swf" width="410" height="100">');
document.write('<param name="movie" value="img/banner_index.swf" />');
document.write('<param name="allowScriptAcess" value="sameDomain" />');
document.write('<param name="quality" value="best" />');
document.write('<param name="wmode" value="transparent">');
document.write('</object>');
}
function swf_slideshow(){
document.write('<object type="application/x-shockwave-flash" data="img/slideshow.swf" width="410" height="220">');
document.write('<param name="movie" value="img/slideshow.swf" />');
document.write('<param name="allowScriptAcess" value="sameDomain" />');
document.write('<param name="quality" value="best" />');
document.write('<param name="wmode" value="transparent">');
document.write('</object>');
}
function swf_patrocinio(){
document.write('<object type="application/x-shockwave-flash" data="img/patrocinio.swf" width="205" height="250">');
document.write('<param name="movie" value="img/patrocinio.swf" />');
document.write('<param name="allowScriptAcess" value="sameDomain" />');
document.write('<param name="quality" value="best" />');
document.write('</object>');
}
function load() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("mapa"));
		map.setCenter(new GLatLng(-21.178721, -47.818420), 12);
		map.addControl(new GLargeMapControl());
		marker = new GMarker(new GLatLng(-21.186273,-47.809828));
		GEvent.addListener(marker, "click", function() {
			mensagem  = '<br><b>Centro de Convenções de Ribeirão Preto</b><br>Rua Bernadino de Campos, 999 - Centro';
			marker.openInfoWindowHtml(mensagem);
		});
		map.addOverlay(marker);
	}
}

$(document).ready(function() {
	if (document.getElementById('galeria')){
		$('#galeria a').lightBox();
	}
	 
	g1 = $('#galeno_titulo').keypress(function(){
		counter();		
	});
	g2 = $('#galeno_autor01').keypress(function(){
		counter();			
	});
	g5 = $('#galeno_inst01').keypress(function(){
		counter();			
	});
	g8 = $('#galeno_texto').keypress(function(){
		counter();			
	});
	g9 = $('#galeno_apoio').keypress(function(){
		counter();			
	});
});
alerta = 0;
function counter(){
	c1 = document.getElementById('galeno_titulo').value;
	c2 = document.getElementById('galeno_autor01').value;
	c5 = document.getElementById('galeno_inst01').value;
	c8 = document.getElementById('galeno_texto').value;
	c9 = document.getElementById('galeno_apoio').value;
	total_carc = (c1.length + c2.length + c5.length + c8.length + c9.length );
	carac_rest = 2500 - total_carc;
	if (carac_rest < 1){
		if (alerta == 0){
			alert('Você ultrapassou a quantidade máxima de caracteres.');
			alerta = 1;
		}
		$('#counter').html('0');
	} else {
		$('#counter').html(carac_rest);
		alerta = 0;
	}
	
}

function abre_programacao(div){
	if (div.style.display == 'none' || div.style.display == ''){
		div.style.display = 'block';
	} else {
		div.style.display = 'none';
	}
}

var win= null;
function popupcenter(mypage,myname,w,h,scroll,maximizar){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable='+maximizar;
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}