document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('nav');
jQuery.fn.log = function (msg) {
      console.log("%s: %o", msg, this);
      return this;
  };
jQuery(document).ready(function($) {
	//nav rollover
	var nav = $("#nav");   
        nav.find("li").each(function() {  
        	if ($(this).find("ul").length > 0) {  
                //show subnav on hover  
                $(this).mouseenter(function() {  
                    $(this).find("ul").stop(true, true).slideDown('fast') 
                });  
                //hide submenus on exit  
                $(this).mouseleave(function() {  
                    $(this).find("ul.children").slideUp('fast');  
            });  
        }  
	}); 
	
	// The function to find the greatest height from a set of elements
function findMaxValue(element){
    var maxValue = undefined;
    $(element).each(function(){
        var val = parseInt($(this).height());
        if (maxValue === undefined || maxValue < val) {
            maxValue = val;
        }
    });
    return maxValue;
}
// Using the above function we set the height of all list items and the bottom margin of the image

    $listItem = $('#multivertlist li');
    maxValue = findMaxValue($listItem);
    $listItem.each(function(){
        $(this).css("height",maxValue);
    });

	$("a[rel^='prettyPhoto']").prettyPhoto({
							social_tools: ''
						});
	$('a[rel*=external]').click(function(){
    window.open($(this).attr('href'));
    return false; 
  });
	$('a.toppers').click(function() {
		$('html, body').animate({ scrollTop: 0 }, 'slow');						  
	});
});
