/**
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
         if (document.getElementById("sermonLists")) {
            document.getElementById("sermonLists").style.visibility="hidden";
         }
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			if (document.getElementById("sermonLists")) {
            document.getElementById("sermonLists").style.visibility="visible";
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
 */
 
 
 
 
/**
 * EqualHeight 1.0
 *
 * Makes all matched elements equal height. Does not work in
 * browsers that do not support min-height (no IE.. who cares)
 *
 * Usage: $('#content, #sub-content').equoalHeight();
 *
 * @class equalHeight
 *
 * Copyright (c) 2008 Andreas Lagerkvist (andreaslagerkvist.com)
 * Released under a GNU General Public License v3 (http://creativecommons.org/licenses/by/3.0/)
 */

 
jQuery.fn.equalHeight = function () {
    var height = 0;
    var maxHeight = 0;

    // Store the tallest element's height
    this.each(function () {
        height = jQuery(this).outerHeight();
        maxHeight = (height > maxHeight) ? height : maxHeight;
    });

    // Set element's min-height to tallest element's height
    return this.each(function () {
        var t = jQuery(this);
        var innerHeight = t.innerHeight();
        var outerHeight = t.outerHeight();
        var notHeight = outerHeight - innerHeight;
        var minHeight = maxHeight - notHeight;
        var property = jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';

        t.css(property, minHeight + 'px');
    });
};

$(document).ready(function(){
	 $('ul#nav').superfish(); 
	 
  $("ul.media").each(function() {
    $("li:last", this).addClass("last");
  });
  $('#basement .photo:gt(2)').hide();
  $("#miniNav ul li").not(":last").append(" | ");
  $('#content, #sidebarContent').equalHeight(true);
});

$(document).ready(function(){
  // colorbox launches
  	$('.thickbox').colorbox({iframe:true,width:450, height:500}); // Default size
    
  	$('a[title="Log In"], .login .thickbox, #comments .thickbox, .monkCart .thickbox,').colorbox({iframe:true,width:425, height:265});
	$('.submit-order .thickbox').colorbox({iframe:true,width:450, height:570});
	$('a[title="Donate"]').colorbox({iframe:true,width:450, height:570});
});
