$(document).ready(function(){
	
	//SecureCode
	$('#captcha_code_link').click(function( event ) {
		event.preventDefault();
		document.getElementById('captcha').src = '/includes/securimage/securimage_show.php?' + Math.random();
	});
	
	//External Links
	$('a[href^="http://"]').addClass('external').attr("target", "_blank");
	$('a[href^="https://"]').addClass('external').attr("target", "_blank");
	
	
	$('a[href$="/Terms-and-Conditions"]').addClass('popupTerms');
	
	$("a.popupTerms").attr("href", "/terms")
	
	//Fancybox
	$("a.mapFrame").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200,
		'overlayShow'	:	true,
		'overlayOpacity' : 0.7,
		'overlayColor' : '#000',
		'width'				: '90%',
		'height'			: '90%',
        'autoScale'     	: false,
		'type'				: 'iframe',
		'scrolling'			: 'no',
		'titleShow'			: false,
		'centerOnScroll'	: true
	});
	
	$("a.imagePopup").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200,
		'overlayShow'	:	true,
		'overlayOpacity' : 0.7,
		'overlayColor' : '#000',
		'width'				: 800,
		'height'			: 600,
        'autoScale'     	: false,
		'type'				: 'iframe',
		'scrolling'			: 'no',
		'titleShow'			: false,
		'centerOnScroll'	: true
	});
	
	$("a.popupTerms").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200,
		'overlayShow'	:	true,
		'overlayOpacity' : 0.7,
		'overlayColor' : '#000',
		'width'				: 800,
		'height'			: 600,
        'autoScale'     	: false,
		'type'				: 'iframe',
		'scrolling'			: 'no',
		'titleShow'			: false,
		'centerOnScroll'	: true
	});
	
});

function upperCase(form_id) {
	document.getElementById(form_id).value = document.getElementById(form_id).value.toUpperCase();
}

Cufon.replace('h2', { fontFamily: 'baskerville', hover: true, fontSize: '54px' });
Cufon.replace('h3', { fontFamily: 'baskerville', hover: true, fontSize: '20px' });
