// *** 2008-10-01 (C) Copyright Matthew Xerri *** //
// *** OmniX Web Design, http://www.omnixwebdesign.com.au *** //
// *** matthew.xerri@hotmail.com, 0402-311-450 *** //

// * JQUERY * //
$(document).ready( function(){
	// *** MENU *** // resource/html/menu.php && private/menu.php

	// *** INITIALIZATION *** //
	$('div.child').hide();
	$('div#database').hide();

	// *** ARROW *** //
	// ** ARROW NORTH ** //
	$('div.arrow').addClass('arrow_west');
	$('div.arrow').parent().click( function() {
		// * ARROW * //
		if( $(this).children().hasClass('arrow_north') ) {
			$(this).children().removeClass('arrow_north').addClass('arrow_west');
		} else {
			$(this).children().removeClass('arrow_west').addClass('arrow_north');
		}

		// * SLIDE DIV * //
		$(this).next().slideToggle("slow");
		
		// * SLIDE BODY * //
		$('body').animate( {scrollTop: $(this).offset().top}, "slow");
	});
		
	// *** GET PAGE *** //
	$('a.get_page').parent().show();
	$('a.get_page').parent().prev().children().removeClass('arrow_west');
	if( $('a.get_page').parent().prev().hasClass('parent') ) { // only adds an arrow to a parent's a.get_page
		$('a.get_page').parent().prev().children().addClass('arrow_north');
	}
});
