// JavaScript Document
(function() { var a=window;function c(b){this.t={};this.tick=function(b,i,d){d=d!=void 0?d:(new Date).getTime();this.t[b]=[d,i]};
this.tick("start",null,b)}var e=new c;a.jstiming={Timer:c,load:e};
try{var g=null;a.chrome&&a.chrome.csi&&(g=Math.floor(a.chrome.csi().pageT));
g==null&&a.gtbExternal&&(g=a.gtbExternal.pageT());g==null&&a.external&&(g=a.external.pageT);
g&&(a.jstiming.pt=g)}catch(h){};a.tickAboveFold=function(b){var f=0;if(b.offsetParent){do f+=b.offsetTop;while(b=b.offsetParent)}b=f;
b<=750&&a.jstiming.load.tick("aft")};var j=!1;
function k(){j||(j=!0,a.jstiming.load.tick("firstScrollTime"))}
a.addEventListener?a.addEventListener("scroll",k,!1):a.attachEvent("onscroll",k);
 })();

if (window.jstiming) window.jstiming.load.tick('headEnd');

    function setAttributeOnload(object, attribute, val) {
      if(window.addEventListener) {
        window.addEventListener("load",
          function(){ object[attribute] = val; }, false);
      } else {
        window.attachEvent('onload', function(){ object[attribute] = val; });
      }
    }
	
	$(function() {
				/**
				* for each menu element, on mouseenter, 
				* we enlarge the image, and show both sdt_active span and 
				* sdt_wrap span. If the element has a sub menu (sdt_box),
				* then we slide it - if the element is the last one in the menu
				* we slide it to the left, otherwise to the right
				*/
                $('#sdt_menu > li').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'35px',/*tamaņo y posicion imagen*/
							'height':'35px',
							'left':'150px',
							'top':'15px',
							'z-index':'1000'
						 },400)
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 
						 .andSelf()
						 .find('.sdt_active')
					     .stop(true)
						 .animate({'height':'10px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box');
						if($sub_menu.length){
							var left = '170px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-170px';
							$sub_menu.show().animate({'left':'185px', 'top':'11px', 'z-index':'1000'},200);/*submenu posicion*/
						}	
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');
					
					$elem.find('.sdt_active')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'15px'},500);
				});
$('#relatedPosts').toggle(
					function(){
						$('#rp_list').animate({'bottom':'20px'},500);
					},
					function(){
						$('#rp_list').animate({'bottom':'-40px'},500);
					}
				);
				
            });
