$(document).ready(function(){
//Cufon
Cufon.replace('#footerWrapper h3, .categParinteBoxBody h2, .categSidebar h2, .pgProdusSidebar h2, .categBoxBody h2, .categBoxBody li h3, .pgProdusBoxBody .text h2, .pgProdusListaBoxBody h3, .pressList li h2, .partner_desc h2, .presa_row h2, .presa_row h1, #showroom h1, .categParinteBoxBody li h3', { fontFamily: 'Cambria' });

//topNav Bar hover fading
$(".topNav li a").hover(function () {
		$(this).addClass("hover");
		$('.topNav li a').not('.topNav li a.hover').stop().animate({
				opacity: 0.5
		}, {
				duration: 200
		});
}, function () {
		$(this).removeClass("hover")
		$('.topNav li a').stop().animate({
				opacity: 1
		}, {
				duration: 200
		});
});

//usp hover fading
$("#uspWrapper li a").hover(function () {
		$(this).addClass("hover");
		$('#uspWrapper li a').not('#uspWrapper li a.hover').stop().animate({
				opacity: 0.5
		}, {
				duration: 200
		});
}, function () {
		$(this).removeClass("hover")
		$('#uspWrapper li a').stop().animate({
				opacity: 1
		}, {
				duration: 200
		});
});

//footer portofoliu hover fading
$(".portofoliu li a").hover(function () {
		$(this).addClass("hover");
		$('.portofoliu li a').not('.portofoliu li a.hover').stop().animate({
				opacity: 0.5
		}, {
				duration: 200
		});
}, function () {
		$(this).removeClass("hover")
		$('.portofoliu li a').stop().animate({
				opacity: 1
		}, {
				duration: 200
		});
});

//bottom imgs hover fading
$('.bottomImgs li a').css("opacity","0.5");
$(".bottomImgs li a").hover(function () {
		$(this).stop().animate({opacity: 1}, {duration: 200});
}, function () {
		$(this).stop().animate({opacity: 0.5}, {duration: 200});
});

//logo copimaj img hover fading
$('.by').css("opacity","0.5");

$(".by").hover(function () {
		$(this).stop().animate({opacity: 1}, {duration: 200});
}, function () {
		$(this).stop().animate({opacity: 0.5}, {duration: 200});
});

//categ parinte list hover fading
$(".categ_parinte_listing li a").hover(function () {
		$(this).addClass("hover");
		$('.categParinteBoxBody li a').not('.categ_parinte_listing li a.hover').stop().animate({
				opacity: 0.5
		}, {
				duration: 200
		});
}, function () {
		$(this).removeClass("hover")
		$('.categ_parinte_listing li a').stop().animate({
				opacity: 1
		}, {
				duration: 200
		});
});


//search field
$('.field').focus(function(){ 
	if($(this).val() == $(this).attr('defaultValue'))
	{
		$(this).val('');
	}
});

$('.field').blur(function(){
	if($(this).val() == '')
	{
		$(this).val($(this).attr('defaultValue'));
	} 
});

// categorie list item opacity 0.9
$('.categBoxBody li h3').animate({opacity: '0.9'}, "fast");

// pgprodus alte categorii list item opacity 0.9
$('.pgProdusListaBoxBody li h3').animate({opacity: '0.9'}, "fast");

// hover categorie sidebar
$(".categSidebar li a").not(".categSidebar li.current_page_item a").hover(function() {

	$(this).stop().animate({marginLeft: "12px"}, 400);

	}, function() {

	$(this).stop().animate({marginLeft: "0px"}, 200);

});

// fancybox
$("a[rel=thumbs]").fancybox({
				'transitionIn'		: 'none',
				'overlayOpacity' : 0.7,
				'overlayColor' : '#000',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

});

//fancybox

$("#Listing360 a").fancybox({'overlayOpacity' : 0.7, 'overlayColor' : '#000', 'zoomSpeedIn': 300, 'width': 800, 'height': 600, 'titleShow':false });
$("#decebalPics a").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false,
		'overlayOpacity' : 0.7, 
		'overlayColor' : '#000'
	});


//home banner
$('#mainBanner .item_listing').cycle({
 fx: 'fade'
}); 
