$(function() {
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});
	
	// feedback error handling
	$('.cms_submit_fb').click(function(){
		if($("#fb-name").val() == "") {
			$("#fb-name").addClass("error-inp");
			return false;
		}
		if($("#fb-email").val() == "") {
			$("#fb-email").addClass("error-inp");
			return false;
		}
		if($("#commentsForm textarea").val() == "") {
			$("#commentsForm textarea").addClass("error-txt");
			return false;
		}
	});
});

$(document).ready(function(){
	$("#navContain ul").lavaLamp({fx:"backout",speed:700});
	
	$('#services #leftColumn h2').addClass('dn');
	$('#services #leftColumn h2').next().addClass('hide');
	
	$('#services #leftColumn h2').click(function() {									 
		if($(this).next().is('.hide')) {
			// reset all the others
			$('#services p.show').hide();
			$('#services p.show').removeClass('show').addClass('hide');
			$('#services h2').removeClass('up').addClass('dn');
			
			// show the content
			$(this).next().show();
			$(this).next().removeClass('hide').addClass('show');
			$(this).removeClass('dn').addClass('up');
			return false;
		}
		else {
			// hide the content
			$(this).next().hide();
			$(this).next().removeClass('show').addClass('hide');
			$(this).removeClass('up').addClass('dn');
	 		return false;
		}		
	});
	
	$('#testims').cycle({
		timeout: 8000,
		height: 330
	});

});
