function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
} 

$(document).ready(function(){
	
	$(".wizualny").colorbox({width:"795px", height:"670px", iframe:true});

	$(".zebra tr:even").css("background-color", "#f6f3ef");
			
	$('.one-three:nth-child(4n)').addClass('even');
	$('.projekt:nth-child(4n)').addClass('even');
	$('a.ban:nth-child(3n)').addClass('even');
	$('.thumb:nth-child(2n+1)').addClass('even');
	
	$( "#tabs" ).tabs();

	//$(".accordion h3:first").addClass("active");
	$(".accordion div.zawartosc").hide();

	$(".accordion h3").click(function(){
		$(this).next("div.zawartosc").slideToggle("slow")
		.siblings("div.zawartosc:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
	

	$(".accordion a.openall").click(function(){
		$(".accordion div.zawartosc").show();
	});
	
		$(".accordion a.closeall").click(function(){
		$(".accordion div.zawartosc").hide();
	});
	
	
	$('a.ban').hover(
		function(){  
			$('.zoom',this).animate({opacity:'show'},300);
		}, function() {  
			$('.zoom',this).animate({opacity:'hide'},300);
	});
	
	
	
	
	$('.main-foto').hover(
		function(){  
			$('.zoombig',this).animate({opacity:'show'},200);
		}, function() {  
			$('.zoombig',this).animate({opacity:'hide'},200);
	});
	
	$('.thumb').hover(
		function(){  
			$('.zoomsmall',this).animate({opacity:'show'},200);
		}, function() {  
			$('.zoomsmall',this).animate({opacity:'hide'},200);
	});

});




/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {


    jQuery('#mycarousel-nextpage').bind('click', function() {
		carousel.options.scroll=4
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prevpage').bind('click', function() {
		carousel.options.scroll=4
        carousel.prev();
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
		carousel.options.scroll=1
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
		carousel.options.scroll=1
        carousel.prev();
        return false;
    });
};

// Ride the carousel...
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});


			$(".colorbox").each(function() {
				var obj = $(this);
				var obj_settings = {};
				if(obj.data("lightbox")){					
					var jObj = jQuery.parseJSON(obj.data("lightbox").toString().replace(/'/g, '"'));
					obj_settings = jObj;
					obj_settings.rel = jObj.group;
				}
						
				obj.colorbox(obj_settings);
			})
