$(document).ready(function(){
	$('#linkpri').lightBox();
	$('.imgsecs').lightBox();
	$('.imgsdis').lightBox();
	$('.imgsdis2').lightBox();
	$('#jMessageObject').jMessage();
	var es_bik;
	$('#title,#description,#disenyos,#tallast,#tallastr,#tprorel,.tprorel,#tableMessage h3, #tableMessage h4, .jMessageButtoms a').mouseover(function(){
		es_bik = $(this).text();
		$(this).text($(this).attr('en'));
	}).mouseout(function(){
		$(this).text(es_bik);
	});
	$('#addprod').mouseover(function(){
		es_bik = $(this).attr('value');
		$(this).attr('value',$(this).attr('en'));
	}).mouseout(function(){
		$(this).attr('value',es_bik);
	}).click(function(){
		$('#jMessageObject').jMessageShow({
			accept:function(){
				var id = $('#idprod').val();
				var dis;
				$(".disrad").each(function(i){
					if($(this).attr("checked")){
						dis = $(this).val();
					}
				});
				var tt = $('#slctt').val();
				var ttr = $('#slcttr').val();
				var cant = $('#cantprod').val();
				$.ajax({
					type:'POST',
					url:'request/addCart.php',
					data:{id:id,dis:dis,tt:tt,ttr:ttr,cant:cant},
					success:function(resp){
						var jresp = eval(resp);
						alert(jresp.msg);
						if(jresp.error == 0){
							window.location.href = '?pag=bikini&pro=' + id;							
						}
					}
				});
			}
		});
	});
});
