window.onload = function()
{
  //document.domain = "thinklg.local";

  PageManager.init();

  $('.bugClass').click(function()
  {
    var url = window.location.pathname;
    window.open('/common/bug/RetrieveBugList.jsp?url='+url, '_blank', 'scrollbars=yes, width=800, height=700' );
  });

  window.onresize = function()
  {
    $('div.footer').trigger('footer:resize');
  }

  $('body').unbind('mousemove').mousemove(function(e)
  {
    $('div#left-nav-dom').trigger('leftnav:mouseapproach',[e.pageX,e.pageY]);
    $('.right-rail').trigger('rail:mouseapproach',[e.pageX,e.pageY]);
  });
}
    try{
    if (isReview){
        $('.product-menu .reviews').click();
      }
  } catch(e){
  }
var PageManager =
{
  _enablePageless: false,

  _loadPath: null,
  _loadCallback: null,
  _locked: false,

  init: function()
  {
        var _s = new Date().getTime();

    if($('div.search-results-container').length > 0)
    {
      // initialize Search results page

      $('html,body').css({overflow:'hidden'});

      $('.search-results-container input.prefill').prefill();

      // add close button
      $('.search-results-container').append('<span class="close"></span>');
      $('.search-results-container span.close').click(function()
      {
        $('.search-results-container').remove();
        $('html,body').css({overflow:''});

        $('#search-query').val($('#search-query').attr('prefillvalue'));
        $('div#left-nav-dom div.search,div#left-nav-dom span.predictive-close').remove();
      });

      //start modified by endeca
      $('.search-results-container input.new').click(function()
      {
        document.getElementById('search-within').value = 'new-search';
      });

      $('.search-results-container input.with').click(function()
      {
        document.getElementById('search-within').value = 'with-search';
      });

      // init search form
      $('.search-results-container').find('form#search-form').submit(function(e)
      {
        e.preventDefault();
        if($(this).find('#seeAll').val() == '1')
        {
          PageManager.load("/common/search/search-results-simple.jsp"+"?N="+$(this).find('#Nval').val()+"&Ntx="+$(this).find('#search-mode').val()+"&Ntk="+$(this).find('#search-prop').val()+"&No="+$(this).find('#No').val()+"&Ntt="+escape($(this).find('#search-query').val())+"&RecordType="+escape($(this).find('#RecordType').val()));
        }
        else if($(this).find('#seeAll').val() == '2')
        {
          PageManager.load("/common/search/search-results-simple.jsp"+$(this).find('#pagingUrl').val());
        }
        else
        {
          if( $(this).find('#search-within').val() == 'new-search' )
          {
            PageManager.load(this.action+"?N="+$(this).find('#Nval').val()+"&Ntx="+$(this).find('#search-mode').val()+"&Ntk="+$(this).find('#search-prop').val()+"&No="+$(this).find('#No').val()+"&Ntt="+escape($(this).find('#search-query').val())+"&RecordType="+escape($(this).find('#RecordType').val()));
          }
          else
          {
            var sTemp =  escape($(this).find('#search-oldterm').val() ) + "+" + escape( $(this).find('#search-query').val() );
            PageManager.load(this.action+"?N="+$(this).find('#Nval').val()+"&Ntx="+$(this).find('#search-mode').val()+"&Ntk="+$(this).find('#search-prop').val()+"&No="+$(this).find('#No').val()+"&Ntt="+sTemp+"&RecordType="+escape($(this).find('#RecordType').val()));
          }
        }
        return false;
      });
      //end modified by endeca

      if($('li.sort-by select').length > 0)
      {
        $('.result-products').subcatgrid();

        $('li.sort-by select').dropdown();

        $('li.sort-by select').change(function()
        {
          $('.result-products').trigger('subcatgrid:sort');
        });

        $('.result-products').trigger('subcatgrid:sort');
      }
    }
    else
    {
      var _container = $('div.container');

      $('div.footer').footer();

      $('div.product-header,div.content-header').header(
        {
          // iframe url for email page form
          shareFormUrl: "/emailpage/show/" + $('#slug').val(),

          // submission url for Where To Buy
          whereToBuyUrl: "http://lge.links.channelintelligence.com/oemsites/9939267/Maps/cii_lge_eu.asp?cii_nRadius=15&cii_nRuleGroupID=1144&cii_sCountry=US",

          // iframe url for Buy Online
          buyOnlineUrl: "/common/share/buy-online.jsp?modelNum="+$('#sku').val()
        }
      );
      $('div.menu-left').leftnav();

      if($('div.product-content').length > 0)
      {
        /*** overview ***/
        $('div.product-content div.overview').find('> h3:first').sifr({font:'BryantProLight',fontSize:'42px',textAlign:'left',path:'/flash/fonts'});
        $('div#learning-center-content').learn();
        $('div.product-content div.overview .learn').learnLink();

        /*** features ***/
        $('div.product-content div.features').append('<div class="features-content"><div><dl class="column-one" style="display:block;"></dl></div><div class="column-two"></div><div><dl class="column-three" style="display:block;"></dl></div></div>');
        $('div.product-content div.features .center_column_features').each(function()
        {
          $(this).clone(true).css('margin','auto').appendTo('.column-two');
          $(this).remove();
        });
        var targetcol = 'dl.column-one';
        $('div.product-content div.features dl:first dt').each(function()
        {
          $(this).clone(true).appendTo('div.product-content div.features '+targetcol);
          $(this).next().clone(true).appendTo('div.product-content div.features '+targetcol);
          $(this).remove();
          $(this).next().remove();
          (targetcol == 'dl.column-one') ? targetcol = 'dl.column-three' : targetcol = 'dl.column-one';
        });
        $('div.product-content div.features img').css('display','block');
        $('div.product-content div.features div').css({position:'relative',top:0,left:0});
        $('div.features > ul:first').after($('<img src="/images/bg-hr.png" class="hr" alt="" style="display:block;" />'));

        /*** gallery ***/
        //$('div.gallery').flashGallery();

        /*** specifications ***/
        $('div.specifications .preview').parent('p').before($('<img src="/images/bg-hr.png" class="hr" alt="" style="display:block;" />'));
        $('div.specifications > ul:first').css({width:'100%',position:'relative',top:-8,right:18});
        $('div.product-content div.specifications ul:first li').each(function()
        {
          ($(this).find('a').length > 1) ? $(this).find('a:first').after("&nbsp;|&nbsp;") : null;
        });
        $('div.product-content div.specifications dl dt:odd').addClass('stripe');
        $('div.product-content div.specifications dl dd:odd').addClass('stripe');
          //$('div.product-content div.specifications').accordian();
            $('.specifications .preview, .specifications h4').click(function(){
              $('.specifications dl').animate({
                "height": "toggle"
              }, 1000);
              var $link = $('.specifications .preview');
              if($link.text() == "Expand all Specs") {
                $link.text('Hide all Specs');
              }else {
                $link.text('Expand all Specs');
              }
              return false;
            });

        /*** support ***/
        $('div.product-content div.support h2, div.product-content div.support > div.left h3').sifr({font:'BryantProMedium',path:'/flash/fonts'});
        $('div.product-content div.support ul h3').css({fontSize:'16px'}).sifr({font:'BryantProMedium',path:'/flash/fonts'});
        $('div.support').find('> ul:last').addClass("documents");
        $('div.support').find('> ul:first').addClass("contact");
        $('div.support').find('> *').not('ul.documents').wrapAll('<div class="left"></div>');
        $('div.support').find('div.left > h3:first').before($('<img src="/images/bg-hr.png" class="hr" alt="" style="display:block;width:435px;margin-bottom:15px;" />'));
        $('div.support').find('li li').each(function() {($(this).find('a').length > 1) ? $(this).find('a:first').after("&nbsp;|&nbsp;") : null;});
        $('div.support').find('ul.documents ul:first li:first').not('.pdf').css({margin:"-10px 0 15px 0"});
        $('div.support').find('ul.documents > li:last').css({marginBottom:0}).end().find('ul.documents > li:last > ul:last').css({paddingBottom:0}).end().find('ul.documents > li:last > ul:last > li:last').css({marginBottom:0});
        $('div.support').find('ul.contact li:lt(2)').after('<img src="/images/bg-support-hr.jpg" alt="" />');
        $('div.support').append('<div class="clear"></div>');

        /*** accessories ***/
        $('div.accessories').find('> *').not('ul').wrapAll('<div class="left"></div>');
        $('div.accessories').find('div.left > h3:first').before($('<img src="/images/bg-hr.png" class="hr" alt="" style="clear:both;display:block;width:485px;margin:0;float:none;" />'));
        $('div.accessories').find('dl').each(function() {$(this).css({height:$(this).find('dt').length*16});});
        $('div.accessories').find('dt:odd,dd:odd').addClass('stripe');
        $('div.accessories').find('> ul:first').addClass("documents");
        $('div.accessories').find('ul.documents ul:first li:first').not('.pdf').css({margin:"-10px 0 15px 0"});
        $('div.accessories').find('ul h4').css({fontSize:'16px'}).sifr({font:'BryantProMedium',path:'/flash/fonts'});
        $('div.accessories').find('> ul:last li:first').after($('<img src="/images/bg-hr.png" class="hr" alt="" style="display:block;width:150px;margin:0 0 15px 15px;" />'));
        $('div.accessories').find('li li').each(function() {($(this).find('a').length > 1) ? $(this).find('a:first').after("&nbsp;|&nbsp;") : null;});
        $('div.accessories').append('<div class="clear"></div>');

        /*** reviews ***/
        $('div.expert-reviews').feed();

        /*** Training ***/
        $('div.product-content div.training h3').sifr({font:'BryantProMedium',path:'/flash/fonts'});

        /*** mobile ***/
        $('div.mobile-accessories > ul:first').after($('<img src="/images/bg-hr.png" class="hr" alt="" style="display:block;" />'));
        $('.mobile div.resources').find('ul.documents li').each(function() {($(this).find('a').length > 1) ? $(this).find('a:first').after("&nbsp;|&nbsp;") : null;});
        $('div.resources h3,div.resources .right h4,div.resources .right h5').sifr({font:'BryantProMedium',path:'/flash/fonts'});
        $('div.fun-stuff h3').sifr({font:'BryantProMedium',path:'/flash/fonts'});

        $('.tooltip').tooltip();
        $('.button').button();
        $('.wallpaper-preview,.video-preview').overlay();

        $('ul.icon-list').each(function()
        {
          var _ul = $(this);
          var _div = $(this).parent('div');
          var _height = [0,0,0];

          _div.css({display:'block',left:-2000});

          _ul.find('li').each(function(i)
          {
            var _li = $(this);

            if(_li.attr('style') != undefined && _li.attr('style').toLowerCase().indexOf('background') != -1)
            {
              _li.css({width:165,padding:'0 10px 0 35px',margin:'0 0 4px 0',backgroundPosition:'top left'});
              _height[Math.floor(i/3)] = 30;
            }
          });

          _ul.find('li').each(function(i)
          {
            _height[Math.floor(i/3)] = Math.max(_height[Math.floor(i/3)],$(this).height());
          });

          _ul.find('li').each(function(i)
          {
            $(this).css({height:_height[Math.floor(i/3)]});
          });

          _div.css({display:'none',left:0});
        });

        if($('.product-menu li.'+document.location.hash.replace('#','')).length != 0)
        {
          $('.product-menu li.'+document.location.hash.replace('#','')).click();
        }
        else
        {
          var _goto = null;

          $('.product-menu li').each(function()
          {
            if(document.location.href.indexOf('#'+$(this).attr('class')+'?') != -1)
            {
              _goto = $(this).attr('class');
            }
          });

          (_goto != null) ? $('.product-menu li.'+_goto).click() : $('.product-menu li:eq(1)').click();
        }

        $('div.product-content > div').not('.product-header').css({visibility:'visible'});
      }

      if(_container.find('div.subcategory-content').length > 0)
      {
        var _headerDiv = $('div.subcategory-header:first');

        $('div.subcategory-content h1').sifr({font:'BryantProRegular',path:'/flash/fonts'});
        $('div.subcategory-content h1').css({visibility:'visible'});

        if($('div.subcategory-content a.back').length > 0)
        {
          $('div.subcategory-content h1').css({margin:'0 0 30px 12px'});
        }

        _headerDiv.find('> p:first').css({lineHeight:'18px'});

        if($('div.subcategory-header > div').length > 0)
        {
          $('<span class="toggle"></span>').attr('openheight',$('div.subcategory-header').height()).click(function()
          {
            var _div = $('div.subcategory-header');
            if(_div.css('display') != "none")
            {
              _div.css({display:'none'}).next('span.toggle').css({backgroundPosition:'0px -30px'});
            }
            else
            {
              _div.css({display:'block'}).next('span.toggle').css({backgroundPosition:'0px 0px'});
            }

          }).insertAfter(_headerDiv);
        }
        else
        {
          $('.subcategory-content h2').css({marginBottom:20});
          $('.subcategory-header').css({top:0,marginBottom:0});
        }

        $('div.subcategory-grid').after('<div class="clear"></div>');

        // add glossary tooltips
        $('div.filter-type h6,div.filter-facet h6').add($('div.filter-features input:checkbox').siblings('label')).each(function()
        {
          if($(this).attr('title') != "")
          {
            $(this).append('<img src="/images/icon-glossary.gif" class="glossary" alt="" title="'+$(this).attr('title')+'" />').attr('title','');
            $($(this).children('img')).tooltip();
          }
        });

        // conditional styling
        $('div.filter-type').each(function()
        {
          var _div = $(this);
          var _items = _div.find('> ul > li').length;

          if(_items == 3)
          {
            _div.find('> ul').css({paddingLeft:12,width:190});
          }

          if(_items == 4)
          {
            _div.find('> ul').css({paddingLeft:22,width:175});
          }

          _div.next('div.filter-features,div.filter-type').find('h6:first').css({borderTop:'1px solid #ececec'}).end().find('ul:first').css({borderTop:'none'});
        });

        if($('div.filter-features,div.filter-type').length == 0)
        {
          $('div.filter-status').css({borderBottom:'none',padding:'0 0 0 26px'});
        }

        $('div.subcategory-grid > ul').subcatgrid();

        $('div.sort-by select').dropdown();

        $('div.sort-by select').change(function()
        {
          $('.product-details-container,span.at-a-glance').css({left:-2000});
          $('div.subcategory-grid > ul').trigger('subcatgrid:sort');
        });

        $('div#learning-center-content').learn();
        $('div.tools div.learning-center h6').learnLink();

        $('div.subcategory-grid > ul').trigger('subcatgrid:sort');
        $('div.filter-type input:checkbox:checked').attr('preselected','true');
        $('div.subcategory-grid > ul').trigger('subcatgrid:reset');

        $('div.subcategory-header div:first').each(function()
        {
          if(swfobject.hasFlashPlayerVersion("9.0.0"))
          {
            $(this).css({display:'block'}).flash({src:$(this).find('span').text(),width:'700',height:'390',wmode:'transparent'});
          }
          else
          {
            $(this).css({display:'block'}).append('<img src="'+$(this).find('span').text().replace('.swf','.jpg')+'" style="width:700px;height:390px;display:block;" alt="" />').find('span').remove();
          }
        });

        $('div.subcategory-content').css({visibility:'visible'});
      }

      if(_container.find('div.mylg-content').length > 0)
      {
        $('h1').sifr({font:'BryantProRegular',path:'/flash/fonts'});
        $('.mylg-hero h2').sifr({font:'BryantProLight',path:'/flash/fonts'});

        $('table tr:even').addClass('even');

        $('.tabbed-content').tabs();
        $('.myphone-content').phoneSelector();

        $('.small-button,.button').button();
        $('.wallpaper-preview,.video-preview').overlay();

        $('div#learning-center-content').learn();
        $('.learn-more-content').learnTicker();

        $('div.edit').formToggle();
        $('form').form();

        $('div.mylg-content').css({visibility:'visible'});
      }

      if(_container.find('div.content-container').length > 0)
      {
        $('h1,div.hero h3,div.header h3').sifr({font:'BryantProRegular',path:'/flash/fonts'});
        $('h2').each(function()
        {
          if($(this).parents('div.header').length == 0 && $(this).parents('div#left-nav-dom').length == 0)
          {
            $(this).sifr({font:'BryantProRegular',path:'/flash/fonts'});
          }
        });

        $('.about-content .header').each(function()
        {
          var _header = $(this);

          _header.parents('.about-content').css({marginTop:0});

          $('body').css({background:'url(/images/about/bg-section-gradient.jpg) 0px 291px repeat-x'});

          if(_header.attr('style').indexOf('investor-relations') != -1)
          {
            $('body').css({background:'url(/images/about/bg-section-gradient.jpg) 0px 286px repeat-x'});
          }

          if(_header.attr('style').indexOf('press') != -1)
          {
            $('body').css({background:'url(/images/about/bg-section-gradient-press.jpg) 0px 287px repeat-x'});
          }

          if(_header.attr('style').indexOf('experience-lg') != -1)
          {
            $('body').css({background:'url(/images/about/bg-section-gradient-experience.jpg) 0px 290px repeat-x'});
          }
        });

        $('.image-left,.image-right').each(function()
        {
          $(this).find('span:first').css({width:$(this).find('img:first').width()});
        });

        $('table').each(function()
        {
          $(this).find('tr:even').addClass('odd');
        });

        $('.content-list li').append('<div class="clear"></div>');

        $('.topic').topic();
        $('.gallery,.gallery-left,.press-release-gallery').gallery();
        $('div.faq-answer').faq();
        $('.library-container').library();
        $('select.jump-menu').jumpMenu();
        $('.filter-menu').filterMenu();
        $('.global-operations').globalOperations();

        $('.small-button,.app-button').button();
        $('.library-container .preview,.press-release-gallery > img,.tv-ads span.watch-video').overlay();

        $('input:text').prefill();
        $('form').form();

        $('.content-container').css({visibility:'visible'});
      }

      if(_container.find('div.buyers-guide-content,div.public-notices-content,div.glossary-content,div.sitemap-content').length > 0)
      {
        $('.buyers-guide-content,.public-notices-content').find('h2').sifr({font:'BryantProMedium',path:'/flash/fonts'});
        $('.glossary-content').find('h1').sifr({font:'BryantProRegular',path:'/flash/fonts'});

        $('.public-notices-content').find('.article h2:first').next('div.float-right').css({position:'relative',top:-22});

        $('.glossary-content').glossary();
        $('.tooltip').tooltip();

        $('div.buyers-guide-content,div.public-notices-content,div.glossary-content,div.sitemap-content').css({visibility:'visible'});
      }

      if(_container.find('div.subcategory-static-content').length > 0)
      {
        $('h1').sifr({font:'BryantProRegular',path:'/flash/fonts'});

        $('.button').button();

        $('.subcategory-static-content').css({visibility:'visible'});
      }

      $('div.additional-products').rotator();

      $('.sifr').sifr({font:'BryantProRegular',path:'/flash/fonts'});
      $('a').not('[islink=true]').attr('islink','true').click(function(e) {PageManager.onLinkClick(this,e);});

      $('div#left-nav-dom').trigger('leftnav:toggle');

      if(_container.find('div.homepage-content,div.category-content').length > 0)
      {
        window.setTimeout(function()
        {
          //$('html,body').css({overflowX:'hidden', overflowY:'scroll'});
          //$('.homepage-content,.category-content').hero();
          $('.right-rail').rail();
        },1000);
      }

      if($.browser.msie && $.browser.version < 7)
      {
        $('img[src$=.png],div.footer span,div.product-content div.support ul.contact li').not('.hr').addClass('pngfix');
        $('img.hr[src$=.png]').each(function()
        {
          this.src = this.src.replace('.png','.gif');
        });
      }

      $('.flash').embed();

      _container.css({visibility:'visible'});
    }

    if(_container.find('div.general-content').length > 0)
    {
      var _content = _container.find('div.general-content');
      _content.find('h1').sifr({font:'BryantProRegular',path:'/flash/fonts'});

      /*
      $('.mylg-hero h2').sifr({font:'BryantProLight',path:'/flash/fonts'});

      $('table tr:even').addClass('even');

      $('.tabbed-content').tabs();
      $('.myphone-content').phoneSelector();

      $('.small-button,.button').button();
      $('.wallpaper-preview,.video-preview').overlay();

      $('div#learning-center-content').learn();
      $('.learn-more-content').learnTicker();

      $('div.edit').formToggle();
      */

      _content.find('form').form();

      $('div.general-content').css({visibility:'visible'});
    }
  },

  psearch: function()
  {
    if(!PageManager._locked)
    {
      if($('form#search-form input#predictive-search-url').length != 0 && $.trim($('input#search-query').val()).length > 2)
      {
        PageManager._lock();

        //start modified by endeca
        $.ajax({url:$('form#search-form input#predictive-search-url').val() + '?N=0&Ntx=' + escape($.trim($('input#search-mode').val())) + '&Ntk=All&Ntt=' + escape($.trim($('input#search-query').val())),type:'GET',success:function(response)
        {
          $('div#left-nav-dom div.search').remove();

          var html = $('<span></span>').append(response);

          if(html.find('div.search h4').length != 0)
          {
            $('div#left-nav-dom').append(html.find('div.search'));

            var _close = $('<span class="predictive-close"></span>');

            _close.click(function()
            {
              $('div#left-nav-dom div.search,div#left-nav-dom span.predictive-close').remove();

              if($('div.homepage-content,div.category-content').length > 0)
              {
                $('html,body').css({overflow:'hidden'});
              }
            });

            $('div#left-nav-dom').append(_close);

            if($('div.homepage-content,div.category-content').length > 0)
            {
              $('html,body').css({overflow:''});
            }

          }

          PageManager._unlock();
        }});
        //end modified by endeca
      }
    }
  },

  load: function(path,callback)
  {
    if(!PageManager._locked)
    {
      PageManager._lock(path,callback);
      PageManager._get();
    }
  },

  onLinkClick: function(link,event)
  {
    if($(link).parents('div.ui-slider').length == 0)
    {
      if(link.target == '' && $(link).attr('href') != null)
      {
        if($(link).attr('href').substring(1,0) != '#')
        {
          if(PageManager._enablePageless)
          {
            event.preventDefault();
            PageManager.load(link.href);
            return false;
          }
          else
          {
            if($(link).attr('href').indexOf('.pdf') != -1)
            {
              $(link).attr('target','_blank');
            }

            return true;
          }
        }
        else
        {
          var _tab = $(link).attr('href').replace('#','');

          if(_tab.split('|').length > 1)
          {
            $('ul.product-menu li.'+_tab.split('|')[0]).click();
            $('div.'+_tab.split('|')[0]+' .sub-nav li:eq('+_tab.split('|')[1]+')').click();
          }
          else
          {
            $('ul.product-menu li.'+_tab).click();
          }
        }
      }
    }
    return true;
  },

  _get: function()
  {
    $.ajax({url:this._loadPath,type:'GET',success:function(response)
    {
      // remove script tags from the response
      scripts = response.split(/\/script>/i);
      for(i=0; i < scripts.length ;i++)
      {
        scripts[i] = scripts[i].replace(/\<script.+/i,'');
      }
      response = scripts.join('');

      var html = $('<span></span>').append(response);

      // check if this is a search result
      if(html.find('div.search-results-container').length > 0)
      {
        // remove current content
        $('div.search-results-container').remove();

        // append new content
        html.find('div.search-results-container').appendTo('body');
      }
      else
      {
        var _container = $('div.container');
      }

      // reinit page
      PageManager.init();

      // execute callback
      ($.isFunction(PageManager._loadCallback)) ? PageManager._loadCallback() : null;

      PageManager._unlock();
    },
    dataType:'text'});
  },

  _lock: function(path,callback)
  {
    //$('body,a').css('cursor','wait');
    this._loadPath = path;
    this._loadCallback = callback;
    this._locked = true;
  },

  _unlock: function()
  {
    //$('body,a').css('cursor','');
    this._loadPath = null;
    this._loadCallback = null;
    this._locked = false;
  }
}

var lge = {};

lge.LeftNav =
{
  //start modified by endeca
  SeeAllpSearch: function(pageUrl)
  {
    PageManager.load(pageUrl);
  }
  //end modified by endeca
}

lge.SearchPage =
{
  //start modified by endeca
  SeeDetailPage: function(pagingUrl)
  {
    window.open (pagingUrl, "detailPageWindow", "location=1,status=1,scrollbars=1,width=1024,height=768,resizable=yes");
  },

  SeeAllPage: function(pagingUrl)
  {
    document.getElementById('seeAll').value = '2';
    document.getElementById('pagingUrl').value = pagingUrl;
    $('.search-results-container').find('form#search-form').submit();
  },

  SeeAll: function(paging, recordType)
  {
    document.getElementById('seeAll').value = "1";
    document.getElementById('No').value = paging;
    document.getElementById('RecordType').value = recordType;
    $('.search-results-container').find('form#search-form').submit();
  }
  //end modified by endeca
}

function country(index)
{
  $('.region').hide();
  $('.region:eq('+(index-1)+')').show();
}


$(document).ready(function() {
// ThinkLG:  Load stuff for right-rail
       if($('div.right-rail ul.right_list').length > 0)
       {
        // add glossary tooltips
    $('div.right-rail ul.right_list label').each(function()
    {
      if($(this).attr('title') != "")
      {
        $(this).html("<img src='/images/icon-glossary.gif' class='glossary' alt='' title='" + $(this).attr('title') + "' />" + $(this).html());
                                $(this).attr('title','');
        $($(this).children('img')).tooltip();
      }
    });
    }
    // end ThinkLG
});

$(document).ready(function(){
  //General SIFR Replacement

  $('#adTemplates').find('h2,h3').sifr({font:'BryantProRegular',path:'/flash/fonts'});

  $('.ecoHeader').click(function(){
    $(this).toggleClass('infoActive').next('div').slideToggle('slow');
  })
})

