function BookMark(url,titre){bookmarkurl=url;bookmarktitle=titre;if(navigator.appName!='Microsoft Internet Explorer'){window.sidebar.addPanel(bookmarktitle,bookmarkurl,"");}else{if(window.external)
window.external.AddFavorite(bookmarkurl,bookmarktitle);}}
function GetCommune(siteurl,pays,cm,cp){var xhr_object=null;if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.open("GET",siteurl+"inc/ajax_communes.php?pays="+pays+"&cm="+cm+"&cp="+cp,true);xhr_object.onreadystatechange=function(){var leConteneur=document.getElementById('listereference');if(xhr_object.readyState==4){if(xhr_object.status==200){leConteneur.innerHTML=xhr_object.responseText;}}else if(xhr_object.readyState==3){leConteneur.innerHTML="....";}}
xhr_object.send(null);}
function GetCommune2(siteurl,pays,cm,cp){var xhr_object2=null;if(window.XMLHttpRequest)
xhr_object2=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object2=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object2.open("GET",siteurl+"inc/ajax_communes.php?type=l&pays="+pays+"&cm="+cm+"&cp="+cp,true);xhr_object2.onreadystatechange=function(){var leConteneur2=document.getElementById('listereference2');if(xhr_object2.readyState==4){if(xhr_object2.status==200){leConteneur2.innerHTML=xhr_object2.responseText;}}else if(xhr_object2.readyState==3){leConteneur2.innerHTML="....";}}
xhr_object2.send(null);}
function GetSSProd(siteurl,reference,dur){var xhr_object=null;if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
data="reference="+reference+"&dur="+dur;xhr_object.open("POST",siteurl+"inc/ajax_ss_prod.php",true);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4){var leConteneur=document.getElementById('ssprod');leConteneur.innerHTML=xhr_object.responseText;}}
xhr_object.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhr_object.send(data);}
function gotofunc(url)
{location=url;}
function openWindow(name,width,height,url){win=window.open(url,name,"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=0,resizable=1,width="+width+",height="+height);win.moveTo(screen.width/2-(width/2),screen.height/2-(height/2));win.screenX=screen.width/2-(width/2);win.screenY=screen.height/2-(height/2);}
function openWindow2(name,width,height,url){win=window.open(url,name,"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);win.moveTo(screen.width/2-(width/2),screen.height/2-(height/2));win.screenX=screen.width/2-(width/2);win.screenY=screen.height/2-(height/2);}
function montre(id){var d=document.getElementById(id);if(d)tp=d.style.display;for(var i=0;i<=40;i++){if(document.getElementById('smenu'+i)){document.getElementById('smenu'+i).style.display='none';}}
if(d){if(tp=='none'){d.style.display='block';}}}
function ChangePrix(prix){document.getElementById('price').value=FormatCurrency(prix);}
function FormatCurrency(FIGURE){if(!FIGURE||FIGURE==""){FIGURE="0.00";}
var strTemp=FIGURE.toString();while(strTemp.indexOf(",")>-1){strTemp=strTemp.replace(",","");}
strTemp=parseFloat(strTemp);FIGURE=FIGURE.toString();var Place=FIGURE.indexOf(".");if(Place>-1){if((FIGURE.length-Place)==2){FIGURE+="0";}}
else{FIGURE+=".00";}
return FIGURE;}
function ConfirmDelete(id,url){urlto=url+'?delref='+id;if(confirm("Etes-vous sur?"))gotofunc(urlto);}
function CommuteAffichage(Bloc_visible){if(Bloc_visible==0)
{document.getElementById("bloc_AdresseLivraison").style.display="none";}
else
{document.getElementById("bloc_AdresseLivraison").style.display="block";}}
function chgphoto(url){document.getElementById("photoref").src=url;}
function EcrireCoul(res)
{window.document.getElementById('col').value=res;window.document.getElementById('field').value=res;}
function MM_openBrWindow(theURL,winName,features,Twidth,Theight){features2='status=no,resizable=no,scrollbars=no,width=800,height=600';features+=',width='+Twidth+',height='+Theight;if(window.screen){var left=(screen.width-Twidth)/2;var heigth=(screen.height-Theight)/2;features+=',left='+left+',top='+heigth;}
window.open(theURL,winName,features);}
