/* JS Document */

/************************************************************************
*   
*   S I T E  W I D E  J A V A S C R I P T S
*   
*   Author:  Daniel Stondin
*   Date:    08 August 2010
*   Web:     http://derbyandcompany.com
*   Version: 1.0
* 
*************************************************************************/

/*-----------------------------------------------------------------------
DOM Ready
------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------
Init
------------------------------------------------------------------------*/

// Accordion

function initAccordion(accordion_id){
  
  $('#'+accordion_id).accordion({
			autoHeight: false,
			collapsible: true,
			active: false
	});
                                                
}

// Home Page Strip

function initHomeStrip(){
	
	var panel = $('#homeImage');

  // Set the timer for 2 seconds
  panel.delay(2000).fadeOut('normal', function() {
  	panel.contents().html('A Long-Term Perspective');
  	panel.css('left', '400px').fadeIn().delay(2000).fadeOut('normal', function(){
  		panel.contents().css('top', '60%').html('A Measured Plan');
  		panel.css('left', '640px').fadeIn().delay(2000).fadeOut();
  	});
  });
}

// Close Alert

function initCloseClick(){		
	$(".close").click(
		function () {
			$(this).parent().fadeTo(400, 0, function () { // Links with the class "close" will close parent
				$(this).slideUp(400);
			});
			return false;
		}
	);
}

function initScrollTo(){
	
	$('.jscroll').click(function() {
	
		var index = $(this).index();
		$.scrollTo( '.colTwoThirds h3:eq('+index+')', 500 );
		
	});
	
}

/*-----------------------------------------------------------------------
Config
------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------
Helpers
------------------------------------------------------------------------*/
