document.createElement('header');
document.createElement('nav');
document.createElement('section');
document.createElement('footer');
  
$(document).ready(function(){
  $(document).pngFix();
  
  //fill subject of franchise opportunities
  $('section .opportunities ul li a')
    .click(function(){
      $(".opp-contact form input[name='subject']")
        .val("Franchise Interest - "+$(this).text())
        .attr('readonly','readonly');
    });

  // Add Facebook like links to all products (individual pages for this, so easier to do here)
  if( $('.promoimg').length > 0 ){
    var fb_like = document.createElement('div');
    $(fb_like)
      .addClass('facebook-like')
      .append('<div class="fb-wrapper"><iframe src="http://www.facebook.com/plugins/like.php?href=' + escape(document.location) + '&amp;send=false&amp;layout=button_count&amp;width=45&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" allowTransparency="true" "></iframe></div>');
    
    $.getJSON("http://api.facebook.com/method/fql.query?query=" + encodeURIComponent("SELECT share_count, like_count FROM link_stat WHERE url='" + document.location)+"'&format=json", function(data){
      $(fb_like).prepend("<div class='share-count'>"+data[0]['like_count']+"</div>");
    });
    
    $('.promoimg').prepend($(fb_like));
    
  }

  
  
  
});


function openPanel() {
  $('div.panel').slideDown();
}

function closePanel() {
  $('div.panel').slideUp();
}

