$(document).ready(function() { 
	 
		$("span.spoiler").hide();
		
	  	 $('<a class="reveal">Read More &raquo;</a> ').insertBefore('.spoiler');
	
		$("a.reveal").click(function(){
			$(this).parents("p").children("span.spoiler").fadeIn(2500);
			$(this).parents("p").children("a.reveal").fadeOut(600);
		});

 
//CUSTOM REVEAL SCRIPT
	$('#tools a.expand').click(function() { $('#reveal .content').slideDown('slow'); $('#reveal .header a').addClass('active'); });
	$('#tools a.hidecontent').click(function() { $('#reveal .content').slideUp('slow'); $('#reveal .header a').removeClass('active'); });
	//individual header click toggle
	$('#reveal .header a').click(function(){
		//collapse and remove active class, if the div is opened it will close
		var activeHeader = $(this).hasClass('active');
		$(this).removeClass('active').parent('div').next('.content').slideUp('slow');
		//open the div if it is closed and add the active class
		if(activeHeader==0)
		{ $(this).addClass('active').parent('div').next('.content').slideDown('slow'); }
	});
 
 

 			$("#body-background").ezBgResize();
 
		 


 
 $("a[rel=windows_group]").fancybox({
        'transitionIn'      : 'elastic',
        'transitionOut'     : 'elastic',
        'titlePosition'     : 'over',
        'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
        }
    });
 
	/* FANCYBOX - FOR PHONE NUMBERS
	Apply fancybox to top phone */
	
 


});  
 
