var replaceFonts = function() {
	Cufon.replace([
		'#content h1',
		'#content .title-h1',
		'.threecol-type2 h2',
		'.threecol-type2 .title-h2'
	], {fontFamily: 'Gill Sans MT Pro'});
	Cufon.replace([
		'.box .boxContainer .html5-hgroup h2',
		'.box .boxContainer .html5-hgroup .title-h2',
		'.threecol-type2 h2 strong',
		'.threecol-type2 .title-h2 strong'
	], {fontFamily: 'Gill Sans MT Pro Heavy'});
};
var initFunction = function() {
	replaceFonts();
	Cufon.now();
	$(window).resize(function() {
		replaceFonts();
	});
	
	$('#contact-link').css('display', 'block');
	$('#contact-link').click(function(ev) {
		ev.preventDefault();
		$(this).css('display', 'none');
		//$('#contactForm').css('display', 'block');
		$('#contactForm').fadeIn(1000);
		return false;
	});

	// Email replace
	$('bdo').each(function () {
		var email = this.innerHTML.split("").reverse().join("");
		var txt = this.getAttribute('title');
		$(this).replaceWith('<a href="&#109;&#097;&#105;&#108;&#116;&#111;:' + email + '">' + txt + '</a>');
	});
}

$(document).ready(initFunction);
