/**
 * Opens link in new window.
**/
$(document).ready(function() {
   $('a.new-window').click(function() {
      window.open(this.href);
      return false;
   });


   trackLinks();
});

/**
 * Encapsulate the click tracking events as page views.
**/
function clickAsPage(page_name) {
   pageTracker._trackPageview(page_name);
}

/**
 * Encapsulate the link tracking.
**/
function trackLinks() {
   $('a[href="/gallery?width=660&height=575&modal=true"]').bind('click', function(){
      clickAsPage('/link/Video-Photo-Gallery');
   });
   
   $('a[href="/assets/pdf/Verrado_Event_Calendar.pdf"]').click(function(){
      clickAsPage('/pdfs/communitycalendar');
   });
}

/**
 * Prevents anchor tags with href="#" from displaying the #.
**/
$(document).ready(function() {
   $('a').each(function(el) {
      if ($(this).attr('href') == '#') {
         $(this).click(function() {
            void(0);
            return false;
         });
      }
   });
});

function drawFooter() {
   mm = document.getElementById('block-menu-delta-main-menu').getElementsByTagName('ul')[0];
   fl = document.getElementById('footerlist');
   document.getElementById('footerlinks').innerHTML = '<ul id="footerlist"><li><a href="/">Verrado Home</a></li>' + mm.innerHTML + fl.innerHTML + '</ul>';
}
