(function($)
 {

    //IE6
    if ($.browser.msie && $.browser.version.substr(0, 1) < 7) {
        $('body').prepend('<div style="width:960px;padding:20px;margin:0 auto;background:#FEEFB3;color:#9F6000;font-size:120%;font-weight:bold;line-height:1.5;">You are using a very old browser (Internet Explorer 6) to be able to enjoy our web site to the max please update your browser <a href="http://www.beautyoftheweb.com/" title="The latest version of Internet Explorer">Here</a> or download one of the following browsers <a href="http://www.mozilla.com/en-US/firefox/personal.html" title="Firefox">Firefox</a> ,<a href="http://www.google.com/chrome" title="Google Chrome">Google Chrome</a>,<a href="http://www.opera.com/" title="Opera">Opera</a>,<a href="http://www.apple.com/safari/" title="Safari">Safari</a>.</div>');
    };

    //HOME HEIGHT
    var height = $(window).height(),
 				$homePage = $('#home');

    $homePage.css('height', height);


    $(window).resize(function() {
        $homePage.css('height', height);
    });

		//COLORBOX
		if (jQuery().colorbox) {
          var $teamMemberLink = $('.team a');

          $teamMemberLink.colorbox({
              href: function() {
                  var href = $(this).attr('href').split('#');
                  teamMemberBio = "team-bio.php" + " " + "#" + href[1];
                  return teamMemberBio;
              },
              width: "50%",
              opacity: .4
          });

      }


    //SLIDESHOW
    var $slideshowContainer = $('#slideshow');
		$slideshowContainer.show();
		$slideshowContainer.children().css({opacity: 0});
		$slideshowContainer.find('p').css({opacity: 0});
		
		$.fn.doSlide = function(){
		    $(this).animate({opacity: 1},{
		        duration: 400,
		        queue: true,
		        complete: function(e, o){
		            $(this).find('p').animate({opacity: 1}, {duration: 500});
		        }
		    }).animate({opacity: 1},{
		        duration: 3000
		    }).animate({opacity: 0},{
		        duration: 600,
		        queue: true,
		        complete: function(){
		            $(this).find('p').fadeTo(0, 0);
		            next = $(this).next();
		            if( next.size() === 0 ){
		                next = $(this).parent().children().eq(0);
		            }
		            next.doSlide();
		        }
		    });
		};
		    
		$slideshowContainer.children().eq(0).doSlide();

    

})(jQuery);




