// JQuery
$(function() {
	
	// Shadowbox
	Shadowbox.init();

	// Cufon
		Cufon.replace('.daxline_r, #top .lang a, #top #menu ul li a', {
			fontFamily : 'DaxlinePro-Regular',
			hover : true
		});
		Cufon.replace('.daxline_m, #subpage .content h3', {
			fontFamily : 'DaxlinePro-Medium',
			hover : true
		});
	if (!ru) 
	{	

		Cufon.replace('.helvetica', {
			fontFamily : 'helveticaTh',
			hover : true
		});		
	}
	else
	{
		Cufon.replace('.helvetica', {
			fontFamily : 'MyriadPro-Regular',
			hover : true
		});
	}


	// Tooltip
	$(document).ready(function() {
		$(".tooltip_a").tooltip( {
			effect : 'slide'
		});
	});
	
	// Swap Image on Click
	$(".photo-box .photos a").click(function() {

		var mainImage = $(this).attr("href"); // Find Image Name
		var bigImage = mainImage.replace("452x315", "800x600");
		$(".photo-box .mainImg img").attr( {
			src : mainImage
		});
		$(".photo-box a.zoom").attr( {
			href : bigImage
		});
		
		Shadowbox.setup();
		return false;
	});
	
	// Filtrowanie kolorow plytek
	$('.colors-list .item .bg').click(function(){
		var source = $(this).attr('href');
		$('.collection .products-list .item').hide();
        $('.collection .products-list .'+source+', .collection .products-list .K').show();
	}); 
	
	// Wybranie pierwszego koloru płtyek
	$('.colors-list .item .bg:first').click();
	
	// Ukrywanie bledow w formularzu kontaktowym po kliknieciu
	$('#kontaktowy .line .inputArea .error').click(function(){
		$(this).hide();
	})
	
	$('#kontaktowy .line .inputArea input, #kontaktowy .line .inputArea textarea').focus(function(){
		$(this).next().hide();
	})

});



// DDAccordion
ddaccordion.init( {
	headerclass : "gMenuHead_1", // Shared CSS class name of headers
											// group
	contentclass : "gMenu_1", // Shared CSS class name of contents
										// group
	revealtype : "clickgo", // Reveal content when user clicks or onmouseover
							// the header? Valid value: "click", "clickgo", or
							// "mouseover"
	mouseoverdelay : 200, // if revealtype="mouseover", set delay in
							// milliseconds before header expands onMouseover
	collapseprev : true, // Collapse previous content (so only one open at
							// any time)? true/false
	defaultexpanded : [], // index of content(s) open by default [index1,
							// index2, etc] [] denotes no content
	onemustopen : false, // Specify whether at least one header should be
							// open always (so never all headers closed)
	animatedefault : false, // Should contents open by default be animated into
							// view?
	persiststate : true, // persist state of opened contents within browser
							// session?
	toggleclass : [ "", "" ], // Two CSS classes to be applied to the header
								// when it's collapsed and expanded,
								// respectively ["class1", "class2"]
	togglehtml : [ "suffix", "<img src='_tematy/domyslny/img/plus.png' class='statusicon' />",
			"<img src='_tematy/domyslny/img/minus.png' class='statusicon' />" ], // Additional
																// HTML added to
																// the header
																// when it's
																// collapsed and
																// expanded,
																// respectively
																// ["position",
																// "html1",
																// "html2"] (see
																// docs)
	animatespeed : "fast", // speed of animation: integer in milliseconds (ie:
							// 200), or keywords "fast", "normal", or "slow"
	oninit : function(headers, expandedindices) { // custom code to run when
													// headers have initalized
		// do nothing
	},
	onopenclose : function(header, index, state, isuseractivated) { // custom
																	// code to
																	// run
																	// whenever
																	// a header
																	// is opened
																	// or closed
		// do nothing
	}
});

ddaccordion.init( {
	headerclass : "gMenuHead_2", 
	contentclass : "gMenu_2", 
	revealtype : "clickgo", 
	mouseoverdelay : 200, 
	collapseprev : true,
	defaultexpanded : [],
	onemustopen : false, 
	animatedefault : false,
	persiststate : true,
	toggleclass : [ "", "" ],
	togglehtml : [ "suffix", "<img src='_tematy/domyslny/img/plus.png' class='statusicon' />",
	   			"<img src='_tematy/domyslny/img/minus.png' class='statusicon' />" ],
	animatespeed : "fast",
	oninit : function(headers, expandedindices) { },
	onopenclose : function(header, index, state, isuseractivated) {	}
});


ddaccordion.init( {
	headerclass : "gMenuHead_3", 
	contentclass : "gMenu_3", 
	revealtype : "clickgo", 
	mouseoverdelay : 200, 
	collapseprev : true,
	defaultexpanded : [],
	onemustopen : false, 
	animatedefault : false,
	persiststate : true,
	toggleclass : [ "", "" ],
	togglehtml : [ "suffix", "<img src='_tematy/domyslny/img/plus.png' class='statusicon' />",
	   			"<img src='_tematy/domyslny/img/minus.png' class='statusicon' />" ],
	animatespeed : "fast",
	oninit : function(headers, expandedindices) { },
	onopenclose : function(header, index, state, isuseractivated) {	}
});

