	
	// JavaScript Document

	//
	//	funcMielar.js
	//	Fecha de creacion: 21 / 10 / 2010
	//	Descripción: Contiene funciones para las transiciones de Mielar
	//

	var ocultoSubmenu = true;
	var productosInfoDesplegado = new Array ();

	function enviarFormContacto ()
	{
		var nombre		= $('contactoNom').value;
		var empresa	 	= $('contactoEmpresa').value;
		var adreca	 	= $('contactoAdreca').value;
		var poblacio 	= $('contactoPoblacio').value;
		var pais	 	= $('contactoPais').value;
		var coments	 	= $('contactoComents').value;
		var email	 	= $('contactoMail').value;
		var codipostal 	= $('contactoCodPostal').value;
		var provincia	= $('contactoProvincia').value;
		var telefono	= $('contactoTelefon').value;
		var polCheck	= $('contactoCheckPolitica').checked;
		
		var correcto 	= true;
		
		if ( ( nombre == "" ) || ( empresa == "" ) || ( adreca == "" ) || ( poblacio == "" ) || ( pais == "" ) || ( coments == "" ) || ( email == "" ) || ( codipostal == "" ) || ( provincia == "" ) || ( telefono == "" ) )
		{
			correcto = false;
			
			mostrarAlert ( "rellenacampos" );
		}
		else if ( validaEmail ( email ) == false )
		{
			correcto = false;
			
			mostrarAlert ( "formatoemail" );
		}
		else if ( validaTelefono ( telefono ) == false )
		{
			correcto = false;
			
			mostrarAlert ( "formatotelefono" );
		}
		else if ( polCheck == false )
		{
			correcto = false;
			
			mostrarAlert ( "politica" );
		}
		
		if ( correcto )
		{
			document.getElementById("formularioContacto").submit();
		}
	}

	function mostrarSubmenuProductos()
	{
		if ( ocultoSubmenu ) 
		{
			aparecerDiv('MielarSubmenu', 1.0);
			
			ocultoSubmenu = false;
		}
		
		return false;
	}
	
	function ocultarSubmenuProductos ()
	{
		if ( ocultoSubmenu == false ) 
		{
			desaparecerDiv('MielarSubmenu', 0.5);
			
			ocultoSubmenu = true;
		}
		
		return false;
	}
	
	function mostrarApartadoProducto ( nameProducto , idApartado )
	{
		var bloqueProducto = 'block' + nameProducto;
		var bloqueApartado = bloqueProducto + 'Sub' + idApartado;
		
		desaparecerDivAndAparecerDiv ( bloqueProducto , 1.0 , bloqueApartado , 1.0 );
	}
	
	function ocultarApartadoProducto ( nameProducto , idApartado )
	{
		var bloqueProducto = 'block' + nameProducto;
		var bloqueApartado = bloqueProducto + 'Sub' + idApartado;
		
		desaparecerDivAndAparecerDiv ( bloqueApartado , 1.0 , bloqueProducto , 1.0 );
	}
	
	function interactuarInfoProducto ( idProducto )
	{
	  if ( isProductoDesplegado ( idProducto ) )
	  {
	    if ( effectoDisponible ( 'descProducto' + idProducto ) )
	    {
	      plegarDiv ( 'descProducto' + idProducto , 1.0 );
	      document.getElementById( 'titleProducto' + idProducto ).className = 'divProductosTablaInformaciónInnerProductos_Title';
	    
	      productosInfoDesplegado [ idProducto ] = false;
	    }
	  }
	  else
	  {
	    if ( effectoDisponible ( 'descProducto' + idProducto ) )
      {
	      desplegarDiv ( 'descProducto' + idProducto , 1.0 );
	      document.getElementById( 'titleProducto' + idProducto ).className = 'divProductosTablaInformaciónInnerProductos_TitleDesplegado';
	    
	      productosInfoDesplegado [ idProducto ] = true;
	    }
	  }
	}
	
	function isProductoDesplegado ( idProducto )
  {
    if ( idProducto == null ) return false;
    
    if ( productosInfoDesplegado [ idProducto ] == null ) productosInfoDesplegado [ idProducto ] = false;
    
    return productosInfoDesplegado [ idProducto ];
  }

