 // JavaScript Document
WebURL = document.location.href;
if(WebURL.indexOf('a1s0001')!=-1 || WebURL.indexOf('13521')!=-1){
	if(WebURL.indexOf('7')!=-1 || WebURL.indexOf('13521')!=-1){
		var rootSite = '/';
	}else{
		var rootSite = '/AGF/Reformulacao_Site_institucional/Tecnologia/Final/';
	}
}else{
	if(WebURL.indexOf('a1.com.br')!=-1){
		var rootSite = '/clientes/agf_novo/';
	}else{
		//var rootSite = '/novo/';
		var rootSite = '/';
	}
}

//alert(rootSite);
function AbrePopup1(l,a,url){
	var x = parseInt((screen.width-l)/2);
	var y = parseInt((screen.height-a)/2);
	var win = window.open(url,'transito','status=yes,resizable=no,scrollbars=yes,menubar=no,width='+l+',height='+a);
	win.moveTo(x,y);
}

function AbrePopup(l,a,url){
	var x = parseInt((screen.width-l)/2);
	var y = parseInt((screen.height-a)/2);
	var win = window.open(url,'transito','status=yes,resizable=no,scrollbars=auto,menubar=no,width='+l+',height='+a);
	win.moveTo(x,y);
}
function elemento(e){
	return document.getElementById(e)	
}
function decadaMostra(decada) {

	var decadas = document.getElementsByTagName("div");
	for (var i = 0; i < decadas.length; i++) {
		if (decadas[i].className == 'decadas') {
			decadas[i].style.display = 'none';
		}
	}
	document.getElementById(decada).style.display = 'block';
	document.getElementById(decada).className = 'decada';
}

function circuitoMostra(circuito) {

	var circuitos = document.getElementsByTagName("div");
	for (var i = 0; i < circuitos.length; i++) {
		if (circuitos[i].className == 'circuito') {
			circuitos[i].style.display = 'none';
		}
	}
	document.getElementById(circuito).style.display = 'block';
}

function cvMostra(cv) {

	var cvs = document.getElementsByTagName("div");
	for (var i = 0; i < cvs.length; i++) {
		if (cvs[i].className == 'cv') {
			cvs[i].style.display = 'none';
			document.getElementById(cvs[i].id + "_link").style.backgroundColor = '';
		}
	}
	document.getElementById(cv).style.display = 'block';
	document.getElementById(cv + "_link").style.backgroundColor = '#eeeeee';
}

function tipoMostra(tipo) {

	var tipos = document.getElementsByTagName("td");
	for (var i = 0; i < tipos.length; i++) {
		if (tipos[i].className == 'formTipo') {
			tipos[i].style.display = 'none';
		}
	}
	document.getElementById(tipo.value).style.display = 'block';
}

function OpenTitulo(h){
	if(h!='' && h == undefined){
		document.getElementById("TituloFlash").height=h;
		document.getElementById("TituloFlash2").height=h;
	}
}

function flash(swf,w,h){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="CodeFlash" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="movie" value="'+swf+'" /><param name="quality" value="hight" /><param name="bgcolor" value="#ffffff" /><embed src="'+swf+'" wmode="transparent" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" id="flash" name="CodeFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function FlashDiv(swf,w,h,div){
	var txtHome = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="CodeFlash" align="middle">';
	var	txtHome = txtHome + '<param name="allowScriptAccess" value="sameDomain" />';
	var	txtHome = txtHome + '<param name="wmode" value="transparent" />';
	var	txtHome = txtHome + '<param name="movie" value="'+swf+'" /><param name="quality" value="hight" /><param name="bgcolor" value="#ffffff" /><embed src="'+swf+'" wmode="transparent" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" id="CodeFlash1" name="CodeFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	var	txtHome = txtHome + '</object>';

	document.getElementById(div).innerHTML = txtHome;
}

function FlashHomeForum(){
	cacheKill = new Date().getTime();
	var txtHome = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"348\" height=\"71\">';
	var	txtHome = txtHome + '	<param name=\"FlashVars\" value=\"rootSite='+rootSite+'\">';		
	var	txtHome = txtHome + '	<param name=\"movie\" value=\"'+rootSite+'imagens/swf/flash_destaque_inferior.swf?'+cacheKill+'\">';
	var	txtHome = txtHome + '	<param name=quality value=high>';
	var	txtHome = txtHome + '	<param name=\"wmode\" value=\"transparent\">';
	var	txtHome = txtHome + '	<embed src=\"'+rootSite+'imagens/swf/flash_destaque_inferior.swf?'+cacheKill+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" flashvars=\"rootSite='+rootSite+'\" width=\"348\" height=\"71\" wmode=\"transparent\"></embed>';
	var	txtHome = txtHome + '</object>';
	
	document.write(txtHome);
	//document.getElementById('flash').innerHTML = txtHome;
}

function FlashMenu1(NomePagina, Nivel){
	if(Nivel!=''){NomePagina = Nivel;}
	document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"770\" height=\"26\" id=\"titulo\" align=\"middle\">');
	document.write('	<param name=\"allowScriptAccess\" value=\"sameDomain\">');
	document.write('	<param name=\"FlashVars\" value=\"link='+NomePagina+'&rootSite='+rootSite+'\">');
	document.write('	<param name=\"movie\" value=\"'+rootSite+'includes/swf/menu1.swf\">');
	document.write('	<param name=\"quality\" value=\"high\">');
	document.write('	<param name=\"wmode\" value=\"transparent\">');
	document.write('	<param name=\"bgcolor\" value=\"#ffffff\">');
	document.write('	<embed src=\"'+rootSite+'includes/swf/menu1.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"770\" height=\"26\" name=\"titulo\" wmode=\"transparent\" flashvars=\"link='+NomePagina+'&rootSite='+rootSite+'\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">');
	document.write('</object>');
}
function FlashHomeExpansivel(){
	cacheKill = new Date().getTime();
	var txtHome = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"770\" height=\"313.4\">';
	var	txtHome = txtHome + '	<param name=\"FlashVars\" value=\"rootSite='+rootSite+'\">';		
	var	txtHome = txtHome + '	<param name=\"movie\" value=\"'+rootSite+'includes/swf/destaques_flash_area/basev2.swf?'+cacheKill+'\">';
	var	txtHome = txtHome + '	<param name=quality value=high>';
	var	txtHome = txtHome + '	<param name=\"wmode\" value=\"transparent\">';
	var	txtHome = txtHome + '	<embed src=\"'+rootSite+'includes/swf/destaques_flash_area/basev2.swf?'+cacheKill+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" flashvars=\"rootSite='+rootSite+'\" width=\"770\" height=\"313.4\" wmode=\"transparent\"></embed>';
	var	txtHome = txtHome + '</object>';
	
	document.getElementById('flash').innerHTML = txtHome;
}
function mapa2(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"80\" height=\"73\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
	document.write("<param name=\"movie\" value=\"imagens/swf/mapa_bt2.swf\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<embed src=\"imagens/swf/mapa_bt2.swf\" quality=\"high\"  width=\"80\" height=\"73\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\">");
	document.write("</object>");
}
function mostraEsconde(e,v){
		el = elemento(e);
		var s = (el.getElementsByTagName('select'));
		for (var i=0; i<s.length;i++){
			var display =  v;
			s[i].style.visibility = display;
		}
}
function cresceDiv(){
	el = elemento('flash');	
	if(el.style.clip.indexOf("165px")!=0){
		el.style.clip = "rect(auto,auto,313px,auto)";
	}else{
		el.style.clip = "rect(auto,auto,165px,auto)";
	}
	
}
function EscondeDiv(){
	el = elemento('flash');	
	el.style.clip = "rect(auto,auto,165px,auto)";
	mostraEsconde('corpo','visible');
}

function Esconde(){
document.getElementById('dhtml').style.visibility="hidden";
}


