function fAtualizaValores(InCdCampoAcao,InCdCampoAtualizar,InCdValor) {
		window.open("anuncio_atualizacampos.asp?InCdCampoAcao=" + InCdCampoAcao + "&InCdCampoAtualizar=" + InCdCampoAtualizar + "&InCdValor=" + InCdValor,"iframeOculto" + InCdCampoAtualizar)
	}
	function senha() {
		topo = (screen.height - 250) / 2
		esquerda = (screen.width - 400) / 2
		window.open("anuncios_senha.asp","_blank","width=370,height=250,top=" + topo + ",left=" + esquerda);
	}
	
	function fSelVersao() {
		if(formulario.Campo3.value=='')
			alert("Primeiro selecione um modelo")
		else {
			topo = (screen.height - 250) / 2
			esquerda = (screen.width - 430) / 2
			window.open("anuncios_busca_versao.asp?InCdModelo=" + formulario.Campo3.value,"_blank","width=400,height=250,top=" + topo + ",left=" + esquerda + ",scrollbars=yes");
		}
	}
	
	function fAbreGaleria(InCdMateria) {
		topo = 0
		esquerda = (screen.width - 778) / 2
		window.open("galeria_foto.asp?InCdMateria=" + InCdMateria,"_blank","width=778,height=563,top=" + topo + ",left=" + esquerda);
	}

	function abrefoto(foto,largura,altura)
	{
		window.open('foto.asp?InCdFoto=' + foto,'_blank','scrollbars=yes,resizible=no,toolbar=no,location=no,status=yes,menubar=no,width='+largura+',height='+altura+',top=1,left=1')
	}
	function popupSenha()
	{
		largura = 300;
		altura = 200;
		window.open('envio_senha.asp','_blank','scrollbars=yes,resizible=no,toolbar=no,location=no,status=yes,menubar=no,width='+largura+',height='+altura+',top=1,left=1')
	}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {


	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	if(newWindow) {
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click screen to close" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
	}
}

function popup()	{
	window.open ('http://www.revistaferroviaria.com.br/popup/nt2008.html','_blank','width=230px,height=160px,scrollbars=no');
}

function traduzirEN(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=en', '_blank');
}

function traduzirES(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=es', '_blank');
}

function traduzirDE(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=de', '_blank');
}

function traduzirCN(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=zh-CN', '_blank');
}

function traduzirJA(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=ja', '_blank');
}

function traduzirFR(Url)	{
	window.open('http://translate.google.com/translate?u='+Url+'&hl=pt-BR&ie=UTF-8&sl=pt&tl=fr', '_blank');
}
function setChangeRotator() {
/*	intval = window.setInterval('changeRotator()', 6000); */
}
function changeRotator() {
	r_id = document.getElementById('id_rotator').value + '';
	document.getElementById('tr_rotator'+r_id+'_1').style.display='none';
	document.getElementById('tr_rotator'+r_id+'_2').style.display='none';
	
	if (r_id == document.getElementById('max_id_rotator').value) {
		r_id = 1;
	}
	else {
		r_id = parseInt(r_id)+1 + '';
	}
	document.getElementById('id_rotator').value = r_id;
	document.getElementById('tr_rotator'+r_id+'_1').style.display='';
	document.getElementById('tr_rotator'+r_id+'_2').style.display='';
}
function changeRotatorM(r_id_1,r_id_2) {
	document.getElementById('tr_rotator'+r_id_1+'_1').style.display='none';
	document.getElementById('tr_rotator'+r_id_1+'_2').style.display='none';
	document.getElementById('id_rotator').value = r_id_2;
	document.getElementById('tr_rotator'+r_id_2 + '_1').style.display='';
	document.getElementById('tr_rotator'+r_id_2 + '_2').style.display='';
	window.clearInterval(intval);
	intval = window.setInterval('changeRotator()', 6000);
}

/////////////////////////////////////////////////


function setChangeRotator2() {
/*	intval2 = window.setInterval('changeRotator2()', 6000); */
}
function changeRotator2() {
	r_id2 = document.getElementById('id_rotator2').value + '';
	document.getElementById('tr_rotator2'+r_id2+'_1').style.display='none';
	/*document.getElementById('tr_rotator2'+r_id2+'_2').style.display='none';*/
	
	if (r_id2 == document.getElementById('max_id_rotator2').value) {
		r_id2 = 1;
	}
	else {
		r_id2 = parseInt(r_id2)+1 + '';
	}
	document.getElementById('id_rotator2').value = r_id2;
	document.getElementById('tr_rotator2'+r_id2+'_1').style.display='';
	//document.getElementById('tr_rotator2'+r_id2+'_2').style.display='';
}
/*function changeRotatorM2(r_id2_1,r_id2_2) {
	document.getElementById('tr_rotator2'+r_id2_1+'_1').style.display='none';
	document.getElementById('tr_rotator2'+r_id2_1+'_2').style.display='none';
	document.getElementById('id_rotator2').value = r_id2_2;
	document.getElementById('tr_rotator2'+r_id2_2 + '_1').style.display='';
	document.getElementById('tr_rotator2'+r_id2_2 + '_2').style.display='';
	window.clearInterval(intval2);
	intval2 = window.setInterval('changeRotatorM2()', 2000);
}*/

function changeRotatorM2(r_id2_1,r_id2_2) {
	document.getElementById('tr_rotator2'+r_id2_1+'_1').style.display='none';
	//document.getElementById('tr_rotator2'+r_id2_1+'_2').style.display='none';
	document.getElementById('id_rotator2').value = r_id2_2;
	document.getElementById('tr_rotator2'+r_id2_2 + '_1').style.display='';
	//document.getElementById('tr_rotator2'+r_id2_2 + '_2').style.display='';
	window.clearInterval(intval2);
	intval2 = window.setInterval('changeRotatorM2()', 6000);
}

function getPos(el,sProp) {
	var iPos = 0
	while (el!=null) {
		iPos+=el["offset" + sProp]
		el = el.offsetParent
	}
	return iPos

}

var t;
function show(el,m) {

	if (el=='hide') {
		var timeoutFunc = function () { m.style.display='none' };
	    t=window.setTimeout(timeoutFunc, 500);
	}
	else {
	
	if (m) {
		clearTimeout(t);			
		m.style.display='';
		m.style.left = parseInt(parseInt(getPos(el,"Left")) + parseInt(el.offsetWidth)) + 'px';
		m.style.top = parseInt(getPos(el,"Top")) + 'px';
	}
	if ((m!=cm) && (cm)) cm.style.display='none'
	}
	cm=m
	
	
}

function fReset() {
	
}
function chkLoginLayer(InCdSecao) {
	formLogin.action = "index_nova.asp?TxAcao=login&TxTipo=A&p1=index_nova.asp&p2=InCdSecao%3D" + InCdSecao;
	document.getElementById('divLogin').style.display = '';
}
