// JavaScript Document



$(document).ready(function(){
	
   $('.lightbox').nyroModal({
		'blocker': '#colizq',
		galleryLinks: '<a href="#"class="nyroModalPrev"id="previo1">anterior</a><a href="#"class="nyroModalNext" id="siguiente1">siguiente</a>',
		//Use .nyroModalPrev and .nyroModalNext to set the navigation link
		closeButton: '<a href="#"class="nyroModalClose"id="closeBut1"title="close">cerrar</a>' 	 //Adding automaticly as the first child of #nyroModalWrapper
	}); 
	
 	$('.oferta').nyroModal({
		'blocker': '.contbox',
		galleryLinks: '<a href="#"class="nyroModalPrev"id="previo2">anterior</a><a href="#"class="nyroModalNext"id="siguiente2">siguiente</a>',
		// Use .nyroModalPrev and .nyroModalNext to set the navigation link
		closeButton: '<a href="#"class="nyroModalClose"id="closeBut2"title="close">cerrar</a>', // Adding automaticly as the first child of #nyroModalWrapper 
  		addImageDivTitle: false,
    	autoSizable: false, // Indicate if the content is auto sizable. If not, the min size will be used
  		padding: 0,
		galleryCounts: false
	
	});  

	$('.detalles').nyroModal({
		'blocker': '.contbox',
		galleryLinks: '<a href="#"class="nyroModalPrev"id="previo2">anterior</a><a href="#"class="nyroModalNext"id="siguiente2">siguiente</a>',
		// Use .nyroModalPrev and .nyroModalNext to set the navigation link
		closeButton: '<a href="#"class="nyroModalClose"id="closeBut2"title="close">cerrar</a>', // Adding automaticly as the first child of #nyroModalWrapper 
  		addImageDivTitle: false,
    	autoSizable: false, // Indicate if the content is auto sizable. If not, the min size will be used
  		padding: 0,
		galleryCounts: false,
		height: 470,
          width: 605
		
	});
	
	$("#slide").easySlider({auto: true, pause: 5000, continuous: true});
	$('#scroll').jScrollPane({scrollbarWidth:8, scrollbarMargin:15});
	$('#scroll2').jScrollPane({scrollbarWidth:8, scrollbarMargin:15});
	$('#scroll3').jScrollPane({scrollbarWidth:8, scrollbarMargin:15});
	
						
	$('div#miniaturas').hide();
	$('div#miniaturas').addClass('invisible');
						
						
	$('a#botonmin').click(function () {
		if ($('div#miniaturas').is(".invisible")) {
			$('div#miniaturas').show("fast");
			$('div#miniaturas').removeClass('invisible');
			$('a#botonmin').css("background-position" , "-36px");
			
		
		} else { 
			$('div#miniaturas').hide("fast");
			$('div#miniaturas').addClass('invisible');
			$('a#botonmin').css("background-position" , "0");
		}
	});	
	
	$('a#botonmin').mouseover(function () {
		if ($('div#miniaturas').is(".invisible")) {
			$('a#botonmin').css("background-position" , "-18px");
		} else { 
			$('a#botonmin').css("background-position" , "-54px");
		}
	});	
	$('a#botonmin').mouseout(function () {
		if ($('div#miniaturas').is(".invisible")) {
			$('a#botonmin').css("background-position" , "0");
		} else { 
			$('a#botonmin').css("background-position" , "-36px");
		}
	});


	$('div.hover4').hover(function () {
		if ($('div.hover4 .contenthab').is(".invisible2")) {
			$('div.hover4 .contenthab').removeClass('invisible2');
			$('div.hover4 .titulohab').removeClass('invisible2');
			$('div.hover4 .contenthab').show();
			$('div.hover4 .titulohab').show();
		} 
	}, 
	function () {
		$('.contenthab,.titulohab').addClass('invisible2');
		$('div.hover4 .contenthab').hide();
		$('div.hover4 .titulohab').hide();
	});

	$('div.hover5').hover(function () {
		if ($('div.hover5 .contenthab').is(".invisible2")) {
			$('div.hover5 .contenthab').removeClass('invisible2');
			$('div.hover5 .titulohab').removeClass('invisible2');
			$('div.hover5 .contenthab').show();
			$('div.hover5 .titulohab').show();
		} 
	}, 
	function () {
		$('.contenthab,.titulohab').addClass('invisible2');
		$('div.hover5 .contenthab').hide();
		$('div.hover5 .titulohab').hide();
	});
				
	$('div.hover6').hover(function () {
		if ($('div.hover6 .contenthab').is(".invisible2")) {
			$('div.hover6 .contenthab').removeClass('invisible2');
			$('div.hover6 .titulohab').removeClass('invisible2');
			$('div.hover6 .contenthab').show();
			$('div.hover6 .titulohab').show();
		} 
	}, 
	function () {
		$('.contenthab,.titulohab').addClass('invisible2');
		$('div.hover6 .contenthab').hide();
		$('div.hover6 .titulohab').hide();
	});
						
/*---------------------------------
-----------submenu-----------------
---------------------------------*/



		$('#submenu').addClass('oculto1');
		
		$('#submenu').hover(function(){
			$(this).removeClass('oculto1');
		},function(){ 
	 		$(this).addClass('oculto1');
		});


$('#botondesp1').hover(function() {
    // on hovering over, find the element we want to fade *up*
     $('#submenu2').hide(); 
	 $('#submenu3').hide(); 
		
    // if the element is currently being animated (to a fadeOut)...

	if ($('#submenu').is(':animated')) {
      // ...take it's current opacity back up to 1
      $('#submenu').show();
    } else {
      // fade in quickly

      $('#submenu').fadeIn(300);
	  
    }
  }  
  
  
 , function () {
	
	  	$(document).oneTime(1, function() {
			}).oneTime(2000, "soon", function() {
				 $('.oculto1').fadeOut(300);

	
			});

	});

		$('#submenu2').addClass('oculto2');
		
		$('#submenu2').hover(function(){
			$(this).removeClass('oculto2');
		},function(){ 
	 		$(this).addClass('oculto2');
		});


$('#botondesp2').hover(function() {
    // on hovering over, find the element we want to fade *up*
     $('#submenu').hide(); 
	 $('#submenu3').hide(); 
		
    // if the element is currently being animated (to a fadeOut)...

	if ($('#submenu2').is(':animated')) {
      // ...take it's current opacity back up to 1
      $('#submenu2').show();
    } else {
      // fade in quickly

      $('#submenu2').fadeIn(300);
	  
    }
  } 
   , function () {
	
	  	$(document).oneTime(1, function() {
			}).oneTime(2000, "soon", function() {
				 $('.oculto2').fadeOut(300);

	
			});

	});
  
  
 $('#submenu3').addClass('oculto3');
		
		$('#submenu3').hover(function(){
			$(this).removeClass('oculto3');
		},function(){ 
	 		$(this).addClass('oculto3');
		});


$('#botondesp3').hover(function() {
    // on hovering over, find the element we want to fade *up*
     $('#submenu2').hide(); 
	 $('#submenu').hide(); 
		
    // if the element is currently being animated (to a fadeOut)...

	if ($('#submenu3').is(':animated')) {
      // ...take it's current opacity back up to 1
      $('#submenu3').show();
    } else {
      // fade in quickly

      $('#submenu3').fadeIn(300);
	  
    }
  }  
  
  
 , function () {
	
	  	$(document).oneTime(1, function() {
			}).oneTime(2000, "soon", function() {
				 $('.oculto3').fadeOut(300);
			});

	});
   
  


			 
	/*Cufon.replace(document.getElementById('menu').getElementsByTagName('a'), {color: '#FFF', hover: {color: '#A91'} });
	Cufon.replace(document.getElementById('menu').getElementsByTagName('b'), {color: '#A91'});*/
	
	


			
});



	
	
	

 /* var fade = $('#submenu, #submenu2', this);
		$(fade).addClass('oculto');
		
		$(fade).hover(function(){
			$(this).removeClass('oculto');
		},function(){ 
	 		$(this).addClass('oculto');
		});


$('div#menuprinc ul li').hover(function() {
    // on hovering over, find the element we want to fade *up*
        var fade = $('#submenu, #submenu2', this);
			
    // if the element is currently being animated (to a fadeOut)...

	if (fade.is(':animated')) {
      // ...take it's current opacity back up to 1
      fade.show();
    } else {
      // fade in quickly

      fade.fadeIn(300);
	  
    }
  }  
  
 , function () {
	
	  	$(document).oneTime(1, function() {
			}).oneTime(2000, "soon", function() {
				 $('.oculto').fadeOut(300);

	
			});

	});
*/
	


