function addToNote(e){ 
    // get element 
    element = Event.element(e);     
    // as soon as possible 
    element.toggleClassName('active'); 
    
    // get rubric
    var id = element.readAttribute('id');
    var rub = element.readAttribute('rubric'); 
		
    //var item = (rub)?{'options':{'rubric':rub},'id':id}:{'id':id};
    
   	 var item = {'id':id}; 
     
    if(myCart.hasProduct(item)){    	
	    myCart.delProduct(item);
	  }else{ 
	    myCart.addProduct(item); 
	   } 
	return false; 
} 
  
   
function initNote(){
	 	if($(note_id)) {
  		myCart = new ExologCart({'infoCart':[{'div':note_id,'template':'({count_products})','template_empty':' '}]});  		
  		if($$(note_class) ) {
    	    $$(note_class).each(function(s) {
    	    if(myCart.hasProductById(s.id)){s.toggleClassName('active'); }    	    
	        Event.observe(s, 'click', addToNote.bindAsEventListener());
	         
	    }); 
    }
	} 	
} 
  
   Event.observe(document, 'dom:loaded', initNote);
