/** bibliothèque javascript pour LVA.
 * CORE
 *
 *
 *
 */    
 
// general popup
var newWin = null;
function popUp(strURL, strHeight, strWidth, other) {
 if (newWin != null && !newWin.closed)
   newWin.close();
 var strOptions="";
 strOptions="height="+strHeight+",width="+strWidth+','+other;
 newWin = window.open(strURL, 'newWin', strOptions);
 newWin.focus();
}
// decode mail (fonctionne de pair avec la fonction PHP mail_encode dans lib/functionslib)
function mail_decode(st,lab,xk,html){
	if (!html) html='';
  var r="";for(i=0;i<st.length;i++)r+=String.fromCharCode(xk^st.charCodeAt(i));
	document.write ('<a href="mailto:'+r+'" '+html+'>'+lab+'</a>');
}


function showSogeBlock(s){
	   	var e = document.getElementById('sogeBlock');
	   	if (!s) e.style.display = "none";
		}
function check(){
		var frm = document.forms["box"];
	   	if  (frm.cdv.checked == 1){
			var e = document.getElementById('sogeBlock');
			e.style.display = "block";
		}
		else alert("Veuillez confirmer que vous avez bien pris connaissance de nos conditions générales de vente ");
	
		 }
function checkgratuit(){
		var frm = document.forms["box"];
	   	if  (frm.cdv.checked == 1){
			return true;
		}
		else { alert("Veuillez confirmer que vous avez bien pris connaissance de nos conditions générales de vente ");
			return false;
		 }
		 }

function ajouterchamp(i)	{dom.insert("ajoutnode","p","pemail"+i);dom.createInput("pemail"+i,"texte","email"+i,"email"+i);dom.insert("email"+i,"label","lemail"+i);$('lemail'+i).innerHTML="Adresse e-mail "+i; }