$(document).ready(function(){
$('#nav li').append("<span></span");
$('#nav li:first-child span,#nav ul ul li span').css({'display':'none'});

/*$('#nav li').hover(function(){
	$(this).children('ul').css({'display':'none'});
	$(this).children('ul').slideToggle(500);
	},function(){
	$(this).children('ul').slideToggle(400);
});
$('#container').hover(function(){
	$('#nav ul ul').slideUp(500);
});*/



$('#actions img').hover(function(){
	$(this).stop().animate({'opacity':.7},600);
	},function(){
	$(this).stop().animate({'opacity':1},400);
});


$('div.testimonial').hide();
$('h2.testimonial').click(function(){
	$(this).next('div.testimonial').slideToggle(600);
	$(this).next('div.testimonial').toggleClass('active');
	$(this).toggleClass('active');
});


$('ul#main-transition').innerfade({
	speed: 1000,
	timeout: 5000,
	type: 'sequence',
	containerheight: '330px'
});



$('.tabmain').hover(function(){
	$('.tabmain').stop().animate({'opacity':.4});
	$(this).stop().animate({'opacity':1});
	},function(){
	$('.tabmain').stop().animate({'opacity':1});
});

$('.gallery-wrapper img').hover(function(){
	$('.gallery-wrapper img').stop().animate({'opacity':.4});
	$(this).stop().animate({'opacity':1});
	},function(){
	$('.gallery-wrapper img').stop().animate({'opacity':1});
});


// INITIAL LIGHTBOX
/*$('#backgroundPopup').css({'opacity':.5});
$('#popupContact,#backgroundPopup').fadeIn(1000);
$('#popupContactClose,#backgroundPopup').click(function(){
	$('#popupContact,#backgroundPopup').fadeOut(600);
});
var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
$("#popupContact").css({
	"position": "absolute",
	"top": windowHeight/2-popupHeight/2,
	"left": windowWidth/2-popupWidth/2
});*/



// PRETTY PHOTO
$(".gallery-wrapper a").prettyPhoto({
	animationSpeed: 'normal', /* fast/slow/normal */
	padding: 40, /* padding for each side of the picture */
	opacity: 0.35, /* Value betwee 0 and 1 */
	showTitle: true, /* true/false */
	allowresize: true, /* true/false */
	counter_separator_label: ' / ', /* The separator for the gallery counter 1 "of" 2 */
	theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
});
$("rel=&quot;prettyPhoto[gallery]&quot;").appendTo(".gallery-wrapper a");

$('.gallery-wrapper a:eq(3)').after('<div class="clear"></div>');

});
