function equalHeight(group)
{
  var tallest = 0;
  group.each(function() {
   	var thisHeight = $(this).height();
	
   if(thisHeight > tallest) {
     tallest = thisHeight;
   }
  });
  group.height(tallest);
}

///////////////////////////////////////////////////////////////

function sub_nav()
{
	$('.pro_dd li.dd a').click( function() {
		
		var height = ($('#pro_subnav_dd').height() + 22) + 'px';

		if ($('#pro_subnav_dd').hasClass('open'))
		{
			$('.pro_dd li.dd').removeClass('active');
			$('#content').stop().animate({
				marginTop: '0px'
			});
			$('#pro_subnav_dd').removeClass('open');
		}
		else
		{
			$(this).parent('li').addClass('active');
			$('#content').stop().animate({
				marginTop: height
			});
			$('#pro_subnav_dd').addClass('open');
		}
		
		return false;
	},
	function() {

		$('#pro_subnav_dd').stop().slideUp();
		return false;
	});
}

///////////////////////////////////////////////////////////////

function correct_labels()
{
	$("#mce-EMAIL").labelify({
	  text: "label"
	});
}

///////////////////////////////////////////////////////////////
var count = 1;
var last = 0;

function slideshow()
{
	var index = 0;
	
	$('.home #slideshow').cycle({
		fx: 'fade',
		speed: 1000,
		timeout: 4500,
		pause: 1,
		pager:  '#slideshow_nav',
		before: onBefore,
		after: onAfter,
		pagerClick: pager_click	
	});
}

function pager_click(ind, elem)
{
	return false;
	$('#slideshow_info li').fadeOut(200);
	setTimeout( function() {
		$('#slideshow_info li:eq(' + ind + ')').fadeIn(200);
	}, 250);
}

function onBefore()
{
	$('#slideshow_info li').fadeOut(200);
}

function onAfter()
{
	var index = $(this).index();
	$('#slideshow_info li:eq(' + index + ')').fadeIn(200);
}

///////////////////////////////////////////////////////////////

function federation_map()
{
	$('.federation_list li a').hover( function() {
		var bgPos = '0 0';
		
		$('#map_wrap_inner').stop(true, true).animate({
			opacity: 1
		}, 200, function() {
			$('#map_wrap').css('background-position', '0 0');
		});
		
		if ($(this).hasClass('europe'))
		{
			bgPos = '0 -432px';
		}
		else if ($(this).hasClass('unitedKingdom'))
		{
			bgPos = '0 -864px';
		}
		else if ($(this).hasClass('americas'))
		{
			bgPos = '0 -1296px';
		}
		else if ($(this).hasClass('pacific'))
		{
			bgPos = '0 -1728px';
		}
		
		$('#map_wrap').css('background-position', bgPos);
		$('#map_wrap_inner').stop().animate({
			opacity: 0
		}, 200);
	},
	function() {
		// 
		$('#map_wrap_inner').stop(true, true).animate({
			opacity: 1
		}, 200, function() {
			$('#map_wrap').css('background-position', '0 0');
		});
	});
}

///////////////////////////////////////////////////////////////

function project_slideshow()
{
	$('#project_slideshow').after('<ul id="thumbs">').cycle({
		timeout: 4000, 
		pager:  '#thumbs',
		pagerAnchorBuilder: function(idx, slide) { 
			return '<li><a href="#"><img src="' + slide.src + '" height="60" /></a></li>'; 
		}
	});
	
	$('#slideshow_control a').toggle(
		function() {
			$(this).addClass('pause');
			$('#project_slideshow').cycle('toggle');
			return false;
		},
		function() {
			$(this).removeClass('pause');
			$('#project_slideshow').cycle('toggle');
			return false;
		}
	);
}

///////////////////////////////////////////////////////////////

function federation_map_auto()
{
	var data = [
		{ country: 'Albania', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Armenia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Austria', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Belgium', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Benin', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Bosnia Herzegovina', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Bulgaria', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Burkina Faso', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Croatia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Curaçao and Sint Maarten (the Netherlands)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Cyprus', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Czech Republic', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Denmark', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Finland', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'France', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'French Guiana (FRA) (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'French Polynesia (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Egypt', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Estonia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Ethiopia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Georgia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Germany', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Ghana', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Greece', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Guadeloupe (FRA) (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Guinea', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Haiti', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Hungary', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Iceland', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Israel', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Italy', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Ivory Coast', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Kenya', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Kosovo', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Latvia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Liechtenstein', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Lithuania', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Luxembourg', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Madagascar', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Mali', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Martinique (FRA) (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Moldova', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Monaco', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Morocco', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Netherlands', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'New Caledonia (FRA) (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Niger', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Norway', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Poland', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Portugal', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Reunion (FRA) (French overseas department)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Romania', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Russia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Rwanda', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'San Marino', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Senegal', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Slovakia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Slovenia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Spain', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Surinam (the Netherlands)', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Sweden', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Switzerland', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Togo', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Tunisia', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Turkey', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Ukraine', url: 'http://www.soroptimisteurope.org/en/contact.html', region: 'europe', region_name: 'Soroptimist International of Europe'},
		{ country: 'Anguilla', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Bangladesh', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Barbados', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Cameroon', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Gambia', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Grenada', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Guernsey', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'India', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Isle of Man', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Jamaica', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Jersey', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Malawi', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Malta', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Mauritius', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Nigeria', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Pakistan', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Republic of Ireland', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Republic of South Africa', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Seychelles', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Sierra Leone', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Sri Lanka', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'St Vincent & The Grenadines', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Trinidad & Tobago', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Turks & Caicos Islands', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'United Kingdom of Great Britain and Northern Ireland', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Zimbabwe', url: 'http://soroptimist-gbi.org/join-sigbi/', region: 'unitedKingdom', region_name: 'Soroptimist International of Great Britain and Ireland'},
		{ country: 'Argentina', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Bolivia', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Brazil', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Canada', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Chile', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Colombia', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Ecuador', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Guam', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Japan', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Mexico', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Panama', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Paraguay', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Peru', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Philippines', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Puerto Rico', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'South Korea', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Taiwan', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'United States of America', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Venezuela', url: 'http://www.soroptimist.org/getinvolved/getinvolved.html', region: 'americas', region_name: 'Soroptimist International of The Americas'},
		{ country: 'Australia', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Cambodia', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Fiji', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Hong Kong SAR (Special Administrative Region) China', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Indonesia', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Malaysia', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Mongolia', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'New Zealand', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Papua New Guinea', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Samoa', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Singapore', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Solomon Islands', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'},
		{ country: 'Thailand', url: 'http://www.siswp.org/Membership/Membership.html', region: 'pacific', region_name: 'Soroptimist International of The South West Pacific'}
	];
	
	$('#country_form').submit( function(event) {
		event.preventDefault();
	});
	
	$("#country_input").autocomplete(data, {
		autoFill: true,
		minChars: 0,
		width: 310,
		matchContains: true,
		formatItem: function(row, i, max) {
			return row.country;
		},
		formatMatch: function(row, i, max) {
			return row.country;
		},
		formatResult: function(row) {
			return row.country;
		}
	});
	
	$("#country_input").result( function(event, data, formatted) {
		if (data.region == 'europe')
		{
			bgPos = '0 -432px';
		}
		else if (data.region == 'unitedKingdom')
		{
			bgPos = '0 -864px';
		}
		else if (data.region == 'americas')
		{
			bgPos = '0 -1296px';
		}
		else if (data.region == 'pacific')
		{
			bgPos = '0 -1728px';
		}
		
		if ($('#map_wrap').css('background-position') != '0 0')
		{
			$('#map_wrap_inner').stop(true, true).animate({
				opacity: 1
			}, 200, function() {
				$('#map_wrap').css('background-position', '0 0');
			});
			
			setTimeout( function() {
				$('#map_wrap').css('background-position', bgPos);
				$('#map_wrap_inner').stop().animate({
					opacity: 0
				}, 200);
			}, 200);
		}
		else
		{
			$('#map_wrap').css('background-position', bgPos);
			$('#map_wrap_inner').stop().animate({
				opacity: 0
			}, 200);
		}
		
		$('#map_info p#region').html("The federation for " + data.country + " is:<br /><span>" + data.region_name + "</span>");
		$('#map_info p#region_info').html("<a href=\"" + data.url + "\">Click here</a> to visit the relevant website for this region");
		$('#map_info').fadeIn();
	});
	
}

///////////////////////////////////////////////////////////////

function project_tiles()
{
	$('#tiles').hover( function(){
		$(this).addClass('open');
		$(this).stop().animate({
			height: 678
		}, 350);
	},
	function() {
		$(this).removeClass('open');
		setTimeout( function() {
			if ($('#tiles').hasClass('open'))
			{
				// do nothing
			}
			else
			{
				$('#tiles').stop().animate({
					height: 300
				}, 350);
			}
		}, 500);									
	});

	$('#tiles ul li').hover( function() {
		$(this).find('img').stop().animate({
			opacity: 0.3
		}, 250, function() {
			$(this).parent('a').siblings('h5').animate({
				top: 0
			}, 200);
		});
	},
	function() {
		$(this).find('h5').stop().animate({
			top: 110
		}, 250);
		$(this).find('img').stop().animate({
			opacity: 1
		}, 250);
	});
}

///////////////////////////////////////////////////////////////

function css3_selectors()
{
	$('img[align=right]').addClass('flr');
	$('img[align=left]').addClass('fll');
}

///////////////////////////////////////////////////////////////

$(document).ready(function() {
	equalHeight($('.interior div.equal'));
	equalHeight($('.objectives p'));
	equalHeight($('#content.interior ul#resources li.equal'));
	equalHeight($('#content.interior ul#resource_single li.equal a'));
	sub_nav();
  correct_labels();
	slideshow();
	federation_map();
	federation_map_auto();
	project_tiles();
	project_slideshow();
	css3_selectors();
	// $(document).pngFix();
});
