$.fn.corner.defaults.useNative = false;
$(document).ready(function() {
	$('.tr1,.tr2').hover(function(){ $(this).css("background-color","#b0c7ed"); }, function(){ $(this).css("background-color",($(this).attr('class')=='tr1'?"#eff4fe":"#FFF")); });
	$(".inpOver").hover(function(){	$(this).css("background-position","bottom"); }, function(){	$(this).css("background-position","top"); });
	$(".imgOver").hover(function(){ $(this).children().css("background-position","bottom"); }, function(){ $(this).children().css("background-position","top"); });
	$(".corner10").corner("10px");	
	$(".corner").corner("5px");
	$(".imgAgCorner").corner("8px");
});

function CheckMail(str){ var testresults; var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if (filter.test(str)) {testresults=false} else {testresults=true} return (testresults)}
function cChange(div,clas) { var a = div.split(','); for(x=0;x<=a.length-1;x++) { document.getElementById(a[x]).className = clas; } }
function ajaxGET(div,pag) { $.get(pag, function(r){ $("#"+div).html(r); }); }

function montaFlash(swf, width, height, id, wmode, cache) {
	noCache = cache || cache == undefined ? "" : "?" + new Date();
	monta_swf = "";
	monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" id=\""+ id +"\" width=\""+ width +"\" height=\""+ height +"\" title=\"\">";
	monta_swf += "<param name=\"movie\" value=\""+ swf + noCache +"\" />";
	monta_swf += "<param name=\"wmode\" value=\""+ wmode +"\" />";
	monta_swf += "<param name=\"quality\" value=\"high\" />";
	monta_swf += "<param name=\"menu\" value=\"false\" />";
	monta_swf += "<param name=\"volume\" value=\"1\" />";
	monta_swf += "<embed src=\""+ swf + noCache +"\" quality=\"high\" wmode=\""+ wmode +"\" volume=\"100\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" menu=\"false\" id=\""+ id +"\" width=\""+ width +"\" height=\""+ height +"\"></embed>";
	monta_swf += "</object>";
	document.write(monta_swf);
}

function popWin(URL,NAME,WIDTH,HEIGHT,RESIZE,SCROLL) {
   winId = window.open(URL,NAME,'width='+WIDTH+',height='+HEIGHT+',resizable='+RESIZE+',scrollbars='+SCROLL+',menubar=no,toolbar=no,location=no,directories=no,status=no');
	var clientWidth = screen.availWidth;
	var clientHeight = screen.availHeight;
	var xPos = (clientWidth - WIDTH)/2;
	var yPos = (clientHeight - HEIGHT)/2;
	winId.moveTo(xPos,yPos);
}

posAtual = 0;
function passaPos(a) {
	var tit=['FGV Management','Ohio University','Inbrape'];
	var img=['fgv','ohio','inbrape'];
	posAtual = parseInt((a=='+' ? (posAtual<2?posAtual+1:0) : (posAtual>0 && posAtual<=2 ? posAtual-1 : 2)));
	$("#pos_imagem").html('<img src="img/pos/logo_'+img[posAtual]+'.gif" width="146" height="69" />');
	$("#pos_nome").html(tit[posAtual]);
}

function showMapa() {
	$("#divMapa").slideToggle();
}

function mostraChamada(i) { var ar1=[10,9,8,7]; var ar2=[9,10,8,7]; var ar3=[8,9,10,7];	var ar4=[7,8,9,10]; for(a=1;a<=4; a++) { if(a!=i) { $("#chamContent"+a).hide(); } else { $("#chamContent"+a).show(); } $("#chama"+a).css('z-index', eval('ar'+i)[a-1]); $("#chamMark"+a).css('marginLeft','-22px'); } for(b=i-1;b>=1; b--) { $("#chamMark"+b).css('marginLeft','-260px'); }}

var timeouti = 0;
function passaTempo(t) {
	timeouti = setTimeout("slide('+')",t*1000);
}

var slideatual = 0;
function slide(d) {
	clearTimeout(timeouti);
	var s = $("li", $('#slider')).length-1;
	if(d=='+' || d=='-') { 
		slideatual = parseInt((d=='+' ? (slideatual<s?slideatual+1:0) : (slideatual>0 && slideatual<=s ? slideatual-1 : s)));
	} else {
		slideatual = parseInt(d);
	}
	$("#slider").stop().scrollTo('li:eq('+slideatual+')',800);
	mostraChamada(slideatual+1);
	passaTempo(temposCham[slideatual]);
}