  function remove_photo_advert(idx){
   var idx;
  
  if( confirm('Czy napewno chcesz usunąc wybrane zdjęcie?') ){
    $("#AdvertEditPhoto_"+idx).toggle("slow");
    $.ajax({
        url: "/data/ajax/advert.php?remove_photo_advert="+idx,
        async: false
       }).responseText;
    };

  };




  function reload(href) {
    var href;
    if ( document.all ) {this.window.location.href( href );}
    else {this.window.location.href = href;}
  };
  
  
  
  
  
  
  function show_fotox( href )
  {
    if ( document.all ) {this.window.location.href( href );}
    else {this.window.location.href = href;}
  }




 function remove_user(idx) {
  var idx;

  if( confirm('Czy napewno chcesz usunąc wybranego znajomwego?') ){
    $("#ProfilFriendsList_"+idx).toggle("slow");
    $.ajax({
        url: "/profile/znajomi/"+idx+"/usun/",
        async: false
       }).responseText;
    };
 };
  //Usuwanie wiadomosci
  function remove_email(idx, rows){
    var idx, rows, href;


    if ( confirm('Chcesz usunąc wybraną wiadomość?') ){
     $("#"+rows).toggle("fast");

     $.ajax({
        url: "/data/ajax/mail.php?remove_email="+idx,
        async: false
       }).responseText;
    };

  };

  function add_vote(foto, value) {
    var foto, vote;
    
    vote = $("#"+value).val();

    $("#rating_1_text").text("Dziękujemy! Głos został zapisany");
    
    $.ajax({
        url: "/data/ajax/galery.php?add_vote="+vote+"&foto="+foto,
        async: false
       }).responseText;



  };



 function remove_user_photo(idx) {
  var idx;

  if( confirm('Czy napewno chcesz usunąć wybrane zdjęcie?') ){
    $("#GaleryUser_"+idx).toggle("slow");
    $.ajax({
        url: "/data/ajax/galery.php?remove_user_photo="+idx,
        async: false
       }).responseText;
    };
 };

 
 
 
 
 
  //Wybieranie adresata
  function choose_user() {

     $("#dialogusers").dialog({
         width:800,
         height:400,
         buttons: {
             "Anuluj": function() {
                 $(this).dialog("close");
             }
        },
        modal:true,
        overlay: {opacity: 0.9, background: "black"}
     });

     $("#dialogusers").css("display", "block")
     $("#dialogusers").load("/data/ajax/mail.php?choose_user");
     $("#dialogusers").parent().show();
     $('#dialogusers').dialog('open');

  };



  //wstawienie adresata
  function choose_user_idx(login, idx) {
     var login, idx;

     $("#recipient").val(login);
     $("#recipient_id").val(idx);
     $("#dialogusers").dialog("close");
  };

  function show_comments(section, idx, page){
    var section, idx, page;

    $("#comments").addClass("loadingForum");
    $("#comments").load("/data/ajax/comments.php?section="+section+"&show_comments="+idx+"&page="+page);
    $("#comments").removeClass("loadingForum");

  };




  function show_element(element){
    var element;
    $("#"+element).toggle("Slow");

  };




  /*Menu zwykle*/
  function show_element_array(elementarray){
    var elementarray, help = new Array() ;
    help = explode(",", elementarray, 100);

    for(var i = 0; i < help.length; i++ ) {
     $("#menu_"+help[i]).toggle("fast");
     $("#menux_"+help[i]).removeClass("MenuLeftNormal");
     $("#menux_"+help[i]).addClass("MenuLeftActive");
    }
    
  };

  function active_element(element){
    var element;
    $("#menu_"+element+" ").css("font-weight", "bold");
  };











   function explode(delimiter, string, limit)
   {
     var a = string.split(delimiter);
     if (arguments.length > 2) a = a.slice(0, limit);
     return a;
   }





