var ajaxManager = $.manageAjax.create('cacheQueue', {
    queue: true,
    maxRequests:5,
    abortOld:true,
    preventDoubbleRequests:true,
    cacheResponse: false
});

function fileup(link) {
       ajaxManager.add({
               contentType: "application/x-www-form-urlencoded;charset=ISO-8859-2",
               type: "GET",
               url: link,
               dataType: "html",
               timeout: 5000,
       	       beforeSend:function(req) {
                        $("#loader").html("Wczytuje dane");
   			$("#loader").addClass("unhide");
               },
               success: function(data){
                   $("#main_tresci").html(data);
                   $("#loader").removeClass("unhide");
               },
               error: function(request,error) {
                   if (error = "timeout") {
                       $("#loader").removeClass("unhide");
                   }
               }
       });
}

function message() {
      ajaxManager.add({
          contentType: "application/x-www-form-urlencoded;charset=ISO-8859-2",
          url: "index/index/ajax/lostpassword.php",
          type: "POST",
          timeout: 5000,
          data: {
              email: $("#email").val()
          },
       	  beforeSend:function() {
              $("#loader").html("Wysyłam");
   	      $("#loader").addClass("unhide");
          },
          dataType: "html",
          success: function(data){
             spo = data.split(":");
             if (spo[0] == 'ALERT') jAlert(spo[1]);
             $("#email").val("");
             $("#loader").removeClass("unhide");
          },
          error: function(request,error) {
                   if (error = "timeout") {
                       $("#loader").removeClass("unhide");
                       $("#error").html("<font color=red>Skrypt nie wysłał wiadomości.</font>");
                   }
          }
       });
}

$(document).ready(function(){
var newsoption1 = {
  firstname: "nowosci",
  secondname: "showhere",
  thirdname:"news_display",
  fourthname:"news_button",
  playingtitle:"Wyświetlane:",
  nexttitle:"Następny:",
  prevtitle:"Poprzedni:",
   newsspeed:'10000',
   effectis: 0,
   imagedir: 'imagesnew/easynews/',
   isauto: false
}
$.init_news(newsoption1);


});
