
$(document).ready(function(){

  var ancho_ventana = $(window).width() /* Sacamos el ancho de la ventana, no del documento $(document) */
  var alto_ventana = $(window).height()



  $(".blok_paginaseclect").css({"height": alto_ventana + 282});


  //$("img").css({"width": ancho_ventana});
  //$("img").css({"height": alto_ventana});


 $(".ligas img:last").css("margin-right", "0px");

  function golpeavicios() {

      $(".golpeavicios").find('.cont').css("background-image", "url(http://blogolpeavisa.com//wp-content/themes/blogolpe/img/blank.gif)");
      $(".golpeavicios").find('.cont').animate({ backgroundColor: "#ececec" }, 300);

   };


  setTimeout(
    function(){

        golpeavicios();

   }, 1000);



  $(".element").live   ("mouseover", function() {

      if ($(this).is('.golpeavicios')) {

           $(this).find('.cont').stop();


           $(this).find('.cont').stop();
             $(".golpeavicios").live   ("mouseover", function() {
               $(this).find('.cont').css("background","white");
             });
          //alert("GOLPEAVICIOS")
      } else {




         $(this).find('.cont').stop().animate({ opacity: 1 }, 400);
         $(this).find('.cont .titulo').stop().animate({ opacity: 1 }, 400);
         $(this).find('.cont .extracto').stop().animate({ opacity: 1 }, 100);



      }

  });


  $(".element").live   ("mouseout", function() {

      if ($(this).is('.golpeavicios')) {

        $(this).find('.cont').stop();
           $(".golpeavicios").live   ("mouseout", function() {
            $(this).find('.cont').css("background","#ececec");
          });



         //alert("GOLPEAVICIOS")
      } else {

         $(this).find('.cont').stop().animate({ opacity: 0 }, 400);

         $(this).find('.titulo').stop().animate({ opacity: 0 }, 1);
         $(this).find('.extracto').stop().animate({ opacity: 0 }, 1);



      }

  });




  // HOVER FOOTER
  $(".face, .tw, .vimeo, .mail").live   ("mouseover", function() {    $(this).find('.roll').stop().animate({ opacity: 1 }, 100);  });
  $(".face, .tw, .vimeo, .mail").live   ("mouseout", function() {    $(this).find('.roll').stop().animate({ opacity: 0 }, 100); });


  // HOVER NAV CHAGE TXT

  $(".chamba").live   ("mouseover", function() {    $(this).find('span').stop().html("WORK").fadeIn('fast');  });
  $(".chamba").live   ("mouseout", function() {    $(this).find('span').stop().html("LA CHAMBA").fadeIn('fast'); });

  $(".eltaco").live   ("mouseover", function() {    $(this).find('span').stop().html("SHOP").fadeIn('fast');  });
  $(".eltaco").live   ("mouseout", function() {    $(this).find('span').stop().html("EL TACO DE OJO").fadeIn('fast'); })

  $(".palapa").live   ("mouseover", function() {    $(this).find('span').stop().html("TROPICOLLEGE").fadeIn('fast');  });
  $(".palapa").live   ("mouseout", function() {    $(this).find('span').stop().html("LA PALAPA").fadeIn('fast'); });

  $(".elvdi").live   ("mouseover", function() {    $(this).find('span').stop().html("ART JAM").fadeIn('fast');  });
  $(".elvdi").live   ("mouseout", function() {    $(this).find('span').stop().html("EL VDI").fadeIn('fast'); });

  $(".avicios").live  ("mouseover", function() {    $(this).find('span').stop().html("STUFF WE LIKE").fadeIn('fast');  });
  $(".avicios").live  ("mouseout", function() {    $(this).find('span').stop().html("GOLPEAVICIOS").fadeIn('fast'); });

  $(".todo").live   ("mouseover", function() {    $(this).find('span').stop().html("SHOW ALL").fadeIn('fast');  });
  $(".todo").live   ("mouseout", function() {    $(this).find('span').stop().html("VER TODO").fadeIn('fast'); });

  // DESC SECCION AND LINK SIDEBAR

  $(".chamba").live('click', function(e) {
    if( $('.lachambaselect').is(':visible') ) {

    }else {
      CLEARSLIDEBAR();
      $(".chamba").addClass("theactive1");

        $(".lachambaselect").delay(300).fadeIn();
    }
  });


  $(".eltaco").live('click', function(e) {

    if( $('.eltacoselect').is(':visible') ) {

    }else {
      CLEARSLIDEBAR();
      $(".eltaco").addClass("theactive2");
        $(".eltacoselect").delay(300).fadeIn();
    }

  });

  $(".palapa").live('click', function(e) {
    if( $('.lapalapaselect').is(':visible') ) {

    }else {
      CLEARSLIDEBAR();
      $(".palapa").addClass("theactive3");
        $(".lapalapaselect").delay(300).fadeIn();
    }
  });

  $(".elvdi").live('click', function(e) {
    if( $('.elvdiselect').is(':visible') ) {

    }else {
      CLEARSLIDEBAR();
      $(".elvdi").addClass("theactive4");
        $(".elvdiselect").delay(300).fadeIn();
    }
  });

  $(".avicios").live('click', function(e) {
    if( $('.aviciosselect').is(':visible') ) {

    }else {
      CLEARSLIDEBAR();
      $(".avicios").addClass("theactive5");
        $(".aviciosselect").delay(300).fadeIn();
    }
   });

  $(".todo").live('click', function(e) { CLEARSLIDEBAR(); });
  function CLEARSLIDEBAR() {
    $(".aviciosselect, .elvdiselect, .lapalapaselect, .eltacoselect, .lachambaselect ").fadeOut(300);
    $(".theactive1").removeClass("theactive1");
    $(".theactive2").removeClass("theactive2");
    $(".theactive3").removeClass("theactive3");
    $(".theactive4").removeClass("theactive4");
    $(".theactive5").removeClass("theactive5");

  }

});


// BROADCAST INDICADOR

$(document).ready(function() {
  var $body = $(".on"),cycle;

  (cycle = function() {
       $body.fadeIn("slow")
          .fadeOut("slow", cycle);
  })();

});






  // HOVER ICO CONTACTO

  $(".iconhover").live   ("mouseover", function() {    $(this).stop().animate({ opacity: 1 }, 300);  });
  $(".iconhover").live   ("mouseout", function() {    $(this).stop().animate({ opacity: 0 }, 300); });
  
  
  

$(document).ready(function() {

    //FILTROS FIX TAGS
    
    //$.cookie('tags','vacia', { path: '/' });

});




// TAGS CONTRAER
$(document).ready(function() {
$('.vertodos').click(function() {

    if ($(".contrac").is('.activo')) {

      $(".contrac").slideUp('slow', function() {

        $(".contrac").removeClass("activo");
        $('.vertodos').removeClass("activo");
        $(".vertodos").html("Ver todos").fadeIn('fast');
       });

    } else {

      $(".contrac").slideUp('slow').removeClass("activo");
      $(".vertodos").removeClass("activo");
      $(".vertodos").fadeOut().html("Contraer").fadeIn('fast');

      $(".contrac").slideDown('slow', function() {
        $(".contrac").addClass("activo");
        $('.vertodos').addClass("activo");
       });
    }

});
});



      //QUITAR NO HAY STREAM

    //setTimeout( function(){
    //    $("#STREAMING").toggleClass("active").slideToggle("slow");
    // }, 2000);



$(document).ready(function() {


    // var $tamanoentrada = $('#ELCONTENIDO').height();
	//if ($("#ELCONTENIDO").height() > $(".blok_paginaseclect").height()) {
    //      	$(".blok_paginaseclect").delay(100).height($tamanoentrada-300);
    // }else{
    //      	$(".blok_paginaseclect").delay(100).height($tamanoentrada-300);	
    //}


});

