/*////////////////////////////////////////////////////////////////////////////*/

function eventosorder(){
	
	$(".order_bt").click(function(){
		
		$("#popupsample").fadeIn();
		
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/index/samplepopup",
			 type    : "POST",
			 data: {
				valor : $(this).attr("name"),
				ref : $(this).attr("ref")
			 },
			 timeout   : 30000,
			 success   : function(response){
			 		$("#popupsample").html(response);
			 }	 
		 });
	});

}


/*///////////////////////////////////////////////////////////////////////////*/

var cambiarreel=function(){
	
	
	
	
	var mostrarCre = function(){
		$(this).delay(3000, function(){
			//$("#imgreel2").fadeOut();
			//$("#imgreel3").fadeOut();
		});
		
		//mostrarDre();
	}
	
	var mostrarBre = function(){
		$(this).delay(1500, function(){
			$("#imgreel1").show();
		});
			mostrarCre();
	}
	
	$("#imgreel1").hide();
	$("#imgreel2").hide();
	
	
	$(this).delay(1500,function(){
		$("#imgreel2").show();
	
		mostrarBre();
	});
}



var mostrarAP=function(){
	var mostrarDP = function(){
		$(this).delay(4000, function(){
			$("#cabecerapequena").hide(1,function(){
			$("#cabecerapequena").html("<li>Blunt DNA cloning with less than 1% background</li><li>Not a troublesome positive selection vector</li><li>Cloning possible with 0,1 ng of non-optimized PCR</li>");
			$("#cabecerapequena").show();
		});
			mostrarAP();
		});
	}
	
	var mostrarCP = function(){
		$(this).delay(4000, function(){
			$("#cabecerapequena").hide(1,function(){
			$("#cabecerapequena").html("<li>Compatible with blue/white screening</li><li>Less cloning problems & artifacts than any other technology</li> ");
			$("#cabecerapequena").show();
		});
			mostrarDP();
		});
	}
	
	
	
	var mostrarBP = function(){
		$(this).delay(4000, function(){
			$("#cabecerapequena").hide(1,function(){
			$("#cabecerapequena").html("<li>In just 35 min from PCR end to plating</li><li>Without any additional step after PCR</li><li>Compatible with all your current protocols</li>");
			$("#cabecerapequena").show();
		});
			mostrarCP();
		});
	}
	
	$(this).delay(4000,function(){
		$("#cabecerapequena").hide(1,function(){
			$("#cabecerapequena").html("<li>No special strain, media or protocol needed</li><li>Over 2000 positive colonies</li><li>With just 5ng per kb of insert</li>");
			$("#cabecerapequena").show();
		});
		
		
		mostrarBP();
	});
}


var mostrarA=function(){
	var mostrarB = function(){
		$(this).delay(9000, function(){
			$("#listagrandepropiedades").hide(1,function(){
			$("#listagrandepropiedades").html("<li>Blunt DNA cloning with less than 1% background</li><li>Not a troublesome positive selection vector</li><li>Cloning possible with 0,1 ng of non-optimized PCR</li><li>No special strain, media or protocol needed</li><li>Less cloning problems & artifacts than any other technology</li>");
			$("#listagrandepropiedades").show();
		});
			mostrarA();
		});
	}
	
	$(this).delay(9000,function(){
		$("#listagrandepropiedades").hide(1,function(){
			$("#listagrandepropiedades").html("<li>With just 5ng per kb of insert</li><li>In just 35 min from PCR end to plating</li><li>Without any additional step after PCR</li><li>Compatible with all your current protocols</li><li>Compatible with blue/white screening</li>");
			$("#listagrandepropiedades").show();
		});
		
		
		mostrarB();
	});
}

function mostrarpropiedades(){
	mostrarA();
}

function mostrarpropiedadespeque(){
	
	mostrarAP();
}

function eventosdistribuidorweb()
{
	
	$("tr").click(function(){
		
		var iddistr=$(this).attr("numfila");
		
		
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/distributors/viewdistributor",
			 type    : "POST",
			 data :  {
			 			id : iddistr
			 						 			
			 	     },	
			 timeout   : 30000,
			 
			 success   : function(response){
			 		$("#contenido").html(response);
			 	}
			 
		 });	
		
	
	
	});
	
}

function eventosnoticiasweb(){

	$("#btnbusqueda").click(function(){
		
		valorbusqueda=$("#cuadrobusqueda").attr("value");
		
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/news/busqueda",
			 type    : "POST",
			 data :  {
			 			valorbusqueda : valorbusqueda
			 						 			
			 	     },	
			 timeout   : 30000,
			 
			 success   : function(response){
			 		$("#firstrow").html(response);
			 	}
			 
		 });	
		
	});
	
	 /*$("a.btnPaginacion").click(function(){
			$.ajax({
				async	  : true,
				url       : baseURL + "/web/news/paginar",
				type      : "POST",
				data	  : {
					 page : $(this).attr("numpag")
				},
				timeout   : 30000,
				success   : function(response){
			 		$("#firstrow").html(response);
			 	}
			});
		 });
*/
}

function eventosindexweb(){

	$("#btnbusqueda").click(function(){
		
		valorbusqueda=$("#cuadrobusqueda").attr("value");
		
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/index/busqueda",
			 type    : "POST",
			 data :  {
			 			valorbusqueda : valorbusqueda
			 						 			
			 	     },	
			 timeout   : 30000,
			 
			 success   : function(response){
			 		$("#productview").html(response);
			 	}
			 
		 });	
		
	});
	
	
	
	
}

	
function eventosproductsweb(){

/*	$("tr").click(function(){
		
		var idcat=$(this).attr("numfila");
		var idcatsub=$(this).attr("numfilasub");
		
				
		if (idcat>0)
		{
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/product/catalogo",
			 type    : "POST",
			 data :  {
			 			id : idcat
			 						 			
			 	     },	
			 timeout   : 30000,
			 
			 success   : function(response){
			 		$("#subcategorias").html(response);
			 	}
			 
		 });	
		$.ajax({
			 async	: true,
			 url	: baseURL + "/web/product/catalogoprod",
			 type    : "POST",
			 data :  {
			 			idcat : idcat
			 						 			
			 	     },	
			 timeout   : 30000,
			 
			 success   : function(response){
			 		$("#first").html(response);
			 	}
			 
		 });
		}
		if(idcatsub>0)
		{
			$.ajax({
				 async	: true,
				 url	: baseURL + "/web/product/catalogoprod",
				 type    : "POST",
				 data :  {
				 			idcatsub : idcatsub
				 						 			
				 	     },	
				 timeout   : 30000,
				 
				 success   : function(response){
				 		$("#first").html(response);
				 	}
				 
			 });
		}
		
		
		
	});*/
	
}	
	
	
	

