$(document).ready(function(){
$(".fancy").fancybox({
		'height'        : 'auto',
		'titlePosition'	:	'outside',
		'scrolling'		:	'no',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
'padding': 10,
'titleShow':true,
'titleFormat' : function() {
var lingua = $(".fancy").attr("lang");
   return '<p>'+this.title+'</p><div class="fbbutton"><iframe src="http://www.facebook.com/plugins/like.php?locale='+lingua+'&href='+this.href+'&layout=button_count&show_faces=false&send=true&action=like&colorscheme=light&height=85" align="left" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:85px;" allowTransparency="true"></iframe></div><div class="twitterbutton"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'+this.href+'" data-count="horizontal" data-lang="en">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>';}
});

$(".fancycelebrities").fancybox({
'scrolling'		:'no',
'autoScale'     : true,
'autoDimensions'	:	true,
'titlePosition'	:	'outside',
'centerOnScroll' :	true,
'titleShow'		:	true,
'titleFormat' : function() {
var lingua = $(".fancycelebrities").attr("lang");
   return '<div class="celebritytitle">'+this.title+'</div><div style="position:relative"><div class="fbbutton"><iframe src="http://www.facebook.com/plugins/like.php?locale='+lingua+'&href='+this.href+'&layout=standard&show_faces=false&send=true&action=like&colorscheme=light&height=85" align="left" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:85px;" allowTransparency="true"></iframe></div><div class="twitterbutton"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'+this.href+'" data-count="horizontal" data-lang="en">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div>';}
});

$(".maplink").fancybox({
'scrolling'		:'no',
'width'	:650,
'height'	:400,
'type'	:	'iframe',
'centerOnScroll' :	false,
'titleShow'		:	false
});

$(".medialink").fancybox({
'scrolling'		:'no',
'width'	:640,
'height'	:480,
'type'	:	'iframe',
'centerOnScroll' :	false,
'titleShow'		:	false
});


$(".worklink").fancybox({
'scrolling'		:'no',
'width'	:450,
'height'	:550,
'padding' : 10,
'type'	:	'iframe',
'centerOnScroll' :	false,
'titleShow'		:	false,
'onComplete' : function(){
$('form input[type=text],form textarea').each(function(){
	var valore = $(this).val();
	$(this).focus(function(){
		if($(this).val() == valore){
		$(this).val('');
		}
	});
	$(this).blur(function(){
		if($(this).val() == ''){
		$(this).val(valore);
		}
	});
	});
}
});

$(".privacypolicy").fancybox({
'scrolling'		:'yes',
'width'	:600,
'height'	:600,
'type'	:	'iframe',
'centerOnScroll' :	false,
'titleShow'		:	false
});

$('.nolinkable').fancybox({
'titleShow':false
});

/* funzione styling modulo contatti */
var options = $('.wpcf7-form select option').text();
$('#area').wrap('<div id="areawrap"></div>');
$('#areawrap').append('<span>'+$('.wpcf7-form select option:selected').text()+'</span>');
$('#area').change(function(){
placeSelectValue();
});

$('#collectionstripes li img').mouseover(function(){
$(this).animate({'width': '368px','height':'242px','margin-left':'-24px'},'fast');
});

$('#collectionstripes li img').mouseout(function(){
$(this).animate({'width': '320px','height':'210px','margin-left':'0px'},'fast');
});

});

function placeSelectValue(){
$('#areawrap span').html($('.wpcf7-form select option:selected').text());
}
function carolalt(){
$(".celebritygallery_338").trigger("click");
}
function mazza(){
$(".celebritygallery_441").trigger("click");
}
