<!--
// ==============================
// SET VARIABLES
// ==============================
// This is used in the news page when arriving from the news spotlight box
var pageURL = parseURL();
var urlArgs = getArgs(); // From function at bottom

// ==============================
// RUN ALL ONLOAD JQUERY COMMANDS
// ==============================
$(document).ready(function() {
	// ==============================
	// NAVIGATION BEHAVIOR FOR IE 6
	// ==============================
	if (jQuery.browser.msie && jQuery.browser.version == '6.0') {
		$('div#mainNav ul li').mouseover(function() {
			$(this).addClass('ie6hover');
        });
		$('div#mainNav ul li').mouseout(function() {
			$(this).removeClass('ie6hover');
        });
	}
	
	
	
	// ==============================
	// MAIN NAV ON STATES
	// ==============================
	if (mainNavOnState()) {
			$('li.' + mainNavOnState()).addClass('current_page_item');
	}
	function mainNavOnState() {
		var output;
		var cURL = parseURL();
		if (cURL.mainDir == 'member-charities') {
			output = 'page-item-2';
		} else if (cURL.mainDir == 'donate') {
			output = 'page-item-4';
		} else if (cURL.mainDir == 'volunteer') {
			output = 'page-item-6';
		} else if (cURL.mainDir == 'shop') {
			output = 'page-item-8';
		} else if (cURL.mainDir == 'news' || cURL.mainDir == 'blog') {
			output = 'page-item-10';
		} else if (cURL.mainDir == 'about-us') {
			output = 'page-item-12';
		} else if (cURL.mainDir == 'member-services') {
			output = 'page-item-20';
		} else if (cURL.mainDir == 'category') {
			if (cURL.pathParts[2] == 'member-countries') {
				output = 'mMenu1';
			} else if (cURL.pathParts[2] == 'volunteer-opportunities') {
				output = 'mMenu3';
			}
		}
		return output;
	}
	
	// ==============================
	// FONT SIZE BUTTONS
	// ==============================
	$('#plus').mousedown(function() {
		var currentFontSize = parseInt($('body').css('font-size'));
		var newFontSize = currentFontSize + 1;
		if (newFontSize <= 14) {
			$('body').css('font-size',newFontSize);
		}
	});
	$('#minus').mousedown(function() {
		var currentFontSize = parseInt($('body').css('font-size'));
		var newFontSize = currentFontSize - 1;
		if (newFontSize >= 11) {
			$('body').css('font-size',newFontSize);
		}
	});
	
	$("#findCharity select").change(function() {
    	document.findCharity.submit();
	});
	if (pageURL.mainDir + '/' + pageURL.pathParts[2] == 'category/countries') {
		if (urlArgs.type == 'opportunity') {
			$('li.page-item-6').addClass('current_page_item');
		} else {
			$('li.page-item-2').addClass('current_page_item');
		}
	} else if (pageURL.mainDir + '/' + pageURL.pathParts[2] == 'category/volunteer-opportunities') {
		$('li.page-item-6').addClass('current_page_item');
	}
});
//-->  

