function AJAXReplace(what, where)
{
				
	
				
	                	 
	                $.ajax({
	                                      url: what,
	                                      cache: false,
	                                      type: "POST",
	                                      data: "isAjax=1",
	                                      success: function(html)
	                                      {
	                							if(where != '')
	                							{
		                                    	 	$(where).fadeOut(400,
		                                            function()
		                                              {

			                                    	 		$(where).html(html).fadeIn(400);
			                                                onEveryAjax();	    	                            	 			
		    	                            	 		
		                                              });
	                							}
	                                      }
	                                      
	                                     });

};

function AJAXFormSubmit(what, where, callback)
{
         //if(preloaderClass == undefined) preloaderClass = "preloader";
         //document.getElementById(where).innerHTML = '<img src="./img/main/loader.gif" class="'+ preloaderClass + '">';
         //return HTML_AJAX.formSubmit(what, where);
     
     var options = {
    	success: function(html)
          {                           
                
    	       
    	 $(where).fadeOut(400,
                function()
                {
    		 		if(callback) callback();      
   		    		 
    		 		$(this).html(html).fadeIn(600);

                   // onEveryAjax();

                });
          }
        };

//      if(whatwhere == "what")
//      {
//        $("#" + what).ajaxSubmit(options).html('<img src="./img/main/loader.gif" class="'+ preloaderClass + '">');
//      };

       $(what).ajaxSubmit(options);
     
     //document.getElementById(where).innerHTML = '<img src="./img/main/loader.gif" class="'+ preloaderClass + '">';
       //$("#" + where).html('<img src="./img/main/loader.gif" class="'+ preloaderClass + '">');
       //$("#" + what).fadeOut(400,
      // function()
       //{
              //$("#loaderLayer").css("visibility", "visible").fadeIn(400,
              //function()
              //{
                //$("#" + what).ajaxSubmit(options);
                //onEveryAjax();
              //});
       
       
       //});

        // other available options:
        //url:       url         // override for form's 'action' attribute
        //type:      type        // 'get' or 'post', override for form's 'method' attribute
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type)
        //clearForm: true        // clear all form fields after successful submit
        //resetForm: true        // reset the form after successful submit

        // $.ajax options can be used here too, for example:
        //timeout:   3000


        //$("#" + where).html('<img src="./img/main/loader.gif" class="'+ preloaderClass + '">');
        // inside event callbacks 'this' is the DOM element so we first
        // wrap it in a jQuery object and then invoke ajaxSubmit



        return false;
};





