Cufon.replace('h1', {
	color		: '-linear-gradient(#d7d7d7, #191919)',
});

Cufon.replace('h2', {
	color		: '-linear-gradient(#a4a4a4, #000)',
});

Cufon.replace('#menu-top ul li a, #menu-bottom ul li a', {
	hover		: true
	
});

/************************************************************* */

//_initAjaxRequest();

$(document).ready(_initPage);

$(window).load(function() {
    $('#nivo-slider').nivoSlider({
		effect			: 'boxRainGrow',
		directionNav	: false,
		controlNav		: false,
		pauseTime		: 5000,
	});
});

function _initPage()
{
	// centrowanie obrazow w pionie wewnatrze kontenera
	$('.vAlign').vAlign();
	// opisu pol w formularzach
	$('.clearField').clearField();
	// obrazy uruchamiane w lightboxie
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	// linki obslugiwane za pomoca XMLHTTPRequest
	//$("a[rel^='ajaxRequest']").sevEnAjaxRequest({
	//	reInitCallback	: _reinitPage
	//});

	$('.toolTip').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " -=- ",
		fade: 250
	});

	$('form').submit(function(){
		$(this).clearFormArtSeven();
	});
	
	// ******************************
	
}

function _reinitPage()
{
	$('.vAlign').vAlign();
	$('.clearField').clearField();
	$("a[rel^='prettyPhoto']").prettyPhoto();

	$("a[rel^='ajaxRequest']").sevEnAjaxRequest({
		reInitCallback	: _reinitPage
	});

	$('.toolTip').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " -=- ",
		fade: 250
	});

	//curvyCorners(settings, obj);
}

/************************************************************* */

function pokazPozycje(obiektId)		{$("#" + obiektId).slideToggle("fast");}

/************************************************************* */

function _initAjaxRequest()
{
	// zastapienie funkcji w rsh
	window.dhtmlHistory.create( {
		debugMode : false,
		toJSON:		function(o) {return $.toJSON(o);},
		fromJSON:	function(s) {return $.parseJSON(s);}
	});

	window.onload = function() {
		dhtmlHistory.initialize();
		dhtmlHistory.addListener($().sevEnAjaxRequest.handleAjaxRequestHistory);
	};
}
