$(document).ready( function(){ scrollea(); $("#twitWrap ul").reelText(); activo = null; }) function creaEventos(){ var menu = document.getElementById("menu"); var opacities = [1,0.9,0.5,0.25,0.15]; var cantItems = menu.getElementsByTagName("LI").length; for(var i= 0 ; i < cantItems ; i++){ var bot = menu.getElementsByTagName("LI")[i]; bot.idN = i; bot.alpha = opacities[i] ; bot.onmouseover = function(){ if($(this).attr("class") == "activo"){ return;}; //$(this).addClass("itemActivo"); $("em", this).stop().animate({ opacity: 0 }, 100 ); $("span", this).stop().animate({ opacity: 1 }, 300 ); } bot.onmouseout = function(){ if($(this).attr("class") == "activo"){ return;}; var temp = this.idN + 1; $("em", this).stop().animate({ opacity: 1 }, 300 ); jQuery("span", this).stop().animate({ opacity: this.alpha }, 300, "linear"); } } } function eventosContacto(){ $("#botContact1").mousedown(function(){ $(this).addClass('activeTab'); $("#botContact2").removeClass('activeTab'); $("#formFeedback").fadeOut(); $("#formContact").fadeIn(); }); $("#botContact2").mousedown(function(){ $(this).addClass('activeTab'); $("#botContact1").removeClass('activeTab'); $("#formFeedback").fadeIn(); $("#formContact").fadeOut(); }); } function scrollea(){ // Fix the position of nav when it is about to be scrolled off-screen - not in smelly IE6 tho - borrowed from K2 theme if ( !( $.browser.msie && parseInt(jQuery.browser.version, 10) < 7 ) && $('.navigation a').length>0 ) { var nav_pos = $('.navigation').offset().top; $(window).scroll(function(e) { // Detect if content is being scroll offscreen. if ( (document.documentElement.scrollTop || document.body.scrollTop) >= nav_pos) { $('body').addClass('smartposition'); } else $('body').removeClass('smartposition'); }).scroll(); } }