$(document).ready(function(){
	// Country Loading Magic
	$('#loading_text').hide();
	$('#sidebar #countries > li').click(function() {
		$('#main_text').hide();
		$('#loading_text').show();
	})
	
	// Flash Bulletin Board
	$('#bb_div').flash(
	        { 
	          src: '/bb/bb.swf',
	          width: 750,
	          height: 250,
	          flashvars: { base: '.' }
	        },
	        { version: 8 }
    );
	// Flash Rosenows Image
	$('#rosenows_div').flash(
	        { 
	          src: '/rosenows2.swf',
	          width: 435,
	          height: 338
	        },
	        { version: 8 }
    );
	// Flash Rosenows Image
	$('#rosenows_div2').flash(
	        { 
	          src: '/rosenows2.swf',
	          width: 435,
	          height: 338
	        },
	        { version: 8 }
    );
	// Global Nav Rollovers
	$('#global-nav > li').hover(
      function () {
        $(this).addClass('over');
      }, 
      function () {
        $(this).removeClass('over');
      }
    );
	// Drop Bar
	$('#global-nav > li.drop').hover(
		function() {
			$('#bg_drop').css("display", "block" );
		},
		function() {
			$('#bg_drop').css("display", "none" );
		}
	);
	// Search Button
	$('#sf-submit').hover(
		function(){
			$(this).css("cursor", "pointer");
			$(this).css("background-color", "#636740");
			$(this).css("color", "#ffffff");
		},
		function(){
			$(this).css("cursor", "default");
			$(this).css("background-color", "#E0E0E0");
			$(this).css("color", "#636740");
		}
	);
	// Submit Buttons
	$('.f_btn_submit').hover(
		function(){
			$(this).removeClass('btn_off');
			$(this).addClass('btn_on');
		},
		function(){
			$(this).removeClass('btn_on');
			$(this).addClass('btn_off');
		}
	);
	// Special Needs Accordian
	$('.needs_open').hover(
		function(){
			$(this).addClass('fake_link');
		},
		function() {
			$(this).removeClass('fake_link');
		}
	);
	$('.needs_list').hide();
	$('.needs_open').click(function(){
		$('.needs_list:visible').hide("fast");
		if ($(this).next().is(":hidden")) {
			$(this).next().show("fast");
		}
	});
	// Newsletters Accordian
	$('.block_table tr:last-child').addClass('borderless');
	$('.newsletter_block:not(:first)').hide();
	$('.newsletter_link a:first').addClass('open');
	$('.newsletter_link a').click(function(){
		$('.newsletter_link a.open').removeClass('open');
		$('.newsletter_block:visible').slideUp("fast");
		if ($(this).parent().parent().next().is(":hidden")) {
			$(this).addClass('open');
			$(this).parent().parent().next().slideDown("fast");
		} else {
			$(this).removeClass('open');
		}
		return false;
	});
	// Donations Accordian
	$('.donate_block:not(:first)').hide();
	$('.donate_link a:first').addClass('open');
	$('.donate_link a').click(function(){
		$('.donate_link a.open').removeClass('open');
		$('.donate_block:visible').slideUp("fast");
		if ($(this).parent().next().is(":hidden")) {
			$(this).addClass('open');
			$(this).parent().next().slideDown("fast");
		} else {
			$(this).removeClass('open');
		}
		return false;
	});
	// Designated Donations Accordian
	$('.desig_block').hide();
	$('.desig_link a').click(function(){
		$('.desig_link a.open').removeClass('open');
		$('.desig_block:visible').slideUp("fast");
		if ($(this).parent().next().is(":hidden")) {
			$(this).addClass('open');
			$(this).parent().next().slideDown("fast");
		} else {
			$(this).removeClass('open');
		}
		return false;
	});
	// Donation Button
	$('#submit_button').hover(
		function() {
			$(this).addClass('submit_on');
			$(this).removeClass('submit_off');
		},
		function() {
			$(this).addClass('submit_off');
			$(this).removeClass('submit_on');
		}
	);
	// Sponsor Button
	$('.btn_sponsor').hover(
		function() {
			$(this).addClass('sponsor_on');
			$(this).removeClass('sponsor_off');
		},
		function() {
			$(this).addClass('sponsor_off');
			$(this).removeClass('sponsor_on');
		}
	);
});

