var cesta = Class.create();
cesta.prototype = {
    initialize: function(){
    },
    Add: function(form,url,urlGo){                        
        new Ajax.Request(url, {
    	        asynchronous:true, 
    	        evalScripts:true, 
    	        method:'get',
    	        parameters:Form.serialize(form),
    	        onComplete : function(req){ 
        	                var json = req.responseText.evalJSON();            	    
        	                if(json.isAdd){
        	                
        	                    location.href= urlGo;                                      	                        
        	                                	                    
        	                } else {        	                    
        	                    location.href= urlGo; 
        	                }        	                
       		            }
    	    });
    	    
    	    
    },
    AddCaixa: function(qtd,url,urlGo){
        var options = {qtd:qtd};                        
        new Ajax.Request(url, {
    	        asynchronous:true, 
    	        evalScripts:true, 
    	        method:'get',
    	        parameters:qtd,
    	        onComplete : function(req){ 
        	                var json = req.responseText.evalJSON();            	    
        	                if(json.isAdd){
        	                
        	                    location.href= urlGo;                                      	                        
        	                                	                    
        	                } else {        	                    
        	                    location.href= urlGo; 
        	                }        	                
       		            }
    	    });
    	    
    	    
    },
    Jump: function(enviado,alvo,tamanho){
            if($F(enviado).length == tamanho){ $(alvo).select() ; }
        },
    Paste: function(enviado,alvo){
            $(alvo).value = enviado;
        }, 
    FecharPedido: function(url){
        location = url;
    },    	
	Init:function(){	
	}	
 };

