/*===================================================================================*/
function objetoFlash(nombre, ancho, alto, vars) 
{
    if (AC_FL_RunContent == 0) 
	{
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } 
	else 
	{
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', ancho,
            'height', alto,
            'src', nombre,
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'transparent',
            'devicefont', 'false',
            'id', nombre,
            'bgcolor', '#ffffff',
            'name', nombre,
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/' + nombre,
            'salign', '',
            'flashvars', vars
            ); 
    }
}
/*===================================================================================*/
function comprobar_form_contacto()
{
	var f=document.getElementById('form_contacto');
	var errores='';

	if(!f.nombre.value.length) errores+='\nIntroduzca su nombre';
	if(!validar_telefono(f.telefono.value)) errores+='\nIntroduzca un telefono valido';
	if(!validar_email(f.email.value)) errores+='\nIntroduzca un email valido';
	
	if(!errores.length)
	{
		f.submit();
	}
	else
	{
		alert('Por favor:'+errores);
	}
}

function validar_telefono(valor)
{
	if (valor.length==9 && parseInt(valor)==valor) return true;
	else return false;	
}

function validar_email(valor)
{	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)) return (true)
	else return (false);
}

function obtener_dimensiones_chrome()
{
	var alto;
	var ancho;

	if(window.innerWidth) 
	{
		ancho=window.innerWidth;
		alto=window.innerHeight;
	} 
	else if(document.documentElement && document.documentElement.clientWidth) 
	{
		ancho=document.documentElement.clientWidth;
		alto=document.documentElement.clientHeight;
	} 
	else if(document.body) 
	{
		ancho=document.body.clientWidth;
		alto=document.body.clientHeight;
	}

	var resultado=Array(ancho, alto);

	return resultado;
}

