


	function ver_registro(idp){
		ocultar_swf();
		var w = 600;
		var h = 650;
		
		$('#fndlayer').css({opacity : "0"});
		$('#fndlayer').css({display : "block"});
		//if(!$.browser.msie){ $('#fndlayer').width( $('#fndlayer').width() + 15 ) }
		$('#fndlayer').fadeTo(500,.8);
		
		$('#layer').width(w+40);
		$('#layer').css({width : (w+40)+"px"});
		document.getElementById('layer').style.width = (w+40)+"px";
		$('#layer').height(h+50);
		
		$('#layer').css({opacity : "0"});
		$('#layer').css({display : "block"});
		
		// por problemas con ie6 (q raro)
		var ancho_real = document.getElementById('layer').style.width.split('px')[0];
		
		var __left = ($(window).width() / 2) - ( ancho_real / 2);
		$('#layer').css({left : __left+"px"});
		var __top = getPageScroll();
		$('#layer').css({top : (__top[1]+50)+"px"});
	
		txt = '<br /><br /><br /><img onclick="ocultar_foto()" src="admin/imgs/loadtube.gif" alt="" title="" />';
		
		$('#layer').html(txt);
		$('#layer').fadeTo(500,1);
		
		$.ajax({
			type:"POST",
			url:"altacliente.php",
			data:"activo=1&idp="+idp,
			success: function(_html){
				$('#layer').html(_html);
				$('#layer').css({height:'auto'});
			}
		});
	}
	
	function mostrar_error_texto_imagen(){
		$('#error_cod_img_id').show();
	}
	
	function mostrar_error_usuario_existe(){
		$('#error_usu_exite_id').show();
		$('#error_cod_img_id').hide();
	}
	
	function cliente_agregado_correctamente(){
		location.reload();
	}
	
	function loguear_cliente_correct(fr){
		return $.trim(fr.mail.value) != '' &&  $.trim(fr.clave.value) != '';
	}

	function mostrar_error_usuario_no_existe(){
		$('#error_no_existe_usuario_c_clave').show();	
	}
/* agregar productos al carrito, en listado y detalle de productos */	
	function add_carrito(idp){
		$('#img_add_load_'+idp).show();
		$.ajax({
			type: "POST",
			url: "clientes/agregar_producto_carr.php",
			data: "idp="+idp,
			dataType: "html",
			success: function(html_, status_){
				$('#img_add_load_'+idp).hide();
				$('#carr_agregado_respuesta').slideDown(500);
				setTimeout('ocultar_agregado_respuesta()',1000);
				$('#id_cantidad_carrito').html(html_);
			}
		});				
	}
	
	function ocultar_agregado_respuesta(){
		$('#carr_agregado_respuesta').slideUp(500);
	}

/* agregar/quitar productos a carrito desde listado del carrito */
	function addcartelem(idp, op){
		if(op != 1){
			if($('#cantidad_elem_input_'+idp).val() <= 0){
				$('#cantidad_elem_input_'+idp).val(0);
				return;
			}
			var opp = 'rem';
		}else{
			var opp = 'add';
		}
		
		$('#load_img_'+opp+'_'+idp).show();
		$('#load_img_signo'+opp+'_'+idp).hide();
		
		$.ajax({
			type: "POST",
			url: "clientes/agregarquitarp.php",
			data: "op="+opp+"&idp="+idp,
			dataType: "html",
			success: function(html_, status_){
				var vals = html_.split('-');
				$('#cantidad_elem_input_'+idp).val(vals[0]);
				$('#id_cantidad_carrito').html(vals[1]);
				$('#id_precio_total_car').html(vals[2]);
				$('#load_img_'+opp+'_'+idp).hide();
				$('#load_img_signo'+opp+'_'+idp).show();
			}
		});
	}

	function remover_de_carrito(idp){
		$('#href_remover_tr_'+idp).show();
		$('#load_img_href_rem_'+idp).hide();
		
		$.ajax({
			type: "POST",
			url: "clientes/removerdecarrito.php",
			data: "idp="+idp,
			dataType: "html",
			success: function(html_, status_){
				var vals = html_.split('-');
				$('#id_cantidad_carrito').html(vals[0]);
				$('#id_precio_total_car').html(vals[1]);
				$('#id_tr_rel_remove_'+idp).remove();
				if(vals[2] == 'x')
					no_items_ocultar_carrito();
			}
		});
		
	}
