// JavaScript Document
$(document).ready(function() {

	$(function() {
    
    if (! $('#slideshow').length ){
	
			$('img').wrap('<span class="image-box"></span>').hide();
		}
	
	});
	
	
	$(window).bind('load', function() {
		 var i = 1;
		 var imgs = $('img').length;
		 var int = setInterval(function() {
		 //console.log(i); check to make sure interval properly stops
	
		 if(i >= imgs) clearInterval(int);
			 $('img:hidden').eq(0).fadeIn(500);
			 i++;
		 }, 500);
		 
	 $('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'210px', opacity: 0.60},{queue:false,duration:300});
			}, function() {
					$(".cover", this).stop().animate({top:'270px', opacity: 0},{queue:false,duration:300});
			});
	});
	
	
	$(function() {
    $('#main h4.expand').wrapInner('<a style="display:block" href="#" title="expand/collapse"></a>');
   
    //demo 1 - div.demo:eq(0) - Accordion slide effect with first section initially expanded
    $('#main div.demo:eq(0)').find('h4.expand:eq(0)').addClass('open').end()
    .find('div.collapse:gt(0)').hide().end()
    .find('h4.expand').click(function() {
        $(this).toggleClass('open').siblings().removeClass('open').end()
        .next('div.collapse').slideToggle().siblings('div.collapse:visible').slideUp();
        return false;
    });
    
   


});


});

