﻿// JScript File

// globalhandlers

var myGlobalHandlers = {
  onCreate: function(){
    Element.show('gallerySwitch');
  },
  onComplete: function() {
  if(Ajax.activeRequestCount == 0){
    Element.hide('gallerySwitch');
  }
    }
  };
  Ajax.Responders.register(myGlobalHandlers);
//------------------------------------------------//



// ajax req. handlers
function AjaxUpdateRequest(url, param, target){
    var trg = $(target)
	url = url;
		pars = param;
	    var myAjax = new Ajax.Updater(
		    trg, 
		    url, 
		    {	
			    method: 'post', 
			    parameters: pars
		    });	
		    
}

function AjaxRequest(url, param){

new Ajax.Request(url, {
  method: 'get', parameters: param,
  onSuccess: function(transport) {
        //alert('ok');            
    },
   onFailure: function(){
        alert('Ajax request error');   
   } 
});

}


