function noSpam(user,domain) 
{
	locationstring = "mailto:" + user + "@" + domain;window.location = locationstring;
}

function checkOrder()
{
	var errMessage = '';	
	var emptyFields = 0;

	var imie = document.getElementById('imie').value;
	if(imie=='')
	{	
		emptyFields++;
		document.getElementById('imie').style.background = '#F6B2C1';
		errMessage += 'Imie jest wymagane.\n';	
	} else {
		document.getElementById('imie').style.background = '#fff';
	}
	var nazwisko = document.getElementById('nazwisko').value;
	if(nazwisko=='')
	{	
		emptyFields++;
		document.getElementById('nazwisko').style.background = '#F6B2C1';
		errMessage += 'Nazwisko jest wymagane.\n';	
	} else {
		document.getElementById('nazwisko').style.background = '#fff';
	}
	var email = document.getElementById('email').value;
	if(nazwisko=='')
	{	
		emptyFields++;
		document.getElementById('email').style.background = '#F6B2C1';
		errMessage += 'Email jest wymagany.\n';	
	} else {
		document.getElementById('email').style.background = '#fff';
	}
	var ilosc = document.getElementById('ilosc1').value;
	parseInt(ilosc); 
	if(ilosc<1)
	{	
		emptyFields++;
		document.getElementById('ilosc1').style.background = '#F6B2C1';
		errMessage += 'Podaj ilosc.\n';	
	} else {
		document.getElementById('ilosc1').style.background = '#fff';
	}
	var opis = document.getElementById('opis').value;
	if(opis=='')
	{	
		emptyFields++;
		document.getElementById('opis').style.background = '#F6B2C1';
		errMessage += 'Opis jest wymagany.\n';	
	} else {
		document.getElementById('opis').style.background = '#fff';
	}
	
	if(emptyFields>0)
	{
		alert(errMessage);
	} else {		
		document.getElementById('kwForms').submit();
	}
	
}

$(function() {
	$('#plboxGallery a').lightBox();
	$('a[rel*=lightbox]').lightBox(); 
});



$(function() {
	$(".slider").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 3
	});
});


$(document).ready(function(){
$('img.captify').captify({
	// all of these options are... optional
	// ---
	// speed of the mouseover effect
	speedOver: 'fast',
	// speed of the mouseout effect
	speedOut: 'normal',
	// how long to delay the hiding of the caption after mouseout (ms)
	hideDelay: 500,	
	// 'fade', 'slide', 'always-on'
	animation: 'slide',		
	// text/html to be placed at the beginning of every caption
	prefix: '',		
	// opacity of the caption on mouse over
	opacity: '0.7',					
	// the name of the CSS class to apply to the caption box
	className: 'caption-bottom',	
	// position of the caption (top or bottom)
	position: 'bottom',
	// caption span % of the image
	spanWidth: '100%'
});
			
$("#kwFormsLink").click(
function()
{
$("#kwiatekForm").toggle("normal");
});

// fields
$('textarea').addClass("idleField");
$('textarea').focus(function() {
	$(this).removeClass("idleField").addClass("focusField");
	if (this.value == this.defaultValue){
		this.value = '';
	}
	if(this.value != this.defaultValue){
		this.select();
	}
});
$('textarea').blur(function() {
	$(this).removeClass("focusField").addClass("idleField");
	if ($.trim(this.value == '')){
		this.value = (this.defaultValue ? this.defaultValue : '');
	}
});

$('input[type="text"]').addClass("idleField");
$('input[type="text"]').focus(function() {
	$(this).removeClass("idleField").addClass("focusField");
	if (this.value == this.defaultValue){
		this.value = '';
	}
	if(this.value != this.defaultValue){
		this.select();
	}
});
$('input[type="text"]').blur(function() {
	$(this).removeClass("focusField").addClass("idleField");
	if ($.trim(this.value == '')){
		this.value = (this.defaultValue ? this.defaultValue : '');
	}
});
// END fields
});




