$(document).ready(function(){
	
	$(this).initBody(); // body classes
	$(this).formInit(); // append class depending on type of input
	$(this).firstLastChild(); // appends class to first and list children of lists, td and th elements
	$(this).evenOddChild(); // appends class to odd and even list children of lists, td and th elements
	$(this).brokenImage(); // hides broken images
	
	//$(this).markExtLink('out'); // marks external links : options 'in' or 'out' depending where tha marker has to be related to the link
	
	$('.article:nth-child(odd)').addClass('clear-left');
	
	jQuery('#main-carousel').jcarousel({
		start: 1,
		wrap: 'both'
	});
	
	$('.jcarousel-container').append('<div class="carousel-mask-left"></div><div class="carousel-mask-right"></div>')
	
	jQuery('#portfolio-display').jcarousel({
		start: 1,
		wrap: 'both',
		auto: 3
	});
	
	// MAPS 
	
	$('.map-tab').each(function(){
		if ( $(this).hasClass('selected') ) {
		} else {
			$(this).hide();
		}
	});
	
	$('.map-nav a').click(function(){
		if ( $(this).hasClass('selected') ) {}
		else {
		$('.map-nav a').removeClass('selected');
		$(this).addClass('selected');
		var thisHref = $(this).attr('href');
		$('.map-tab.selected').slideToggle({duration: 600, easing: 'jswing'});
		$('.map-tab').removeClass('selected');
		$(thisHref).slideToggle({duration: 600, easing: 'jswing'});
		$(thisHref).addClass('selected');
		}
		return false;
	})
	
	// CONTACT FORM
	
	$('form#contact-form').each(function(){
	$('form#contact-form').jqTransform({imgPath:'jqtransformplugin/img/'});
	});
	
});
