var COLOR_SELECT = '#F7D132';var COLOR_DEFAULT = '#FFFFFF';
var loadstatustext=" Chargement en cours...";
var xhr = null;
var refresh_dependant_frame_array_target = new Array();
var refresh_dependant_frame_array_url = new Array();
var refresh_dependant_frame_array_type = new Array();
var refresh_dependant_frame_array_object = new Array();
function PPWEB_histo(id_div)
{
if(document.getElementById('div_histo_'+id_div).style.visibility == 'visible')
{
document.getElementById('div_histo_'+id_div).style.visibility = 'hidden';
document.getElementById('div_histo_'+id_div).style.display = 'none';
}
else
{
document.getElementById('div_histo_'+id_div).style.visibility = 'visible';
document.getElementById('div_histo_'+id_div).style.display = 'block';
}
}
function PPWEB(type)
{
if(document.getElementById('RPPP').checked == true || document.getElementById('mauvaise_critique').checked == true)
document.getElementById('div_supplement').style.visibility = 'visible';
else
document.getElementById('div_supplement').style.visibility = 'hidden';
if(type=='rppp' && document.getElementById('RPPP').checked == true && document.getElementById('mauvaise_critique').checked == true)
document.getElementById('mauvaise_critique').checked = false;
if(type=='bad' && document.getElementById('RPPP').checked == true && document.getElementById('mauvaise_critique').checked == true)
document.getElementById('RPPP').checked = false;
}
nombre_appel_ajax = 0;
function getXhr()
{
nombre_appel_ajax++;
//alert('xhr'+nombre_appel_ajax);
//if(window.XMLHttpRequest)xhr = new XMLHttpRequest();
if(window.XMLHttpRequest) eval('xhr'+nombre_appel_ajax+ ' = new XMLHttpRequest()');
else if(window.ActiveXObject)
{
try
{
//xhr = new ActiveXObject('Msxml2.XMLHTTP');
//eval('xhr'+nombre_appel_ajax) = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e)
{
//xhr = new ActiveXObject('Microsoft.XMLHTTP');
//eval('xhr'+nombre_appel_ajax) = new ActiveXObject('Microsoft.XMLHTTP');
}
}
else
{
//alert('Votre navigateur ne supporte pas les objets XMLHTTPRequest...');
//xhr = false;
eval('xhr'+nombre_appel_ajax) = false;
}
return 'xhr'+nombre_appel_ajax;
}
function BuildPostString(formname)
{
//obj = document.getElementById(formname);
obj = formname;
//alert(obj);
var encode_pour_ajax;
encode_pour_ajax = false;
var poststr = '';
//alert(obj.length);
for(compte_objet = 0 ; compte_objet < obj.length ; compte_objet++)
{
//alert('dedans');
//alert(obj.elements[compte_objet].id+' = '+obj.elements[compte_objet].value);
if(obj.elements[compte_objet].id == 'encode_pour_ajax' && obj.elements[compte_objet].value == 'true')
{
encode_pour_ajax = true;
}
if(obj.elements[compte_objet].type == 'radio' || obj.elements[compte_objet].type == 'checkbox')
{
if(obj.elements[compte_objet].checked == true)
poststr += obj.elements[compte_objet].id+'='+encodeURI(obj.elements[compte_objet].value)+'&';
}
else if(obj.elements[compte_objet].id == 'ExternalInterfaceChrono')
{
//
}
else
{
if (formname.id == 'form_template' && obj.elements[compte_objet].id == 'template_contenu')
{
var template_value = obj.elements[compte_objet].value;
template_value = template_value.split('+');
template_value = template_value.join('[[PLUS]]');
obj.elements[compte_objet].value = template_value;
}
if(obj.elements[compte_objet].id == 'refresh_dependant_frame_1_target')
refresh_dependant_frame_array_target[1] = encodeURI(obj.elements[compte_objet].value);
else if(obj.elements[compte_objet].id == 'refresh_dependant_frame_1_url')
refresh_dependant_frame_array_url[1] = encodeURI(obj.elements[compte_objet].value);
else if(obj.elements[compte_objet].id == 'refresh_dependant_frame_1_type')
refresh_dependant_frame_array_type[1] = encodeURI(obj.elements[compte_objet].value);
else if(obj.elements[compte_objet].id == 'refresh_dependant_frame_1_object')
refresh_dependant_frame_array_object[1] = encodeURI(obj.elements[compte_objet].value);
else
{
//alert(obj.elements[compte_objet].id);
var chaine=obj.elements[compte_objet].value;
var reg;
//alert(chaine);
reg=new RegExp("(')", "g");
chaine = chaine.replace(reg, "’");
/*
// Accent é
reg=new RegExp("(é)", "g");
chaine = chaine.replace(reg, "é");
*/
reg=new RegExp("(’)", "g");
chaine = chaine.replace(reg, "’");
reg=new RegExp("(é)", "g");chaine = chaine.replace(reg, "é");reg=new RegExp("(œ)", "g");chaine = chaine.replace(reg, "œ");reg=new RegExp("(Ÿ)", "g");chaine = chaine.replace(reg, "Ÿ");reg=new RegExp("(¡)", "g");chaine = chaine.replace(reg, "¡");reg=new RegExp("(¤)", "g");chaine = chaine.replace(reg, "¤");reg=new RegExp("(¥)", "g");chaine = chaine.replace(reg, "¥");reg=new RegExp("(€)", "g");chaine = chaine.replace(reg, "€");reg=new RegExp("(£)", "g");chaine = chaine.replace(reg, "£");reg=new RegExp("(¢)", "g");chaine = chaine.replace(reg, "¢");reg=new RegExp("(¦)", "g");chaine = chaine.replace(reg, "¦");reg=new RegExp("(§)", "g");chaine = chaine.replace(reg, "§");reg=new RegExp("(¨)", "g");chaine = chaine.replace(reg, "¨");reg=new RegExp("(©)", "g");chaine = chaine.replace(reg, "©");reg=new RegExp("(ª)", "g");chaine = chaine.replace(reg, "ª");reg=new RegExp("(«)", "g");chaine = chaine.replace(reg, "«");reg=new RegExp("(¬)", "g");chaine = chaine.replace(reg, "¬");reg=new RegExp("()", "g");chaine = chaine.replace(reg, "");reg=new RegExp("(®)", "g");chaine = chaine.replace(reg, "®");reg=new RegExp("(¯)", "g");chaine = chaine.replace(reg, "&masr;");reg=new RegExp("(°)", "g");chaine = chaine.replace(reg, "°");reg=new RegExp("(±)", "g");chaine = chaine.replace(reg, "±");reg=new RegExp("(²)", "g");chaine = chaine.replace(reg, "²");reg=new RegExp("(³)", "g");chaine = chaine.replace(reg, "³");reg=new RegExp("(´)", "g");chaine = chaine.replace(reg, "´");reg=new RegExp("(µ)", "g");chaine = chaine.replace(reg, "µ");reg=new RegExp("(¶)", "g");chaine = chaine.replace(reg, "¶");reg=new RegExp("(·)", "g");chaine = chaine.replace(reg, "·");reg=new RegExp("(¸)", "g");chaine = chaine.replace(reg, "¸");reg=new RegExp("(¹)", "g");chaine = chaine.replace(reg, "¹");reg=new RegExp("(º)", "g");chaine = chaine.replace(reg, "º");reg=new RegExp("(»)", "g");chaine = chaine.replace(reg, "»");reg=new RegExp("(¼)", "g");chaine = chaine.replace(reg, "¼");reg=new RegExp("(½)", "g");chaine = chaine.replace(reg, "½");reg=new RegExp("(¾)", "g");chaine = chaine.replace(reg, "¾");reg=new RegExp("(¿)", "g");chaine = chaine.replace(reg, "¿");reg=new RegExp("(À)", "g");chaine = chaine.replace(reg, "À");reg=new RegExp("(Á)", "g");chaine = chaine.replace(reg, "Á");reg=new RegExp("(Â)", "g");chaine = chaine.replace(reg, "Â");reg=new RegExp("(Ã)", "g");chaine = chaine.replace(reg, "Ã");reg=new RegExp("(Ä)", "g");chaine = chaine.replace(reg, "Ä");reg=new RegExp("(Å)", "g");chaine = chaine.replace(reg, "Å");reg=new RegExp("(Æ)", "g");chaine = chaine.replace(reg, "&Aelig;");reg=new RegExp("(Ç)", "g");chaine = chaine.replace(reg, "Ç");reg=new RegExp("(È)", "g");chaine = chaine.replace(reg, "È");reg=new RegExp("(É)", "g");chaine = chaine.replace(reg, "É");reg=new RegExp("(Ê)", "g");chaine = chaine.replace(reg, "Ê");reg=new RegExp("(Ë)", "g");chaine = chaine.replace(reg, "Ë");reg=new RegExp("(Ì)", "g");chaine = chaine.replace(reg, "Ì");reg=new RegExp("(Í)", "g");chaine = chaine.replace(reg, "Í");reg=new RegExp("(Î)", "g");chaine = chaine.replace(reg, "Î");reg=new RegExp("(Ï)", "g");chaine = chaine.replace(reg, "Ï");reg=new RegExp("(Ð)", "g");chaine = chaine.replace(reg, "ð");reg=new RegExp("(Ñ)", "g");chaine = chaine.replace(reg, "Ñ");reg=new RegExp("(Ò)", "g");chaine = chaine.replace(reg, "Ò");reg=new RegExp("(Ó)", "g");chaine = chaine.replace(reg, "Ó");reg=new RegExp("(Ô)", "g");chaine = chaine.replace(reg, "Ô");reg=new RegExp("(Õ)", "g");chaine = chaine.replace(reg, "Õ");reg=new RegExp("(Ö)", "g");chaine = chaine.replace(reg, "Ö");reg=new RegExp("(×)", "g");chaine = chaine.replace(reg, "×");reg=new RegExp("(Ø)", "g");chaine = chaine.replace(reg, "Ø");reg=new RegExp("(Ù)", "g");chaine = chaine.replace(reg, "Ù");reg=new RegExp("(Ú)", "g");chaine = chaine.replace(reg, "Ú");reg=new RegExp("(Û)", "g");chaine = chaine.replace(reg, "Û");reg=new RegExp("(Ü)", "g");chaine = chaine.replace(reg, "Ü");reg=new RegExp("(Ý)", "g");chaine = chaine.replace(reg, "Ý");reg=new RegExp("(Þ)", "g");chaine = chaine.replace(reg, "þ");reg=new RegExp("(ß)", "g");chaine = chaine.replace(reg, "ß");reg=new RegExp("(à)", "g");chaine = chaine.replace(reg, "à");reg=new RegExp("(á)", "g");chaine = chaine.replace(reg, "á");reg=new RegExp("(â)", "g");chaine = chaine.replace(reg, "â");reg=new RegExp("(ã)", "g");chaine = chaine.replace(reg, "ã");reg=new RegExp("(ä)", "g");chaine = chaine.replace(reg, "ä");reg=new RegExp("(å)", "g");chaine = chaine.replace(reg, "å");reg=new RegExp("(æ)", "g");chaine = chaine.replace(reg, "æ");reg=new RegExp("(ç)", "g");chaine = chaine.replace(reg, "ç");reg=new RegExp("(è)", "g");chaine = chaine.replace(reg, "è");reg=new RegExp("(ê)", "g");chaine = chaine.replace(reg, "ê");reg=new RegExp("(ë)", "g");chaine = chaine.replace(reg, "ë");reg=new RegExp("(ì)", "g");chaine = chaine.replace(reg, "ì");reg=new RegExp("(í)", "g");chaine = chaine.replace(reg, "í");reg=new RegExp("(î)", "g");chaine = chaine.replace(reg, "î");reg=new RegExp("(ï)", "g");chaine = chaine.replace(reg, "ï");reg=new RegExp("(ð)", "g");chaine = chaine.replace(reg, "ð");reg=new RegExp("(ñ)", "g");chaine = chaine.replace(reg, "ñ");reg=new RegExp("(ò)", "g");chaine = chaine.replace(reg, "ò");reg=new RegExp("(ó)", "g");chaine = chaine.replace(reg, "ó");reg=new RegExp("(ô)", "g");chaine = chaine.replace(reg, "ô");reg=new RegExp("(õ)", "g");chaine = chaine.replace(reg, "õ");reg=new RegExp("(ö)", "g");chaine = chaine.replace(reg, "ö");reg=new RegExp("(÷)", "g");chaine = chaine.replace(reg, "÷");reg=new RegExp("(ø)", "g");chaine = chaine.replace(reg, "ø");reg=new RegExp("(ù)", "g");chaine = chaine.replace(reg, "ù");reg=new RegExp("(ú)", "g");chaine = chaine.replace(reg, "ú");reg=new RegExp("(û)", "g");chaine = chaine.replace(reg, "û");reg=new RegExp("(ü)", "g");chaine = chaine.replace(reg, "ü");reg=new RegExp("(ý)", "g");chaine = chaine.replace(reg, "ý");reg=new RegExp("(þ)", "g");chaine = chaine.replace(reg, "þ");reg=new RegExp("(ÿ)", "g");chaine = chaine.replace(reg, "ÿ");reg=new RegExp("(…)", "g");chaine = chaine.replace(reg, "…");reg=new RegExp("(™)", "g");chaine = chaine.replace(reg, "™");
// On termine par remplacer le & par ASOLamp;
reg=new RegExp("(&)", "g");
chaine = chaine.replace(reg, "ASOLamp;");
// On termine par remplacer le & par ASOLamp;
reg=new RegExp("\\?", "g");
chaine = chaine.replace(reg, "ASOLinte;");
// On termine par remplacer le & par ASOLamp;
reg=new RegExp("\\!", "g");
chaine = chaine.replace(reg, "ASOLexcl;");
/*
var reg=new RegExp("(&)", "g");
chaine = chaine.replace(reg, "ASOLamp;");
//var reg=new RegExp("(’)", "g");
//chaine = chaine.replace(reg, "'");
var reg=new RegExp("(')", "g");
chaine = chaine.replace(reg, "’");
//var reg=new RegExp("(')", "g");
//chaine = chaine.replace(reg, "’");
*/
/*
if(obj.elements[compte_objet].id == 'eventpay_event_organizer_paypal_email')
{
alert('chaine90:'+chaine);
}
*/
//alert('chaine90:'+chaine);
//alert(chaine);
chaine = encodeURI(chaine);
//alert('apres encodeURI:'+chaine);
/*
if(encode_pour_ajax == false)
chaine = encodeURI(chaine);
else
chaine = Base64.encode(chaine);
*/
//alert(chaine);
//chaine2 = decodeURI(chaine);
//alert(chaine2);
//alert(obj.elements[compte_objet].value);
poststr += obj.elements[compte_objet].id+'='+chaine+'&';
//poststr += obj.elements[compte_objet].id+'='+escape(obj.elements[compte_objet].value)+'&';
}
}
}
//makePOSTRequest('post.html', poststr);
if(encode_pour_ajax == true)
{
//alert(Base64.encode(poststr));
//alert(poststr);
//poststr = 'encode_pour_ajax=true&post_encode='+Base64.encode(poststr);
//alert(poststr);
//alert(poststr);
}
//alert(poststr);
return poststr;
}
function ShowPageYN(element_target, page_link, argGetOrPost, formname)
// argGetOrPost : 'GET' or 'POST'
{
//alert('target:'+element_target);
//alert('page_link:'+page_link);
//alert('argGetOrPost:'+argGetOrPost);
//alert('formname:'+formname);
//alert(page_link);
//page_link = StringRemplace(page_link, '&', '&');
page_link = page_link.split('&').join('&');
//alert(page_link);
page_link = decodeURI(page_link);
//alert(page_link);
var nom_object_Xhr = getXhr();
//xhr.onreadystatechange =
eval(nom_object_Xhr).onreadystatechange =
function()
{
//alert(nom_object_Xhr+'*');
//if(xhr.readyState == 4 && xhr.status == 200)
if(eval(nom_object_Xhr).readyState == 4 && eval(nom_object_Xhr).status == 200)
{
//alert(nom_object_Xhr+'+');
//alert('target:'+element_target);
//setInnerHTML_2(document.getElementById(element_target), xhr.responseText);
setInnerHTML_2(document.getElementById(element_target), eval(nom_object_Xhr).responseText);
// Update dependant frames if necessary
if(refresh_dependant_frame_array_target[1] != '' && refresh_dependant_frame_array_target[1] != undefined)
{
local_target = refresh_dependant_frame_array_target[1];
local_url = refresh_dependant_frame_array_url[1];
local_type = refresh_dependant_frame_array_type[1];
local_object = refresh_dependant_frame_array_object[1];
refresh_dependant_frame_array_target[1] = '';
refresh_dependant_frame_array_url[1] = '';
refresh_dependant_frame_array_type[1] = '';
refresh_dependant_frame_array_object[1] = '';
ShowPageYN(local_target, local_url, local_type, local_object);
}
}
//else if(xhr.readyState == 4)
else if(eval(nom_object_Xhr).readyState == 4)
{
//alert('xhr'+nombre_appel_ajax+'-');
// Try again
//alert('status onreadychange:'+xhr.readyState);// + ' status:'.xhr.status);
//alert('status onreadychange:'+eval(nom_object_Xhr).readyState);// + ' status:'.eval(nom_object_Xhr).status);
//ShowPageYN(element_target, page_link, argGetOrPost, formname);
}
}
bustcacheparameter=(page_link.indexOf('?')!=-1)? '&'+new Date().getTime() : '?'+new Date().getTime();
eval(nom_object_Xhr).open(argGetOrPost, page_link+bustcacheparameter, true);
if(argGetOrPost == 'POST')
{
parameters = BuildPostString(formname);
// Build the array of the POST arguments
//alert(element_target);
if(parameters != '')
{
//alert('target2:'+element_target);
eval('xhr'+nombre_appel_ajax).setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
//;charset=iso-8859-1
eval(nom_object_Xhr).setRequestHeader('Content-length', parameters.length);
eval(nom_object_Xhr).setRequestHeader('Connection', 'close');
//alert(element_target);
document.getElementById(element_target).innerHTML=loadstatustext;
eval(nom_object_Xhr).send(parameters);
}
}
else
{
document.getElementById(element_target).innerHTML=loadstatustext;
eval(nom_object_Xhr).send(null);
}
}
// SetInnerHTML Sécurisé
function setInnerHTML(divContent, HTML)
{
divContent.innerHTML=HTML;
var AllScripts=divContent.getElementsByTagName('script')
for (var i=0; i 0)
{
continue;
}
eval(s.innerHTML);
}
}
// SetInnerHTML Sécurisé
function setInnerHTML_2(divContent, HTML)
{
//alert(HTML);
divContent.innerHTML=HTML;
//sendToClipboard(HTML);
var AllScripts=divContent.getElementsByTagName('script')
for (var i=0; i 0)
{
continue;
}
// Précédement asynchrone, mis en synchrone pour éviter des problèmes de dépendances de scripts
//alert('execute file:'+s.src);
eval(getFileContent(s.src));
}
else
{
if(s.innerHTML.indexOf('SmartAdServer') > 0)
{
continue;
}
//alert('execute content:'+s.innerHTML);
eval(s.innerHTML);
}
}
}
// Renvoie le texte de l'objet ActiveXObject le plus récent depuis une liste
var pickRecentProgID = function (idList){
// found progID flag
var bFound = false;
for(var i=0; i < idList.length && !bFound; i++){
try{
var oDoc = new ActiveXObject(idList[i]);
o2Store = idList[i];
bFound = true;
}catch (objException){
// trap; try next progID
};
};
if (!bFound)
throw ('Aucun ActiveXObject n\'est valide sur votre ordinateur, pensez à mettre à jour votre navigateur');
idList = null;
return o2Store;
}
// Retourne un nouvel objet XmlHttpRequest
var GetXmlHttpRequest_AXO=null
var GetXmlHttpRequest=function () {
if (window.XMLHttpRequest) {
return new XMLHttpRequest()
}
else if (window.ActiveXObject) {
if (!GetXmlHttpRequest_AXO) {
GetXmlHttpRequest_AXO=pickRecentProgID(['Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP']);
}
return new ActiveXObject(GetXmlHttpRequest_AXO)
}
return false;
}
function getFileContent(url)
{
var Xhr=GetXmlHttpRequest();
Xhr.open('GET',url,false);
Xhr.send(null);
return Xhr.responseText;
}
function BuildArrayFile()
{
var nb_image;
var stringImage="";
nb_image = document.getElementById("nb_images").value;
//nb_image = document.forms["form_choisir_overview"].elements("nb_images").value;
for(i=1;i <= nb_image; i++)
{
if(document.getElementById("image_"+i).checked == true)
{
stringImage += document.getElementById("image_"+i).value + "|";
}
}
document.getElementById("liste_fichier").value = stringImage;
}