$(document).ready(function()
{
	$("#destacados").scrollable({ circular: true }).autoscroll(8000).navigator({ navi:'#navegador-destacado' });
	$("ul.tabs").tabs("div.pane > div.contenedor-pane", {effect: 'ajax'});	

	$("#select_provincias").bind("change", cargarDistribuidor);
	
	$("#listadoHDD").bind("change", obtenerPrecioModelo);
	$("input[name=listadoPacks]").bind("click", obtenerPrecioModelo);
	$("#cantidad").bind("change", obtenerPrecioModelo);
	
	$("#envio-soporte").bind("click", soporte);
	
	$("#envio-review").bind("click", review);
	
	$("#envio-lista").bind("click", lista);
	
	$("#envio-lista_index").bind("click", listaIndex);
	
	$("#baja-lista").bind("click", bajaLista);
	
	$("#envio-aviso").bind("click", aviso);

	$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'titlePosition'	:	'over'
	});
});

	



function cargarDistribuidor()
{
	id = $(this).val();

	$.ajax({
		type: "POST",
		url: '/distribucion/carga_distribuidores.php?provincia='+id,
		success: function(data)
		{
			$("#todos_distribuidores").html(data);
		}
	});
}

function cargarFabricante()
{
	id = $("#marcas").val();
	$.ajax({
		type: "POST",
		url: '/scripts/soporte/cargar-productos.php?id='+id,
		success: function(data)
		{
			$("#productos-soporte").html(data);
		}
	});
}

function cargarFabricanteHome()
{
	id = $("#marcas").val();
	$.ajax({
		type: "POST",
		url: '/scripts/soporte/cargar-productos-home.php?id='+id,
		success: function(data)
		{
			$("#productos-soporte").html(data);
		}
	});
}

function cargarFabricanteRenove1()
{
	id = $("#marcas1").val();
	$.ajax({
		type: "POST",
		url: '/scripts/renove/cargar-productos-renove1.php?id='+id,
		success: function(data)
		{
			$("#productos-soporte1").html(data);
		}
	});
}

function cargarFabricanteRenove2()
{
	id = $("#marcas2").val();
	$.ajax({
		type: "POST",
		url: '/scripts/renove/cargar-productos-renove2.php?id='+id,
		success: function(data)
		{
			$("#productos-soporte2").html(data);
		}
	});
}

function verSoporte()
{
	id = $("#producto").val();
	window.location = 'soporte-producto-'+id;
}

function cargarDistribuidorMapa(id)
{
	$.ajax({
		type: "POST",
		url: '/distribucion/carga_distribuidores.php?provincia='+id,
		success: function(data)
		{
			$("#todos_distribuidores").html(data);
		}
	});
}



function cargarTodosDistribuidor()
{
	$.ajax({
		type: "POST",
		url: '/distribucion/carga_distribuidores',
		success: function(data)
		{
			$("#todos_distribuidores").html(data);
		}
	});
}



function obtenerPrecioModelo()

{
	hdd = $("#listadoHDD").val();
	//packs = $("input[name=listadoPacks]:radio");
	$('input[name=listadoPacks]:radio').each(function(){
		
		//alert($(this).val());
		
		 if($(this).attr("checked"))
   			 accesorios = $(this).val();
			//document.getElementById('radio1').checked==true
			//pack = $(":checked").val();
	});
	//for(i=0;i<packs.length;i++)
    //    if(packs[i].checked) pack = packs[i].value;
	
	//pack = $('input[name="listadoPacks"]:checked').val();
	//pack = $("input:radio[name=listadoPacks]:checked").val();
	
	id = $("#id_prod").val();
	cant = $("#cantidad").val();
	//alert(hdd);
	//alert(accesorios);
	//alert(id);

	$.ajax({

		type: "POST",

		url: '/scriptsTienda/getPrecioModelo.php?id='+id+'&hdd='+hdd+'&pack='+accesorios+'&cant='+cant,

		success: function(data)

		{

			$("#config-producto").html(data);

		}

	});

}



function soporte()

{	

	var nombre = $("input[id=nombre]").val();

	var nombre_oculto = $("#nombre_oculto").val();

	var email = $("input[id=email]").val();

	var email_oculto = $("#email_oculto").val();

	var comentario = $("#comentario").val();

	var comentario_oculto = $("#comentario_oculto").val();

	var error_general = $("#error_general").val();

	var error_vacio = $("#error_vacio").val();

	var error_email = $("#error_email").val();	

	var mensaje_enviado = $("#mensaje_enviado").val();

	var texto_mensaje_enviado = $("#texto_mensaje_enviado").val();

	var error = 0;

	var error_vacio_1 = 0;	

	var error_email_1 = 0;	

	

	

	$("#notificacion").html('');	

	$("#notificacion-vacio").html('');	

	$("#notificacion-email").html('');		

if ((nombre == nombre_oculto) || (nombre == ""))

	{					

		document.getElementById("nombre").style.borderColor = "#FF0000";	

		document.getElementById("nombre").style.MozBorderRadius = "5px";

		document.getElementById("nombre").style.WebkitBorderRadius = "5px";		

		document.getElementById("nombre").style.borderRadius = "5px";			

		error_vacio_1=1;

		error=1;

	}

	else

	{

		document.getElementById("nombre").style.borderColor = "#CCC";	

		document.getElementById("nombre").style.MozBorderRadius = "5px";

		document.getElementById("nombre").style.WebkitBorderRadius = "5px";		

		document.getElementById("nombre").style.borderRadius = "5px";	

		

		

	}		

	if ((email == email_oculto) || (email == ""))

	{

		document.getElementById("email").style.borderColor = "#FF0000";

		document.getElementById("email").style.MozBorderRadius = "5px";

		document.getElementById("email").style.WebkitBorderRadius = "5px";		

		document.getElementById("email").style.borderRadius = "5px";				

		error_vacio_1=1;

		error=1;

	}

	else

	{		

		if ((validarEmail(email)) == false)

		{

			document.getElementById("email").style.borderColor = "#FF0000";	

			document.getElementById("email").style.MozBorderRadius = "5px";

			document.getElementById("email").style.WebkitBorderRadius = "5px";		

			document.getElementById("email").style.borderRadius = "5px";	

			error=1;

			error_email_1=1;

		}

		else

		{

			document.getElementById("email").style.borderColor = "#CCC";

			document.getElementById("email").style.MozBorderRadius = "5px";

			document.getElementById("email").style.WebkitBorderRadius = "5px";		

			document.getElementById("email").style.borderRadius = "5px";				

			

		}

	}

	if ((comentario == comentario_oculto) || (comentario == ""))

	{

		document.getElementById("comentario").style.borderColor = "#FF0000";	

		document.getElementById("comentario").style.MozBorderRadius = "5px";

		document.getElementById("comentario").style.WebkitBorderRadius = "5px";		

		document.getElementById("comentario").style.borderRadius = "5px";		

		error_vacio_1=1;

		error=1;

	}

	else

	{

		document.getElementById("comentario").style.borderColor = "#CCC";		

		document.getElementById("comentario").style.MozBorderRadius = "5px";

		document.getElementById("comentario").style.WebkitBorderRadius = "5px";		

		document.getElementById("comentario").style.borderRadius = "5px";		

	}	

	

	

	if (error_vacio_1 == 1)

	{

		$("#notificacion-vacio").html(error_vacio);		

		

	}

	if (error_email_1 == 1)

	{

		$("#notificacion-email").html(error_email);	

		

	}

	if ((error == 0) && (error_vacio_1 == 0) && (error_email_1 == 0))

	{

		$("#notificacion").html('');	

		$.ajax({

				type: 'GET',

				url: '/scripts/contacto/enviar.php?isAjax=1&nombre='+nombre+'&email='+email+'&comentario='+comentario,

				success: function (msg)				

				{

						$("#items-agregados > .informacion-envio").html('<div class="titulo-lightbox">'+mensaje_enviado+'</div>');

					$("#items-agregados > .informacion-envio2").html('<div class="titulo-subLightbox">'+texto_mensaje_enviado+'</div>');

					

					$("#envio-soporte").overlay({

						top: "15%",

						mask:

						{

							color: '#fff',

							loadspeed: 200,

							opacity: 0.7

						},

						closeOnClick: false,

						load: true,

						target: '#items-agregados'

					});

					

					

				}

				});

	}

	

}



function cambiarImagen(imagen)

{

		document.getElementById('principal').src = imagen;

	

}



function review()

{	



	var ruta = $("input[id=ruta]").val();

	var pais= $("#ddlNames").val();

	var mensaje_enviado = $("#mensaje_enviado").val();

	var texto_review_enviado = $("#texto_review_enviado").val();

	

	var error_vacio = $("#error_vacio").val();

	var error_vacio_1 = 0;	

	var error_email_1 = 0;	

	

	

	$("#notificacion").html('');	

	$("#notificacion-vacio").html('');	

	$("#notificacion-email").html('');		

	

	if (ruta == "")

	{					

		document.getElementById("ruta").style.borderColor = "#FF0000";	

		document.getElementById("ruta").style.MozBorderRadius = "5px";

		document.getElementById("ruta").style.WebkitBorderRadius = "5px";		

		document.getElementById("ruta").style.borderRadius = "5px";			

		error_vacio_1=1;

		error=1;

	}

	else

	{

		document.getElementById("ruta").style.borderColor = "#CCC";	

		document.getElementById("ruta").style.MozBorderRadius = "5px";

		document.getElementById("ruta").style.WebkitBorderRadius = "5px";		

		document.getElementById("ruta").style.borderRadius = "5px";	

		

		

	}		

	

		if (error_vacio_1 == 1)

	{

		$("#notificacion-vacio").html(error_vacio);		

		

	}

	if (error_vacio_1 == 0)

	{

		$.ajax({

				type: 'GET',

				url: '/scripts/review/enviar.php?isAjax=1&ruta='+ruta+'&pais='+pais,

				success: function (msg)				

				{

					$("#items-agregados2 > .informacion-envio").html('<div class="titulo-lightbox">'+mensaje_enviado+'</div>');

					$("#items-agregados2 > .informacion-envio2").html('<div class="titulo-subLightbox">'+texto_review_enviado+'</div>');

					

					$("#envio-review").overlay({

						top: "15%",

						mask:

						{

							color: '#fff',

							loadspeed: 200,

							opacity: 0.7

						},

						closeOnClick: false,

						load: true,

						target: '#items-agregados2'

					});

					

					

				}

				});

	}



	

}



function lista()
{	
	var email = $("#email").val();
		
	var error_general = $("#error_general").val();
	var error_vacio = $("#error_vacio").val();
	var error_email = $("#error_email").val();	
	var email_existe = $("#email_existe").val();	
	var confirmar_alta_tit = $("#confirmar_alta_tit").val();
	var confirmar_alta_texto = $("#confirmar_alta_texto").val();

	var error = 0;

	var error_vacio_1 = 0;	

	var error_email_1 = 0;	



	$("#notificacion").html('');	
	$("#notificacion-vacio").html('');	
	$("#notificacion-email").html('');		
	if (email == "")
	{
		document.getElementById("email").style.borderColor = "#FF0000";	
		error_vacio_1=1;
		error=1;
	}
	else
	{
		if ((validarEmail(email)) == false)
		{
			document.getElementById("email").style.borderColor = "#FF0000";	
			error=1;
			error_email_1=1;
		}
		else
		{
			document.getElementById("email").style.borderColor = "#CCC";	
		}
	}
	

	if (error_vacio_1 == 1)
	{
		$("#notificacion-vacio").html(error_vacio);	
	}
	if (error_email_1 == 1)
	{
		$("#notificacion-email").html(error_email);	
	}

	if ((error == 0) && (error_vacio_1 == 0) && (error_email_1 == 0))
	{
		$("#notificacion").html('');			

		$.ajax({
				type: 'GET',
				url: '/scripts/boletin/boletin?isAjax=1&email='+email, 
				success: function (msg)
				{	
					if (msg == 0)
					{	
						$("#notificacion").html(email_existe);
						error = 1;			
					}
					if (msg == 1)
					{

						$("#items-agregados3 > .informacion-envio").html('<div class="titulo-lightbox">'+confirmar_alta_tit+'</div>');
						$("#items-agregados3 > .informacion-envio2").html('<div class="titulo-subLightbox">'+confirmar_alta_texto+'</div>');
						$("#envio-lista").overlay({
							top: "15%",
							mask:
							{
								color: '#fff',
								loadspeed: 200,
								opacity: 0.7
							},
							closeOnClick: false,
							load: true,
							target: '#items-agregados3'
						});
					}
				}
				});
	}
}

function listaIndex()

{	

	var email = $("#email").val();

	var email_oculto = $("#email_oculto").val();	

	var error_general = $("#error_general").val();

	var error_vacio = $("#error_vacio").val();

	var error_email = $("#error_email").val();	

	var email_existe = $("#email_existe").val();	

	var confirmar_alta_tit = $("#confirmar_alta_tit").val();

	var confirmar_alta_texto = $("#confirmar_alta_texto").val();

	var error = 0;

	var error_vacio_1 = 0;	

	var error_email_1 = 0;	



	$("#notificacion").html('');	

	$("#notificacion-vacio").html('');	

	$("#notificacion-email").html('');		

	if ((email == email_oculto) || (email == ""))

	{

		document.getElementById("email").style.borderColor = "#FF0000";	

		document.getElementById("email").style.MozBorderRadius = "5px";

		document.getElementById("email").style.WebkitBorderRadius = "5px";		

		document.getElementById("email").style.borderRadius = "5px";			

		error_vacio_1=1;

		error=1;

		

	}

	else

	{

		if ((validarEmail(email)) == false)

		{

			$("#email").html('<div style="color:#97C93E;">'+email_oculto+'</div>');				

			error=1;

			error_email_1=1;

		}

		else

		{

			$("#email").html('<div style="color:#000;">'+email_oculto+'</div>');				

		}

	}

	

	

	if (error_vacio_1 == 1)

	{

		$("#notificacion-vacio").html(error_vacio);		

		

	}

	if (error_email_1 == 1)

	{

		$("#notificacion-email").html(error_email);	

		

	}

	if ((error == 0) && (error_vacio_1 == 0) && (error_email_1 == 0))

	{

		$("#notificacion").html('');	

		

		$.ajax({

				type: 'GET',

				url: '/scripts/boletin/boletin?isAjax=1&email='+email, 

				success: function (msg)

				{	

					

					

					if (msg == 0)

					{	

						$("#notificacion").html(email_existe);		

						error = 1;			

					}

					if (msg == 1)

					{

						$("#items-agregados3 > .informacion-envio").html('<div class="titulo-lightbox">'+confirmar_alta_tit+'</div>');

						$("#items-agregados3 > .informacion-envio2").html('<div class="titulo-subLightbox">'+confirmar_alta_texto+'</div>');

						$("#envio-lista_index").overlay({

							top: "15%",

							mask:

							{

								color: '#fff',

								loadspeed: 200,

								opacity: 0.7

							},

							closeOnClick: false,

							load: true,

							target: '#items-agregados3'

						});

					}

					

					

				}

				});

	}

	

}


function bajaLista()

{	

	var email = $("input[id=email]").val();


	var email_oculto = $("#email_oculto").val();	

	var error_general = $("#error_general").val();

	var error_vacio = $("#error_vacio").val();

	var error_email = $("#error_email").val();	

	var email_no_existe = $("#email_no_existe").val();	

	var confirmar_baja_tit = $("#confirmar_baja_tit").val();

	var confirmar_baja_texto = $("#confirmar_baja_texto").val();

	var error = 0;

	var error_vacio_1 = 0;	

	var error_email_1 = 0;	



	$("#notificacion").html('');	

	$("#notificacion-vacio").html('');	

	$("#notificacion-email").html('');		

	if (email == "")

	{

		

		error_vacio_1=1;

		error=1;

		

	}

	else

	{

		if ((validarEmail(email)) == false)

		{			

			error=1;

			error_email_1=1;

		}

		else

		{

				

		}

	}

	

	

	if (error_vacio_1 == 1)

	{

		$("#notificacion-vacio").html(error_vacio);		

		

	}

	if (error_email_1 == 1)

	{

		$("#notificacion-email").html(error_email);	

		

	}

	if ((error == 0) && (error_vacio_1 == 0) && (error_email_1 == 0))

	{

		$("#notificacion").html('');	

		

		$.ajax({

				type: 'GET',

				url: '/scripts/boletin/boletin_baja?isAjax=1&email='+email, 

				success: function (msg)

				{	

					

					if (msg == 0)

					{	

						$("#notificacion").html(email_no_existe);		

						error = 1;			

					}

					if (msg == 1)

					{

						$("#items-agregados3 > .informacion-envio").html('<div class="titulo-lightbox">'+confirmar_baja_tit+'</div>');

						$("#items-agregados3 > .informacion-envio2").html('<div class="titulo-subLightbox">'+confirmar_baja_texto+'</div>');

						

						$("#baja-lista").overlay({

							top: "15%",

							mask:

							{

								color: '#fff',

								loadspeed: 200,

								opacity: 0.7

							},

							closeOnClick: false,

							load: true,

							target: '#items-agregados3'

						});

					}

					

					

				}

				});

	}

	

}



function aviso()
{		
	var email = $("#email").val();
	var email_oculto = $("#email_oculto").val();	
	var error_general = $("#error_general").val();
	var error_vacio = $("#error_vacio").val();
	var error_email = $("#error_email").val();	
	var email_existe = $("#email_existe").val();	
	var confirmar_alta_tit = $("#tit_aviso").val();
	var confirmar_alta_texto = $("#texto_aviso").val();
	var producto=$("#producto").val();

	var error = 0;
	var error_vacio_1 = 0;	
	var error_email_1 = 0;	


	$("#notificacion").html('');	
	$("#notificacion-vacio").html('');	
	$("#notificacion-email").html('');		
	
	if ((email == email_oculto) || (email == ""))
	{
		document.getElementById("email").style.borderColor = "#FF0000";	
		document.getElementById("email").style.MozBorderRadius = "5px";
		document.getElementById("email").style.WebkitBorderRadius = "5px";		
		document.getElementById("email").style.borderRadius = "5px";		
		error_vacio_1=1;
		error=1;
	}
	else
	{
		if ((validarEmail(email)) == false)
		{
			$("#email").html('<div style="color:#97C93E;">'+email_oculto+'</div>');	
			error=1;
			error_email_1=1;
		}
		else
		{
			$("#email").html('<div style="color:#000;">'+email_oculto+'</div>');
		}
	}
	if (error_vacio_1 == 1)
	{
		$("#notificacion-vacio").html(error_vacio);
	}
	if (error_email_1 == 1)
	{
		$("#notificacion-email").html(error_email);	
	}
	if ((error == 0) && (error_vacio_1 == 0) && (error_email_1 == 0))
	{
		$("#notificacion").html('');	
		$.ajax({
				type: 'GET',
				url: '/scripts/aviso/insertar?isAjax=1&email='+email+'&producto='+producto, 
				success: function (msg)
				{
					
					if (msg == 2)
					{	
						$("#notificacion").html(email_existe);	
						error = 1;	
					}
					if (msg == 4)
					{
						$("#items-agregados3 > .informacion-envio").html('<div class="titulo-lightbox">'+confirmar_alta_tit+'</div>');
						$("#items-agregados3 > .informacion-envio2").html('<div class="titulo-subLightbox">'+confirmar_alta_texto+'</div>');
						$("#envio-aviso").overlay({
							top: "15%",
							mask:
							{
								color: '#fff',
								loadspeed: 200,
								opacity: 0.7
							},
							closeOnClick: false,
							load: true,
							target: '#items-agregados3'
						});
					}
				}
			});
	}
}
function validarEmail(valor) {

if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){



return (true)

} else {



return (false);

}

}

 
function cambiarImagenVer(imagen)
{
		document.getElementById('ver-todos').src = imagen;	
}
function cambiarImagenVerAcc(imagen)
{
		document.getElementById('ver-todos-acc').src = imagen;	
}
function cambiarImagenGadgets(imagen)
{
		document.getElementById('ver-gadgets').src = imagen;	
}

function cambiarImagenFicha(id)
{
		document.getElementById("cuadro_"+id).style.border = "2px solid #00B5F2";		
		//document.getElementById("titulo_"+id).style.color = "#00B5F2";
	
}
function cambiarImagenFichaOut(id)
{
		document.getElementById("cuadro_"+id).style.border = "2px solid #FFF";		
		//document.getElementById("titulo_"+id).style.color = "#0099CC";
	
}

function cambiar_ultimos(id)
{	
	document.getElementById('ultimos-firms').style.display = 'none';
	document.getElementById('ultimos-reviews').style.display = 'none';
	
	document.getElementById('ultimos-'+id).style.display = 'block';
	
	document.getElementById('boton-firms').style.color = "#FFF";
	document.getElementById('boton-reviews').style.color = "#FFF";
	
	document.getElementById('boton-'+id).style.color = "#333";
	
	document.getElementById('boton-firms').style.background  = "#2385CC";
	document.getElementById('boton-reviews').style.background  = "#2385CC";
	
	document.getElementById('boton-'+id).style.background  = "#FFF";
}

function cambiar_top(id)
{	
	document.getElementById('top-votos').style.display = 'none';
	document.getElementById('top-ventas').style.display = 'none';
	
	document.getElementById('top-'+id).style.display = 'block';
	
	document.getElementById('boton-votos').style.color = "#FFF";
	document.getElementById('boton-ventas').style.color = "#FFF";
	
	document.getElementById('boton-'+id).style.color = "#333";
	
	document.getElementById('boton-votos').style.background  = "#2385CC";
	document.getElementById('boton-ventas').style.background  = "#2385CC";
	
	document.getElementById('boton-'+id).style.background  = "#FFF";
}

function colorBotonOver(id)
{	
	var actual=document.getElementById(id).style.color;
	//alert(actual);
	if(actual=='rgb(255, 255, 255)'){
		document.getElementById(id).style.color = '#333';
	}else{
		//document.getElementById(id).style.color = '#FFF';	
	}
}

function colorBotonOut(id)
{	
	//var actual=document.getElementById(id).style.color;
	var fondo=document.getElementById(id).style.background;
	//alert(fondo);
	if(fondo=='rgb(35, 133, 204)'){
		document.getElementById(id).style.color = '#FFF';
	}else{
		document.getElementById(id).style.color = '#333';	
	}
}

 function cambiar(id)
{
	//ul
	document.getElementById('tab-caract').style.display = 'none';
	document.getElementById('tab-especificaciones').style.display = 'none';
	document.getElementById('tab-conexiones').style.display = 'none';
	document.getElementById('tab-pantallas').style.display = 'none';
	document.getElementById('tab-videos').style.display = 'none';
	document.getElementById('tab-reviews').style.display = 'none';
	document.getElementById('tab-manuales').style.display = 'none';
	document.getElementById('tab-firmware').style.display = 'none';
	document.getElementById('tab-incluidos').style.display = 'none';
	
	document.getElementById('tit-caract').style.display = 'none';
	document.getElementById('tit-especificaciones').style.display = 'none';
	document.getElementById('tit-conexiones').style.display = 'none';
	document.getElementById('tit-pantallas').style.display = 'none';
	document.getElementById('tit-videos').style.display = 'none';
	document.getElementById('tit-reviews').style.display = 'none';
	document.getElementById('tit-manuales').style.display = 'none';
	document.getElementById('tit-firmware').style.display = 'none';
	document.getElementById('tit-incluidos').style.display = 'none';
	
	
	//menu izq 
	document.getElementById('btn-caract').className = "tab";
	document.getElementById('btn-especificaciones').className = "tab";
	document.getElementById('btn-conexiones').className = "tab";
	document.getElementById('btn-pantallas').className = "tab";
	document.getElementById('btn-videos').className = "tab";
	document.getElementById('btn-reviews').className = "tab";
	document.getElementById('btn-manuales').className = "tab";
	document.getElementById('btn-firmware').className = "tab";
	document.getElementById('btn-incluidos').className = "tab";
	
	
	document.getElementById('tit-'+id).style.display = 'block';
	document.getElementById('tab-'+id).style.display = 'block';
	document.getElementById('btn-'+id).className = "tab-selected";
}

function cambiarVideo(id)
{
	
	$.ajax({		
		type: 'GET',
		url: '/scripts/video/cambio.php?isAjax=1&id='+id,
		success: function (data)				
	{
			$("#cambioVideo").html(data);
		}
	});
}

function buscador()
{
	$("#search").html('<img src="http://www.ledbox.es/images/loading.gif">');
	document.forms['form55'].submit();
}

function info_promo()
{
		var mensaje_enviado = $("#titulo_info_promo").val();
		var texto_mensaje_enviado = $("#txt_info_promo").val();
		
		$("#items-agregados-promo > .informacion-envio").html('<div class="titulo-lightbox">'+mensaje_enviado+'</div>');
		$("#items-agregados-promo > .informacion-envio2").html('<div class="titulo-subLightbox" style="float:left; width:260px;">'+texto_mensaje_enviado+'</div><div class="titulo-subLightbox" style="float:left; margin-left:40px; margin-top:-30px;"><img src="/images/lightbox-promo.png" width="94" height="96" /></div><div style="clear:both;"></div>');

			

			$("#info-promo").overlay({

				top: "15%",

				mask:

				{

					color: '#fff',

					loadspeed: 200,

					opacity: 0.7

				},

				closeOnClick: false,

				load: true,

				target: '#items-agregados-promo'

			});

}

function cambiarImagen(imagen)
{
		document.getElementById('img-promo').src = imagen;	
}

function alturaNoticia()
{	
	var altura = document.getElementById('cuerpo-medio').offsetHeight;
	var nuevotopizq = ((altura/2)-110);
	var nuevotopder = ((altura/2)-184);
	nuevotopder=nuevotopder+'px';
	nuevotopizq=nuevotopizq+'px';
	document.getElementById('botonder').style.top = nuevotopder;
	document.getElementById('botonizq').style.top = nuevotopizq;
	document.getElementById('botonder').style.display = "block";
	document.getElementById('botonizq').style.display = "block";
}

function flechaMouseIn()
{
	document.getElementById('botonder').style.display = "block";
	
}

function flechaMouseOut()
{
	document.getElementById('botonder').style.display = "none";
	
}
