var $ = jQuery.noConflict();
function blue(){
$(".promocje_title").animate(
      {color: "white" }, 
      {duration: 1000}, 
      {complete: function(){blue();}});
      
$(".promocje_title").animate(
      {color: "blue" }, 
      {duration: 1000}, 
      {complete:function(){white();}});
} 
setInterval("blue();", 2000);

  
$(document).ready(function(e){
  
    
    
    
    $(".promocje_title").animate({color: "white" }, 1000);
    if($('.ad-gallery').html()){
        $(function() {
            var galleries = $('.ad-gallery').adGallery();
            galleries[0].settings.effect = 'fade';
            $('#toggle-slideshow').click(
                function() {
                    galleries[0].slideshow.toggle();
                    return false;
                }
                );
        });
    }
    
    $(function() {
    	$('a[rel*=lightbox]').lightBox();
    });
    $('.gallery a').livequery(function(){
      $(this).each(function(index,item){
        $(item).lightBox();
      });
    });
    

    $('.next_promotion').livequery(function(){
        $(this).click(function(e){
            //$('.promocje table').html('<tr><td valign="center" align="center"><img class="loader" style="border:none;width:25px;" src="/layouts/delin/img/loader.gif"></td></tr>');
            $.ajax({
                url: $(this).attr('href'),
                success: function(t){
                    $('.promocje table').html(t);
                }
            });
            return false;
        });
    });
    $('.next_producent').livequery(function(){
        $(this).click(function(e){
           //$('.producenci table').html('<tr><td valign="center" align="center"><img class="loader" style="border:none;width:25px;" src="/layouts/delin/img/loader.gif"></td></tr>');
            $.ajax({
                url: $(this).attr('href'),
                success: function(t){
                    $('.producenci table').html(t);
                }
            });
            return false;
        });
    });
    
    $('#contactForm').submit(function(e){  		
        var act= $(this).attr('action');
		
    	var options = { 					
			url: act,
			success: function(a){				
				$('.contactForm').html(a);					
			}			    				
		};
		$(this).ajaxSubmit(options);	
		return false;
    });
	
});

