  /**
   * 
   * @author Paweł Gruchociak, 2011
   * @link http://www.oneplusone.pl
   */    
    
    
var DEBUG = true;
    
jQuery(document).ready(function()
{


    
    
    // biuletyn form
    
    $("#header #submit").click(function(e){
        e.preventDefault();
        debug("click submit button");
        
        $.post(BASE_URL+"biuletyn/add", $("#header :input").serialize(), function(data){
            
            
            debug("RESPONSE: "+data.info);
            $("#infoBox").fadeOut(0).html( data.info ).fadeIn().delay(2000).fadeOut();
            if(data.status)
                $("#biuletyn").val("");
            
        });
        
    });
    
    
    
    $(".buy button").click(function(e){
          e.preventDefault();
          var rel = $(this).attr("rel");
          debug("buy: "+ rel);
          
          window.location = BASE_URL +  rel;
    });
      
});


function debug(msg){
    if(DEBUG) console.log(msg);
}
