function JS_test_poid_max_prix_max(textpoids,prix) {
	if (textpoids=="") textpoids = "Votre poids est superieur a 161Kg, veuillez nous contacter par email a contact@colony.fr";
	if (prix=="") prix = 19.90;
	
	if ($('testverificationpanier')){
		/*$('testverificationpanier').addEvent('click',function(e){
			e.stop();
			new Request.HTML({
	            url: "test-poids.html",
	            data: "",
	            onSuccess: function(html){
	                if (html=='NO'){
	                	alert(textpoids);
	                	return "";
	                }
	                if ($('cartPriceAll')) {
	                	if ($('cartPriceAll').get('text')<prix)
	                	{
	                		alert("Votre commande doit etre de "+prix+"Euros minimum ")
	                	}
	                	else
	                		document.location="passer-commande.html";
	                }
	            },
	            onRequest: function(){
	            
	            }
	        }).send();
		});
       */
	}
}

function radioFrais()
{
	var radioExpe = '';
	
	radioExpe = $$('.cartPriceShipRadio');
	if(radioExpe[0])
	{
		$('cartPriceAll').set("text", ($('cartTotal').get('text').toFloat() + radioExpe[0].get('value').toFloat()).round(2) );
		radioExpe[0].set('checked', 'checked');
		
		radioExpe.each(function(el){
			el.addEvent('click', function(){
				$('cartPriceAll').set("text", ($('cartTotal').get('text').toFloat() + el.get('value').toFloat()).round(2) );
			})
		})
	}
}

function fraisPortParPays(){
	if ($("paysfraisport")){
        radioFrais();
		$("paysfraisport").addEvent("change", function(){
			selectPaysChange();
		})
		
		if ($("testverificationpanier")){
			$("testverificationpanier").addEvent("click", function(e){
				e.stop();
				new Request.HTML({
		            url: "frais-port.html",
		            data: $("cartPriceShip").toQueryString() + "&paysfraisport=" + $("paysfraisport").get("value") + "&comingFrom=ajax",
		            onSuccess: function(html){
		                document.location = $("testverificationpanier").get("href");
		            },
		            onRequest: function(){
		            	$("testverificationpanier").set("text", "...")
		            }
		        }).send();
			})
		}
	}
}

function selectPaysChange(){
	new Request.HTML({
        url: "frais-port.html",
        data: "paysfraisport=" + $("paysfraisport").value + "&comingFrom=ajax",
        onSuccess: function(html){
            $("cartPriceShip").set("text", "");
            $("cartPriceShip").adopt(html);
            radioFrais();
        },
        onRequest: function(){
        	$("cartPriceShip").addClass("working");
        }
    }).send();
}