
//// Funciones de menú:
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function sp_img_superior_menu_DoFSCommand(command, args)
{
	if (command == "mostrarMenu") mostrarMenu(args);
	if (command == "ocultarMenu") ocultarMenu(args);
}


var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function en_img_superior_menu_DoFSCommand(command, args)
{
	if (command == "mostrarMenu") mostrarMenu(args);
	if (command == "ocultarMenu") ocultarMenu(args);
}


function mostrarMenu(idioma, menu)
{
	ocultarCapa('empresa');
	ocultarCapa('productos');
	ocultarCapa('ingenieria');
	ocultarCapa('fabricacion');
	ocultarCapa('calidad');
	ocultarCapa('localizacion');
	ocultarCapa('contacto');

	apretarBoton(idioma, menu);
	mostrarCapa(menu);
}


function ocultarMenu(idioma, menu)
{
	restablecerBoton(idioma, menu);
	ocultarCapa(menu);
}


function mostrarCapa(id_capa)
{
	var capa = document.getElementById(id_capa);
	if (capa != null){
		capa.style.visibility = "visible";
		}
}


function ocultarCapa(id_capa)
{
	var capa = document.getElementById(id_capa);
	if (capa != null){
		capa.style.visibility = "hidden";
		}
}


function apretarBoton(idioma, imagen)
{
	var img = document.getElementById("bot_"+ imagen);
	img.src = "imagenes/comun/bot_"+ idioma +"_"+ imagen +"_2.gif";
	return true;
}


function restablecerBoton(idioma, imagen)
{
	var img = document.getElementById("bot_"+ imagen);
	img.src = "imagenes/comun/bot_"+ idioma +"_"+ imagen +"_1.gif";
	return true;
}


function cambiarIdioma(idioma)
{
	if (idioma == "en"){
		window.location = "en_principal.htm";
		}
	if (idioma == "pg"){
		window.location = "pg_principal.htm";
		}
	if (idioma == "sp"){
		window.location = "sp_principal.htm";
		}
}			  

//// Funciones de ventanas:
function abrirSeccion(seccion, imagen)
{
  var ventana = window.open("imagenes/"+ seccion +"/"+ imagen +".htm", imagen, "status,width=1010,height=700");
  ventana.moveTo(0, 0);
  ventana.focus();
}

function imprimir()
{
	imprimir("sp");
}

function imprimir(idioma)
{
	if (idioma == "sp"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/sp_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		var ventana = window.open("sp_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}

	if (idioma == "en"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/en_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		var ventana = window.open("en_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}

	if (idioma == "pg"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/pg_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		var ventana = window.open("pg_impresion.htm", "asistente", "scrollbars,width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}

	if (idioma == "imprimir"){
		window.print();
		}
}


function recomendar(idioma)
{
	if (idioma == "sp"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/sp_recomendar.htm", "recomendar", "status,width=610,height=450");
		var ventana = window.open("sp_recomendar.htm", "recomendar", "status,width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}

	if (idioma == "en"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/en_recomendar.htm", "recomendar", "width=610,height=450");
		var ventana = window.open("en_recomendar.htm", "recomendar", "width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}

	if (idioma == "pg"){
		//var ventana = window.open("http://www.metalurgicaprogreso.com.ar/pg_recomendar.htm", "recomendar", "width=610,height=450");
		var ventana = window.open("pg_recomendar.htm", "recomendar", "width=610,height=450");
		ventana.moveTo(200, 100);
		ventana.focus();
		}
}


function iniciar()
{
	window.setTimeout(mostrarIcono, 6000);
}


function mostrarIcono(n)
{
	var tabla = document.getElementById("icono_01");
	if (tabla != null){
		tabla.style.display = '';
		}
}

function volver(url)
{
	if (window.opener == null){
		//// No hay opener o no se puede acceder:
		//window.location = "http://www.metalurgicaprogreso.com.ar";
		window.location = "index.htm";
		}
	else{
		if (window.opener.closed){
			//// Hay opener pero no se puede acceder:
			//window.opener.location = "http://www.metalurgicaprogreso.com.ar";
			window.opener.location = "index.htm";
			}
		else{
			if (url.indexOf("principal") != -1){
				window.opener.location = "../../"+ url +".htm";
				window.close();
				return true;
				}
			if (url.indexOf("vidrio") != -1){
				window.opener.location = "../../../"+ url +".htm";
				window.close();
				return true;
				}
			window.opener.location = "../../../../"+ url +".htm";
			window.close();
			}
		}
}			  

