var lyndoch = new Site();
lyndoch.init();

function Site() {
	this.init = function() {
	}
	this.ready = function() {
		this.initCufon();
		this.domUpdates();
		this.domEnhancements();
	}
	this.domUpdates = function() {
		if($('#JobApplicationApplyForm, #EnquiryCreateForm, #UserLoginForm').size() > 0) {
			$('#JobApplicationApplyForm .input-row div:first-child, #EnquiryCreateForm .input-row div:first-child, #UserLoginForm .input-row div:first-child').addClass('first-input');
		}
	}
	this.domEnhancements = function() {
		$('div.required label').append(' *');
		$('.boardmembers-more').click(function() {
			$(this).prev().slideToggle('normal', function() {
				if($(this).is(':hidden')) {
					$(this).next('a').find('img').attr('src', '/img/arrow_more.gif');
					$(this).next('a').html($(this).next('a').html().replace('Less', 'More'));
				}
				else {
					$(this).next('a').find('img').attr('src', '/img/arrow_less.gif');
					$(this).next('a').html($(this).next('a').html().replace('More', 'Less'));
				}
			});
			return false;
		});
		/*$('#close-icon').click(function() {
			$('#login-window').fadeToggle('normal');
			return false;
		});
		$('.restricted').click(function() {
			$('#close-icon').trigger('click');
			return false;
		});*/
		$('.home-quicklink').each(function() {
			var link = $(this).find('a');
			$(this).click(function() {
				window.location = link.attr('href');
			});
		});
		$('#text-up').click(function() {
			if(!$('#section-content-wrapper').hasClass('larger-text')) {
				$('#section-content-wrapper').addClass('larger-text');
			}
			return false;
		});
		$('#text-down').click(function() {
			$('#section-content-wrapper').removeClass('larger-text');
			return false;
		});
		$(function() {
			$('.gallery-item a').lightBox();
		});
		$('#print-page').click(function() {
			window.print();
			return false;
		});
	}
	this.initCufon = function() {
		$('link[rel="stylesheet"]').each(function() {
			if(!$(this).attr('href').indexOf('cufon')) {
				Cufon.now();
			}
		});
	}
}

$(function() {
	lyndoch.ready();
});
