$(document).ready(function() {
	$(window).resize(function() {
		enviarAnchoBrowser();
	});
});
function getURLSite() {
	return "http://www.buencafe.com/es/";
}function getURLConoceFamilia() {	return "http://www.cafedecolombia.com/familia";}
function redirectURL(url) {
	window.location.replace(url);
}
function setURL(id, estadoActivadoIrA) {
	var flashObj = document.getElementById('flashHome');
	flashObj.setURL(id, estadoActivadoIrA);
}
function setValuePorNavegadorFunction(estado) {
	var flashObj = document.getElementById('flashHome');
	flashObj.setValuePorNavegadorFunction(estado);
}
function mostrarContactenos(estado, estadoanimacion) {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarContactenos(estado, estadoanimacion);
}
function mostrarMapaSitio(estado, estadoanimacion) {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarMapaSitio(estado, estadoanimacion);
}
function mostrarFotoGrande(imagen) {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarFotoGrande(imagen);
}
function mostrarCargando() {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarCargando();
}
function ocultarCargando() {
	var flashObj = document.getElementById('flashHome');
	flashObj.ocultarCargando();
}
function mostrarFoto3D(imagen, titulo, descripcion) {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarFoto3D(imagen, titulo, descripcion);
}
function mostrarFoto3D(imagen, titulo, contenido) {
	var flashObj = document.getElementById('flashHome');
	flashObj.mostrarFoto3D(imagen, titulo, contenido);
}
function cargarFotoFondo(imagen, alineacion) {
	var flashObj = document.getElementById('flashHome');
	flashObj.cargarFotoFondo(imagen, alineacion);
}
function initFlash() {
	enviarAnchoBrowser();
}
function enviarAnchoBrowser() {
	var flashObj = document.getElementById('flashHome');
	flashObj.cargarAnchoBrowser($(window).width(), $(window).height());
}
function mostrarMapa(tipo)
{
	if($(window).width() > 1000  && $(window).height() > 440)
	{
		if(tipo == "nuestrasOficinas")
			{
			abrirIFrame("cms/mapa/mapaNew.html", 1000, 440, 'auto');
			}
			else
			{
			abrirIFrame("cms/mapa/mapa.html", 1000, 440, 'auto');
			}
		
	}
	else
	{
		if(tipo == "nuestrasOficinas")
		{
		abrirIFrame("cms/mapa/mapaNew.html", $(window).width() - 30, $(window).height() - 30, 'auto');
		}
		else
		{
		abrirIFrame("cms/mapa/mapa.html", $(window).width() - 30, $(window).height() - 30, 'auto');
		}
	}	
}
function mostrarProcesoDeProduccion()
{	
	if($(window).height() < 538 )
	{
		abrirIFrame("ProcesosdeProduccion.html",  ($(window).height() - 30) / .67, $(window).height() - 30, 'auto');
	}
	else
	{
		abrirIFrame("ProcesosdeProduccion.html",  788, 538, 'auto');
	}
	
}
function mostrarNuestraHistoria()
{
	abrirIFrame("timeline/deploy/index.html", 795 , 478, 'auto');
}
function mostrarTaylorMade()
{
	abrirIFrame("taylormade.html", 815, 565, 'auto');
}

function abrirIFrame(url, x, y, visibleScroll) {
	$.fancybox(
	{
		'padding': 0,
		'margin': 0,
		'autoScale': 'false',
		'width': x - 20,
		'height': y - 10,
		'href': url,
		'type': 'iframe',
		'scrolling': visibleScroll

	}
);
}

function alerta(texto)
{
	alert(texto);
}
