function isIE() {
   if(navigator.appName == 'Microsoft Internet Explorer'){
      return true;
   }else{
      return false;
   }
}

//$$('h1').setStyle('fontSize', '37pt');
$$('.translate_go').hide();

window.onload = function() {

   if(window.Typekit === undefined) $$('h1').setStyle('fontSize', '20pt');

   $$('.bookmarks img').each(function(el) {
      el.setStyle('opacity', 0.5);
   });

   $$('.bookmarks img').addEvent('mouseover', function() {
      this.setStyle('opacity', 1.0);
   });

   $$('.bookmarks img').addEvent('mouseout', function() {
      this.setStyle('opacity', 0.5);
   });

   if(isIE()) {
      $$('.tabnav li').addEvent('mouseover', function() {
	 this.setStyle('cursor', 'pointer');
      })
   }

   // Left Navigation
   $$('#left .mainnav h3').addEvent('click', function() {
      //this.getNext('.level_1').toggle();
      if(this.hasClass('open')) {
	 this.getNext('.level_1').morph({height: '0px'});
	 this.removeClass('open');
      }else{
	 var hVal = this.getNext('.count').get('html') * 22;
	 this.getNext('.level_1').set('morph', { duration: 300 });
	 this.getNext('.level_1').morph({ height: hVal+'px'} );
	 this.addClass('open');
      }
   });
   
   // Cart dropdown
   $$('#left .shop_cart').addEvent('mouseenter', function() {
      this.getChildren('.dropdown').tween('height', $$('#left .shop_cart .height').get('html'));
   });
   
   $$('#left .shop_cart').addEvent('mouseleave', function() {
      this.getChildren('.dropdown').tween('height', 0);
   });
} 
