$(document).ready(function(){
	
/*
 *	Przezroczystość PNG dla IE6
 *  Plugin jquery.ifixpng.js
 *  
 */
	
	$('#box1img').ifixpng();
    $('.boxTop').ifixpng();
    $('#logowanieContener').ifixpng();
    $('#topContent').ifixpng();
    $('#boxForum').ifixpng();
    $('.boxBottom a img').ifixpng();
    $('.boxTitle').ifixpng();
    $('.boxIcon').ifixpng();
    $('h1.podstronaTitle').ifixpng();
    $('.podstronaBottom').ifixpng();
    $('.podstronaTitle img').ifixpng();
	$('#podstrNav-left').ifixpng();
	$('#podstrNav-right').ifixpng();
	$('#statsChart').ifixpng();
    
/*
 *	Zjazd panelu logowania
 *
 */
    
    $("#logowanieContener").slideDown(1500, function(){
        $("#logowanie").fadeIn(2000, function() {
			$('.pngfix').ifixpng();	
		});
    });
    
/*
 *	Animacja menu w stopce
 *
 */    
	
	$('#mainNav li a').hover(function(){
        $(this).fadeOut("fast");
        $(this).fadeIn("slow");
    }, function(){
        
    });
	

/*
 *	Animacja menu podstrony
 *
 */ 	
	
	$('#podstr-nav li a').hover(function(){
        $(this).fadeOut("fast");
        $(this).fadeIn("slow");
    }, function(){
        
    });
	
	$('ul#podstr-nav').jcarousel({
	   	scroll: 1
	});
	
	$('.jcarousel-skin-menu .jcarousel-prev-horizontal').ifixpng();
	$('.jcarousel-skin-menu .jcarousel-next-horizontal').ifixpng();
	
	
/*
 *	Konfiguracja faceboxa
 *
 */	
	
	$('a[rel*=facebox]').facebox();

/*
 *	Animacje formularzy
 *
 */    
    // efekt hoover dla wierszy
	
	$('.table2Td tbody tr,.contentTable tbody tr').not(".noHover").hover(function(){
    	$(this).addClass("hoverRow");				
    }, function(){
        $(this).removeClass("hoverRow");
    });
	
	// efekt zmiany tła dla textfieldów
    
    $('.table2Td tbody td input,.podstronaContent input').change(function(){
        $(this).fadeOut(100);
        $(this).addClass("inputClick")
        $(this).fadeIn("fast");
    });
	
	$('.table2Td tbody td select,.podstronaContent select').change(function(){
        $(this).fadeOut(100);
        $(this).addClass("selectClick")
        $(this).fadeIn("fast");
    });
	
	$('.table2Td tbody td textarea,.podstronaContent textarea').change(function(){
        $(this).fadeOut(100);
        $(this).addClass("textareaClick")
        $(this).fadeIn("fast");
    });
	
	// zaznaczanie błędów dla wierszy
	
	$(".errorInput").parent().parent().addClass("hoverRow");
	
	// usnięcie formatowanie css dla checkboxów
	
	$('.table2Td tbody td input:checkbox').addClass('checkbox');
	$('.table2Td tbody td input:radio').addClass('checkbox');
	
 
	
    
    
/*
 *	TMP - animacja okna
 *
 */   
    
    $("#closeLink").toggle(function(){
        $(this).removeClass("close1");
        $("#helloText").fadeOut("slow", function(){
            $("#closeLink").addClass("close2");
        });
    }, function(){
        $(this).removeClass("close2");
        $("#helloText").fadeIn("slow", function(){
            $("#closeLink").addClass("close1");
        });
        
    });	
	
/* 
 *  Likwidacja focusa dla input
 * 
 */	

	$("input[type=submit],a.orangeLink, .contLnk").bind("focus",function(){
		if(this.blur)this.blur();
	});
	
	$("input[type=radio],input[type=checkbox]").addClass('checkbox');
	

                		
    
/*
 *	Podmiana nagłówków h1 na obrazki z tekstem dla podstrony
 *
 */  
	
	/*    
	 $('h2.solo').each(function(){
	 	$(this).css('border-bottom','1px solid #CCC');
        $element = $(this);
        $tmp = $element.text()
        $element.text("");
        $("<img src='http://gametec.pl/lib/phpThumb/phpThumb.php?new=000000&amp;w=835&amp;h=40&amp;fltr[]=wmt|"+$tmp+"|14|L|CCCCCC|neuropol.ttf|100&amp;f=png' width='835' height='40' alt='"+$tmp+"' />").appendTo($element);
    });
    */
	
	$('div#page-body > h2').each(function(){
	 	$(this).css('border-bottom','1px solid #CCC');
        $element = $(this);
        $tmp = $element.text()
        $element.text("");
        $("<img src='http://gametec.pl/lib/phpThumb/phpThumb.php?new=000000&amp;w=835&amp;h=40&amp;fltr[]=wmt|"+$tmp+"|14|L|CCCCCC|neuropol.ttf|100&amp;f=png' width='835' height='40' alt='"+$tmp+"' />").appendTo($element);
    })
	
/*
 *	Okno underConstruction
 *
 */ 	
 	//$("a[href='#']").not("a.active-link").attr("href","#underConstruction").facebox();
	 
}); //koniec
