// JavaScript Document
function checkRNPAvailable()
	{
		$.ajax({async:false,type: "GET",url: "http://www.receiveandpay.com/wallet/engine/available.cgi",success: function(xml)
	   	{
	    	var statusrnp=$(xml).attr('status');
	    	if(statusrnp == "OK")return 1;else return 0;
		}})	 
	}

$(function(){
		$(".doublepost").each(function(){
					
					urlEmv="http://ase.emv3.com/D2UTF8?emv_tag=47B2FB7F1280847B&emv_ref=BdX7CqkdEeYJxRd_AuQN7LzWKkR6FKnEiA7C&EMAIL_FIELD="+$(".doublepost input[name='client_email']").val()+"&FIRSTNAME_FIELD="+$(".doublepost input[name='client_nom']").val()+"&LASTNAME_FIELD="+$(".doublepost input[name='client_prenom']").val()+"&EMVCELLPHONE_FIELD="+$(".doublepost input[name='client_port']").val()+"&ADRESSE1_FIELD="+$(".doublepost input[name='client_adresse']").val()+"&CP_FIELD="+$(".doublepost input[name='client_cp']").val()+"&VILLE_FIELD="+$(".doublepost input[name='client_ville']").val()+"&PAYS_FIELD="+$(".doublepost input[name='client_pays']").val()		
					
					
					
					$.ajax({async:true,type: "GET",url: urlEmv ,success: function(xml)	{}})	
									   
									   
									   
		})
		
		
		   
		   
		   $("label:hidden").each(function(){
										   titre=$(this).text();
										  cible="input[name="+$(this).attr("for") +"]"
										    if($(cible).size()>0){
													
													
													
													if($(cible).hasClass("pass")){
														$(cible).replaceWith("<input name=\""+$(cible).attr("name")+"\" type=\"text\" class=\""+$(cible).attr("class")+" pass\"/>")
														
														
													}
													
													$(cible).val(titre)   
													
													
													$(cible).click(function(){
																			
										 					 label="label[for="+$(this).attr("name") +"]:eq(0)"
															 
															if($(this).val()==$(label).text()){
																
																$(this).val('')
																	if($(this).hasClass("pass")){
																		$(this).replaceWith("<input name=\""+$(this).attr("name")+"\" type=\"password\" class=\""+$(this).attr("class")+" pass\"/>").select()
																	
																	}
															
												
															
															}
																			
																			
													})
											}
										   
			})
		   
		   

		   
		   	 
			 $("*[@id^='fact_']").change(function(){
													  if(!$(this).attr('checked')){
													  nom="#livr"+$(this).attr('id').substring(4); valeur=$(this).val();$(nom).val(valeur)}
			 })
			 
			 $(".viewlivraison").change(function(){
												 if($(this).attr('checked')){
													 $("#livraison").show();
													// $("*[@id^='livr_']").val('')
												 }else{
													  $("*[@id^='fact_']").each(function(){
													  nom="#livr"+$(this).attr('id').substring(4); valeur=$(this).val();$(nom).val(valeur)
													 })
													 $("#livraison").hide();
													 
												 }
												 
				 })
		   
		   
		   
		   
		   $(".fichette .gris:has(.illus)").each(function(){
															if($(".illus",this).css("float")=="left"){
																$("dl",this).css("margin-left","65px")
																$("dt",this).css("float","right")
																$("dd .red",this).css("margin-left","135px")
											
															}
															
															});
	
		   
})



function popuprnp(){
var win2 = window.open('http://www.receiveandpay.com/wallet/customer/popup3x.php?logo=xxxx','popup','height=945,width=616,status=yes,scrolbars=yes,menubar=no,resizable=yes');
}