$(function(){
	if(active_content == null) {
		active_content = 'home';
		$('#nav_' + active_content).addClass('active');
	}else{
		$('#content_home').hide('fast');
		$('#nav_' + active_content).addClass('active');
		$('#content_' + active_content).slideUp('slow');
	}
	
	$("a").click(function() {
		if($(this).attr('href') == '#') {
			if($(this).attr('rel') != active_content && $(this).attr('rel') != 'contact') {
				$('#nav_' + active_content).removeClass('active');
				$('#content_' + active_content).slideUp('slow');
				
				active_content = $(this).attr('rel');
				
				$('#nav_' + active_content).addClass('active');
				$('#content_' + active_content).slideDown('slow');
			}
			
			if($(this).attr('rel') == 'contact') {
				$("#c_name").focus();
			}
			
			$("#contact_status").html('');
			return false;
		}
	});
	
	// Contact form contact_form
	var form_options = {
		target:		'#contact_status',
		url:		'contact_ajax.php',
		type:		'POST',
		clearForm:	true,
		success:	function() {}
	};
	
	$("#contact_form").ajaxForm(form_options);
	
	$("input,textarea,select").focus(function(){
		$(this).addClass('focus');
	}).blur(function() {
		$(this).removeClass('focus');
	});
	
	// Work
	$(".image_thumb ul li").hover(function(){
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});
	
	$().piroBox({
		my_speed: 300, //animation speed
		bg_alpha: 0.5, //background opacity
		radius: 4, //caption rounded corner
		scrollImage : false, // true == image follows the page _|_ false == image remains in the same open position
				   // in some cases of very large images or long description could be useful.
		slideShow : true, // true == slideshow on, false == slideshow off
		slideSpeed : 3, //slideshow 
		pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
		pirobox_prev : 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
		close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
	});
	
	// Remove the ugly outline on clicked links that have focus
	$('a').click(function() { $(this).blur(); });
});