$(document).ready(function() {
	$('a[href^="http:"]').each(function(){
		if (this.hostname !== location.hostname) {
			$(this).attr({
				target: "_blank",
				title: this.title + " (link to an external website, click to open in a new tab or window)"
			});
		}
	});
	$("a.lightbox").fancybox({
				'transitionIn'	:	'elastic',
				'transitionOut'	:	'elastic',
				'speedIn'		:	600, 
				'speedOut'		:	200 
	});
	$(".youtubebox").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'speedIn'		: 600, 
			'speedOut'		: 200, 
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
				'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
	});
});

function doCountryselection(){
	var url = document.countryselection.country.options[document.countryselection.country.selectedIndex].value;
	window.open(url, "memberWindow"); 
}

function doSocialMediaSelection(){
	var url = document.socialmediaselection.chapter.options[document.socialmediaselection.chapter.selectedIndex].value;
	window.open(url, "_top"); 
}

