  function subs(prov)
  {
   if(prov=='productos.html')
   {
  	document.getElementById('def').style.display='none';
  	document.getElementById('subprod').style.display='block';
  	document.getElementById('subproy').style.display='none';
  	document.getElementById('subexps').style.display='none';
   }
   else if(prov=='proyectos.html')
   {
  	document.getElementById('def').style.display='none';
  	document.getElementById('subprod').style.display='none';
  	document.getElementById('subproy').style.display='block';
  	document.getElementById('subexps').style.display='none';
   }
   else if(prov=='expositores.html')
   {
  	document.getElementById('def').style.display='none';
  	document.getElementById('subprod').style.display='none';
  	document.getElementById('subproy').style.display='none';
  	document.getElementById('subexps').style.display='block';
   }
  }

  function subt(prov)
  {
   if(prov=='productos.html')
   {
		location.href="todos-productos.html";
		return false;
   }
   else if(prov=='proyectos.html')
   {
		location.href="todos-proyectos.html";
		return false;
   }
   else if(prov=='expositores.html')
   {
		location.href="todos-expositores.html";
		return false;
   }
  }
  function subcat(sb,foto)
  {
   if (document.getElementById('f'+foto)!=''){
	 		document.getElementById('expfrase').innerHTML=document.getElementById('f'+foto).innerHTML;
		}
   else  {
   		document.getElementById('expfrase').innerHTML="<div id='f'></div>\n";
   	} 
  }

function chck()
{
 if (dades.Nom.value=='') 
 {
  alert("Por favor, déjenos nombre y apellidos");
  dades.Nom.focus();
 }
 else if (dades.Tel.value=='') 
 {
  alert("Por favor, déjenos el número de teléfono");
  dades.Tel.focus();
 }
 else
{
  document.dades.submit();
}
}

function sss(from)
{
   var field = document.mailsnews.email;
   var str = field.value;
   if (window.RegExp) 
    {
        var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
        var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
        var reg1 = new RegExp(reg1str);
        var reg2 = new RegExp(reg2str);
        if (reg1.test(str) || !reg2.test(str))
        {
            txtf="La dirección de email parece incorrecta. Por favor, compruébela.";
            field.focus();
            field.select();
            var algunomal=1;
        }
    } 
    else 
    {
        if(str.indexOf("@") < 0)
        {
            txtf="La dirección de email parece incorrecta. Por favor, compruébela.";
            field.focus();
            field.select();
            var algunomal=1;
        }
    }
   if(algunomal) {alert(txtf); return false;}
   else return true;
}

$(document).ready(
	function()
	{
		createGradient();
 	  $('.catrg').mouseover(
 	  function()
		{
 		  var m=$(this).attr("href");
 		  // alert(m);
 		  subs(m);
 		  if(m=="productos.html")
				$("#subsub").show("slow");
			else
				$("#subsub").hide("slow"); 
		}); // closes mouseover of class catrg
		
 	  $('.catrg').click(
 	  function()
		{
 		  var m=$(this).attr("href");
			subt(m);
			return false;
		});	// closes click of class catrg
				
		$(".catg").mouseover(
		function()
		{
 		  var t="t="+$(this).attr("href");
//			alert(t);
 		  $.ajax({   
      	method: "get",url: "subsub.php",data: t,
      	//show loading just when link is clicked
				beforeSend: function(){$("#subsub").html('<img src="img/ajax-loader.gif" id="loading" />');}, 
				//stop showing loading when the process is complete   
        complete: function(){ $("#loading").hide('fast');}, 
        success: function(quera,status)
        { 
          //so, if data is retrieved, store it in html
          if(quera!="")
							$('#subsub').html(quera);
	/*				else
					{
						  $("#subsub").html('');
					    // $('#subsub').css('display','none');
					}  */
	      }   
      }); /* close $.ajax( */
		}); //closes mouseover of .catg
		$(".catg").mouseout(
		function()
		{
			// $("#subsub").html('');
		}); //closes mouseout of .catg
	}); //closes ready 