$(document).ready(function() {
	//Cufon.replace('.Cufon');
	//Cufon.replace('.subMenu a');
	//$('div#R_Okresowe').hide();
	/*$("#SliderHere").easySlider({
		auto: false,
		continuous: true 
	});*/
	$('div.Widgety div#Raporty a').click(function() {
		$('div#Raporty').attr({
			  'class': this.id
			});
		if (this.id=='RRight') { 
			$('div#R_Okresowe').fadeIn(); 
			$('div#R_Biezace').hide();
			$("#SliderHere").easySlider({
				auto: false,
				nextText: '',
				prevText: '',
				continuous: true 
			});
			}
		if (this.id=='RLeft') { $('div#R_Okresowe').hide(); $('div#R_Biezace').fadeIn(); }
	});
	$('div.WidgetySmall div#Raporty a').click(function() {
		$('div#Raporty').attr({
			'class': this.id
		});
		if (this.id=='RRight') { 
			$('div#R_Okresowe').fadeIn(); 
			$('div#R_Biezace').hide();
		}
		if (this.id=='RLeft') { $('div#R_Okresowe').hide(); $('div#R_Biezace').fadeIn(); }
	});
	$('div.Galeria a').lightBox();
	$('span.AntySpam').html('<a href="mailto:'+$('span.AntySpam').html().replace('[w]','.').replace('[na]','@')+'">'+$('span.AntySpam').html().replace('[w]','.').replace('[na]','@')+'</a>');
	$('ul.Lista a').click(function() {
		$('ul.Lista span').hide();
		$('ul.Lista span#'+$(this).attr('class')).fadeIn();
	});
	$('div.Kalendarium a').click(function() {
		if (this.id=='Spt') { $('div#Future').hide(); $('div#Archiv').hide(); $('div#Meeting').fadeIn(); }
		if (this.id=='Arc') { $('div#Future').hide(); $('div#Archiv').fadeIn(); $('div#Meeting').hide(); }
		if (this.id=='Fut') { $('div#Future').fadeIn(); $('div#Archiv').hide(); $('div#Meeting').hide(); }
	});
});

function isEmail(email) {
	email = email.replace(/[ ]/g,'');
	var regEmail = /^([a-zA-Z0-9._-]{1,})@([a-zA-Z0-9._-]{1,})\.([a-zA-Z]{2,4})$/;
	if (!regEmail.test(email)) return false;
	else return email;
	}
function chkNewsletter(oBj, info, lang) {
	$('span#Komunikat').html(info);
	$.ajax({
		type: "POST",
		url: '/index.php?module=newsletter&ajax=1&akcja=dodaj&lang='+lang,
		data: ({email : oBj.newsletter.value}),
		success: function(msg){
			$('span#Komunikat').html(msg);
		}
	});
	
	return false;
}
function gotoCh(oBj, link) {
	if (oBj.Selector.value!=0) this.location.href = link+oBj.Selector.value;
	return false;
}
