// Preload Images (created by Adobe)
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Section Swapper (created by Miles - 10.03.2008)
jQuery(document).ready(function() {
	MM_preloadImages(
		// Main Menu
		'/images/button_home_find_a_church_hover.png',
		'/images/button_home_about_heaven_hover.png',
		'/images/button_home_what_we_believe_hover.png',
		'/images/button_home_our_teachings_hover.png',
		'/images/button_home_bible_college_hover.png',
		'/images/button_home_international_hover.png',
		'/images/button_home_events_hover.png',
		'/images/button_home_watch_live_hover.png',
		'/images/button_home_cccostamesa_hover.png',
		
		// Submenu
		'/images/button_sub_what_we_believe_hover.png',
		'/images/button_sub_finding_a_church_hover.png',
		'/images/button_sub_our_teachings_hover.png',
		'/images/button_sub_bible_college_hover.png',
		'/images/button_sub_about_heaven_hover.png',
		'/images/button_sub_events_hover.png',
		'/images/button_sub_international_hover.png'
	);
		
	jQuery('.sectionLink').click(function() {
		jQuery('#content > div').hide();
		jQuery('.sectionLink').css({ color:'#476783', fontWeight:'normal', background:'none'});
		jQuery(this).css({ color:'#fff', fontWeight:'bold', background:'#476783'});
		jQuery('#' + jQuery(this).attr('rel')).animate({opacity: 'show'}, 'slow');
		return false;
	});
});

function initSection(sectionName) {
	jQuery(document).ready(function() {
		jQuery("a[rel=" + sectionName + "]").css({color:'#fff', fontWeight:'bold', background:'#476783'});
		jQuery('#' + sectionName).css({display:'block'});
	});
}

// jQuery Accordion (created by Jörn Zaefferer; [ url = http://bassistance.de/jquery-plugins/jquery-plugin-accordion/ ] )
jQuery().ready(function() {
	jQuery('#translations #list').accordion({
		header: '.language',
		active: false,
		autoheight: false
	});
});


// REMOVED - Main Navigation [ Home ] (created by Miles - 10.06.2008)
// jQuery(document).ready(function() {
// 	jQuery('#mainMenu_Home li').hover(		
// 		function() {		
// 			jQuery(this).css({ backgroundImage:"url('images/button_home_" + jQuery(this).attr('id') + "_hover.png')"});
// 		},
// 		function() {
// 			jQuery(this).css({ backgroundImage:"url('images/button_home_" + jQuery(this).attr('id') + ".png')"});
// 		}
// 	);
// });