var showMiniCart = false;
$(document).ready(function () {  
/*-----------------------------------------------------------
	zindex
//-----------------------------------------------------------*/
//    $(function() {  
//        var zIndexNumber = 1000;  
//       $('div').each(function() {  
//            $(this).css('zIndex', zIndexNumber);  
//            zIndexNumber -= 10;  
//        });  


/*-----------------------------------------------------------
	ventana-8  Tama�o 1- ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventana-8").colorbox({width:"696px", height:"520px", iframe:true});
/**************/
	
/*-----------------------------------------------------------
	LEVANTA VENTANA SALDO CMR DE CUOTAS - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".saldoCMR").colorbox({width:"390px", height:"480px", iframe:true, scrolling:false });
	
/*-----------------------------------------------------------
	LEVANTA VENTANA CALCULADOR DE CUOTAS - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".calcular").colorbox({width:"320px", height:"250px", iframe:true});
	
/*-----------------------------------------------------------
	LEVANTA VENTANA LOGIN - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
   	$(".loginiframe").colorbox({width:"386px", height:"340px", iframe:true});
/**************/	
/*-----------------------------------------------------------
	LEVANTA VENTANA MINI PAGINA DE PRODUCTO - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
   	if(($.browser.msie)&&((jQuery.browser.version.indexOf("6")==0)||(jQuery.browser.version.indexOf("7")==0))){
		$(".iframe2").colorbox({width:"730px", height:"550px", iframe:true, scrolling:false});
	}else{
	$(".iframe2").colorbox({width:"710px", height:"520px", iframe:true, scrolling:false});
	}
/*********************/
/*-----------------------------------------------------------
	LEVANTA VENTANA COMPARADOR - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".iframe3").colorbox({width:"900px", height:"668px", iframe:true});
/**********************/
/*-----------------------------------------------------------
	LEVANTA VENTANA COMPRA CON UN CLICK - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".iframeunclick").colorbox({width:"785px", height:"325px", iframe:true});
/****************/				
/*-----------------------------------------------------------
	LEVANTA VENTANA LISTA DE REGALOS - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".listasregalos").colorbox({width:"430px", height:"335px", iframe:true});
/*************************/
/*-----------------------------------------------------------
	LEVANTA VENTANA EDITOR DE COMPRAS CON UN CLICK - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".unclick").colorbox({width:"550px", height:"380px", iframe:true});
/***************/
/*-----------------------------------------------------------
	LEVANTA VENTANA GARANTIA - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".garantia").colorbox({width:"430px", height:"325px", iframe:true});
/*******************/
/*-----------------------------------------------------------
	LEVANTA VENTANA DISPONIBLE EN TIENDAS - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".disponible").colorbox({width:"425px", height:"325px", iframe:true});
/******************/
/*-----------------------------------------------------------
	LEVANTA VENTANA TALLAS - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventanaTallas").colorbox({width:"500px", height:"500px", iframe:true});
/******************/

/*-----------------------------------------------------------
	ventana-1 Tama�o 1- ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventana-1").colorbox({width:"808px", height:"550px", iframe:true,scrolling:false});
/**************/
/*-----------------------------------------------------------
	ventana-2 - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
   	$(".ventana-2").colorbox({width:"550px", height:"400px", iframe:true,scrolling:false});
/**************/

/*-----------------------------------------------------------
	ventana-3 - ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventana-3").colorbox({width:"425px", height:"355px", iframe:true, scrolling:false});
/******************/
/*-----------------------------------------------------------
	ventana-4  Tama�o 1- ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventana-4").colorbox({width:"720px", height:"550px", iframe:true,scrolling:false});
/**************/

/*-----------------------------------------------------------
	ventana-6  Tama�o 1- ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	$(".ventana-6").colorbox({width:"340px", height:"250px", iframe:true});
/**************/
/*-----------------------------------------------------------
	ventana-7  Tama�o 1- ASOCIADO AL ARCHIVO jquery.colorbox-min.js
-----------------------------------------------------------*/
	if(($.browser.msie)&&((jQuery.browser.version.indexOf("6")==0)||(jQuery.browser.version.indexOf("7")==0)||(jQuery.browser.version.indexOf("8")==0))){
		$(".ventana-7").colorbox({width:"730px", height:"570px", iframe:true, scrolling:false});
	}else{
	$(".ventana-7").colorbox({width:"720px", height:"550px", iframe:true, scrolling:false});
	}
/**************/


/*-----------------------------------------------------------
	FUNCION EFECTO REGISTRO COMPRA CON UN CLICK
-----------------------------------------------------------*/
			$("#contenedorRegistro2").css("display", "none");
			$("#cerrarCompraExpress").css("display", "none");
			$(".tituloCE").click(function(){
			//$(".tituloCE").slideUp("slow");
			$("#contenedorRegistro2").slideDown("slow");
			$("#cerrarCompraExpress").css("display", "block");
     		 });
			
			$("#cerrarCompraExpress").click(function(){
			$("#contenedorRegistro2").slideUp("slow");
			$("#cerrarCompraExpress").css("display", "none");
     		 });

/************/
});


/*-----------------------------------------------------------
	TABS PAGINA PRODUCTOS
-----------------------------------------------------------*/
$(function () {    
			var tabContainers = $('div.tabs > div');
			$('div.tabs ul.tabNavigation a').click(function () {
			tabContainers.hide().filter(this.hash).show();                
			$('div.tabs ul.tabNavigation a').removeClass('selected').removeClass('tabcambiadoPP');  
			$(this).addClass('selected');                
			return false;
			}).filter(function(){
				return $(this).parent().css("display") != "none";
				}).filter(":first").click().addClass('tabcambiadoPP');
				setTimeout(function(){
					var liDisplay = false;
					$('div.tabs ul.tabNavigation a').each(function(){
						if($(this).parent().css("display") != "none"){
							liDisplay = true;
						}
					});
					if(!liDisplay){
						$("#tabBegin").hide();
						tabContainers.each(function(){
							$(this).hide();
							
						});
					}
				},200);
});




tabsOcultosPP =function() { 
		$('.tabPromo').removeClass('tabcambiadoPP');
		$('.tabDesc').removeClass('tabcambiadoPP');
		$('.tabFichT').removeClass('tabcambiadoPP');
		$('.tabOU').removeClass('tabcambiadoPP');
		$('.tabDesp').removeClass('tabcambiadoPP');
		$('.tabHum').removeClass('tabcambiadoPP');
		$('.tabInicioPP').removeClass('tabcambiadoPP');
		$('.tabCompo').removeClass('tabcambiadoPP');
}
$(document).ready(function () {  
		
		$('.tabPromo').addClass('tabcambiadoPP');
		$('.tabInicioPP').addClass('tabcambiadoPP');
		$('.tabPromo a').click(function () {   
		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove();   
		tabsOcultosPP()
		$('.tabPromo').addClass('tabcambiadoPP');
		$('.tabInicioPP').addClass('tabcambiadoPP');
	 });  

 /*1*/
 		$('.tabDesc a').click(function () {   
 		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove(); 
		tabsOcultosPP()
		$('.tabDesc').addClass('tabcambiadoPP');
	  });  
/*2*/
		$('.tabFichT a').click(function () {   
		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove();   
		tabsOcultosPP()
		$('.tabFichT').addClass('tabcambiadoPP');
	 });  
/*3*/
		$('.tabOU a').click(function () {   
		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove();   
		tabsOcultosPP()
		$('.tabOU').addClass('tabcambiadoPP');
	 });  
/*4*/	 	 
		$('.tabDesp a').click(function () {   
		tabsOcultosPP()
		$('.tabDesp').addClass('tabcambiadoPP');
	 });  
/*5*/
		$('.tabHum a').click(function () {   
		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove();   
		tabsOcultosPP()
		$('.tabHum').addClass('tabcambiadoPP');
	 });  
	 	$('.tabCompo a').click(function () {   
		$('#formError_home_region').remove(); 
 		$('#formError_home_ciudad').remove(); 
 		$('#formError_home_comuna').remove();   
		tabsOcultosPP()
		$('.tabCompo').addClass('tabcambiadoPP');
	 });  	 
	 
 });  




/*-----------------------------------------------------------
	FUNCION DELAY
-----------------------------------------------------------*/

jQuery.fn.delay = function(time,func){
	this.each(function(){
		setTimeout(func,time);
	});
	return this;
};



/*-----------------------------------------------------------
	QUICK INFO MOSAICO
-----------------------------------------------------------*/
$(document).ready(function(){
	$(".productoBolsa,.cajaLP4x,.cajaLP5x,.cajaLP1x,.cajaLP1xVerListaWL,.cajaLP3x").mouseover(function(){
	   $(".quickView").css("z-index","1");
	})
	$(".quickView").each(function(){
	$(this).hover(
			function () {
				$(".quickView").css("z-index","1");
				   $(this).children("#quickinfo1x, #quickinfo3x, #quickinfo4x, #quickinfo5x").show("");
				   $(this).css({"border": "1px solid #eee"});   
			}, 
      		function () {
      			$(".quickView").css("z-index","1");
				 $(this).children("#quickinfo1x, #quickinfo3x, #quickinfo4x, #quickinfo5x").hide("");
	 			 $(this).css({"border": "1px solid #fff"});
	 			 
			});
    });

/*-----------------------------------------------------------
	 EFECTO NEWSLETTER
-----------------------------------------------------------*/
			$("#respuestaMail").css("display", "none");
			$("#enviarMail").click(function(){
			$("#contenedorMail").slideUp("slow");
			$("#respuestaMail").slideDown("slow");
      }); 
/**********/

/*-----------------------------------------------------------
	EFECTO COMPARADOR
-----------------------------------------------------------*/
			$("#checked-mosaico").click(function(){
			 if ($("#checked-mosaico").is(":checked"))
        {
			$("#visibleComparadorCajaLP").hide("slow");

			$("#ocultoComparadorCajaLP").show("slow");
			
			/* modify */
			$(".visibleComparadorCajaLP").hide("slow");

			$(".ocultoComparadorCajaLP").show("slow");
			/* modify end */
			
			}
			else
        {  
			$("#visibleComparadorCajaLP").show("slow");
			$("#ocultoComparadorCajaLP").hide("slow");
			
			/*modify*/
			$(".visibleComparadorCajaLP").show("slow");
			$(".ocultoComparadorCajaLP").hide("slow");
			/*modify*/
		}
   });
/******************/


    
  });

/* I - FUNCION LOGIN CAMPOS ZONA PRIVADA*/

//			$("#empresaLogin").css("display", "none");
//			$(".empresasLogin").click(function(){
//			$("#usuarioLogin").slideUp("slow");
//			$("#empresaLogin").slideDown("slow");
//  	 			});
//			$(".personasLogin").click(function(){
//			$("#empresaLogin").slideUp("slow");
//			$("#usuarioLogin").slideDown("slow");
//   				});	
/* F - FUNCION LOGIN CAMPOS */	

/*-----------------------------------------------------------
	FUNCION EFECTO REGISTRO COMPRA CON UN CLICK
-----------------------------------------------------------*/
//			$("#contenedorUnClick").css("display", "none");
//			$("#linkUnClick").click(function(){
//			$("#linkUnClick").slideUp("slow");
//			$("#contenedorUnClick").slideDown("slow");
//     		 });

/************/
/*-----------------------------------------------------------
	FUNCION EFECTO REGISTRO PERSONAS Y EMPRESAS
-----------------------------------------------------------*/

//			$("#empresasRegistro").css("display", "none");
//			
//			$(".empresasRegistro").click(function(){
//			$("#personasRegistro").slideUp("slow");
//			$("#empresasRegistro").slideDown("slow");
//  			 });
//			$(".personasRegistro").click(function(){
//			$("#empresasRegistro").slideUp("slow");
//			$("#personasRegistro").slideDown("slow");
//   			});
/**************/

/*-----------------------------------------------------------
	TOOL TIPS
-----------------------------------------------------------*/
//$(document).ready(function(){
//	
//	$(".sidenav").hover(function() {
//		$(this).find(".tool").stop()
//		.fadeIn({left: "150", opacity:1}, "low")
//		.css("display","block")
//
//	}, function() {
//		$(this).find(".tool").stop()
//		.fadeOut({left: "0", opacity: 0}, "low")
//	});

