// Show / Hide //////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function(){

if ((navigator.userAgent.indexOf('iPhone') != -1) ||
(navigator.userAgent.indexOf('iPod') != -1)) {
document.location = "http://www.elementocero.com.mx/iphone/";
}


	$('#hddnbx').hide();

	$("h2.expand").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});	

	$("h2.expand").click(function(){
		$('#hddnbx').slideToggle("slow");
	});

//

$('#sbmtbttn').hide();


$('#cmmnt').hide();
    $('a#slick-cmmnt').click(function() {
    $('#cmmnt').slideToggle(400);
	$('#sbmtbttn').slideToggle(400);
	$('#ctzcn').hide();
	$('#leyenda').hide();
    return false;
    });
		$("#cmmnt a").click(function(event) {
		event.preventDefault();
		$('#sbmtbttn').slideUp();
		$("#cmmnt").slideUp();
		return false;
		});	
		
$('#ctzcn').hide();
    $('a#slick-ctzcn').click(function() {
    $('#ctzcn').slideToggle(400);
	$('#sbmtbttn').slideToggle(400);	
	$('#cmmnt').hide();
	$('#leyenda').hide();
    return false;
    });
		$("#ctzcn a").click(function(event) {
		event.preventDefault();
		$("#ctzcn").slideUp();
		$('#sbmtbttn').slideUp();
		return false;
		});	


  });






// Send mail //////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function() {
   // Mostramos el loader
    $().ajaxStart(function() {
        $('#loading').show();
        $('#result').hide();
    }).ajaxStop(function() {
        $('#loading').hide();
        $('#result').fadeIn('slow');
    });
   // Enviamos el formulario
    $('#myform').submit(function() {
   // Definimos el metodo ajax, los datos
        $.ajax({
            type: 'POST',
            url: $(this).attr('action'),
            data: $(this).serialize(),
            success: function(data) {
                // Imprimimos la respuesta en el div result
                $('#result').html(data);

            }
        })
       
        return false;
    });
})  







// Sprite //////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function() {

	$("ul.content1 li").hover(function() { //On hover...

		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a.fadeinfadeout").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom' });

		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('slow', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('slow', 1).show();
	});

});





	
// jQuery SmoothScroll | Version 09-11-02  - Source: http://blog.medianotions.de/en/articles/2009/smoothscroll-for-jquery
$(document).ready(function(){
$('a[href*=#]').click(function() {

   // duration in ms
   var duration=1000;

   // easing values: swing | linear
   var easing='swing';

   // get / set parameters
   var newHash=this.hash;
   var target=$(this.hash).offset().top;
   var oldLocation=window.location.href.replace(window.location.hash, '');
   var newLocation=this;

   // make sure it's the same location      
   if(oldLocation+newHash==newLocation)
   {
      // animate to target and set the hash to the window.location after the animation
      $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {

         // add new hash to the browser location
         window.location.href=newLocation;
      });

      // cancel default click action
      return false;
   }

});
});








// fancy zoom //////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function() {
$("ul.content1 li").hover(function() {
	$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
			marginTop: '-10px', /* The next 4 lines will vertically align this image */ 
			marginLeft: '-10px',
			top: '50%',
			left: '50%',
			width: '180px', /* Set new width */
			height: '257px', /* Set new height */
			padding: '0px', 
		}, 400); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '140px', /* Set width back to default */
			height: '200px', /* Set height back to default */
			padding: '0px',  
		}, 600);
});
});








$(document).ready(function() {
			$('#fade').innerfade({
				speed: 'slow',
				timeout: 3000,
				animationtype: 'slide',
				type: 'sequence',
				containerheight: '200px'
			});

});





