// --IMPORTATION DES VARIABLES ------------------------------------------------
// ----------------------------------------------------------------------------
// --INIT------------------ INITIALISATION ------------------------------------
// ne pas considérer le "?" de tête
var querystring = document.location.search.substr(1,100000);
// découper la chaîne de requête en un tableau de paramètres (les paramètres
// sont séparés par un "?" dans la chaîne)
var parametres = querystring.split("?");
// traiter tous les paramètres (sous la forme var=valeur)
for ( cpt = 0 ; cpt < parametres.length ; cpt++ ) {
// séparer le nom de la variable de sa valeur et obtenir un tableau
parametres[cpt] = parametres[cpt].split("=");
}
// <-DEBUT----------------- FONCTION D'ACCES AUX PARAMETRES -------------------
function variable(num) {
return parametres[num][0];
}
function valeur(num) {
return parametres[num][1];
}
// --FIN------------------- FONCTION D'ACCES AUX PARAMETRES ------------------>
// ----------------------------------------------------------------------------
// --FIN IMPORTATION DES VARIABLES --------------------------------------------
// Détection du type de plateforme
function detectMobile() {
mobile = false;
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.search("android") > -1 || userAgent.search("iphone") > -1 || userAgent.search("ipad") > -1 || userAgent.search("blackberry") > -1 || userAgent.search("webos") > -1) { mobile = true; }
}
// Titre de la page (si vide = titre du site par défaut)
function titre_page(titre) {
if (titre=="") {
var titre = "Pingouin WEB site"
}
document.write("
"+titre+"<\/title>");
}
// Un message quand on quitte le site
function bye() {
alert ("Merci de votre visite et à bientôt !");
}
// Formate la prochaine url a ouvrir
function replace_url(page) {
var lurl=""+page+"?pdj="+valeur(0)+"\?"+"tdj="+valeur(1);
location.replace(lurl);
}
// Ouvre le popup de l'image du jour
function ouvre_popupdujour(page) {
var hh=(screen.height)/1.5;
var ll=(screen.width)/2;
var leftMargin=(screen.width-ll)/2;
var topMargin=(screen.height-hh)/2;
window.open(page,"popup","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width="
+ ll + ",height=" + hh + ",left=" + leftMargin + ",top=" + topMargin + "\"");
}
// Agrandit une image
function ouvre_image(image,w,h,wo,ho) {
document.write(""
+"
");
}
// Agrandit une image et affiche un texte libre en passant la souris dessus
function ouvre_image2(image,w,h,wo,ho,texte) {
document.write(""
+"
");
}
// Ouvre le popup d'une image
function ouvre_popupimage(page,image,wo,ho) {
var page=""+page+"?img="+image;
window.open(page,"popup","menubar=no, status=no, scrollbars=no, width=" + wo + ", height=" + ho);
}
// Ouvre un popup
function ouvre_popup(page) {
var hh=(screen.height);
var ll=(screen.width);
window.open(page,"popup","menubar=no, status=no, scrollbars=no, width=" + ll + ", height=" + hh);
}
//ouvre la fenetre de help de download
function ouvre_helpdld() {
//var hh=(screen.height);
//var ll=(screen.width);
var hh=200;
var ll=600;
window.open('/html/help_download.html','Help',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Affiche la calculette
function ouvre_calculette() {
//var hh=(screen.height);
//var ll=(screen.width);
var hh=330;
var ll=400;
window.open('/html/calculette.html','Calculette',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Affiche le convertisseur
function ouvre_converter() {
//var hh=(screen.height);
//var ll=(screen.width);
var hh=700;
var ll=500;
window.open('/html/converter.html','Multi Converter',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Affiche le suivi conso
function ouvre_suiviconso() {
//var hh=(screen.height);
//var ll=(screen.width);
var hh=300;
var ll=300;
window.open('/html/calculette.html','Calculette',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Appelle le Trailer
function open_trailer(lurl) {
document.write("");
}
// Ouvre création d'un commentaire
function ouvre_comment(tag) {
// mise à jour de cette fonction suite au défaut d'ouverture du formulaire de saisie dans la(les) dernière(s) version de firefox
// (à noter qu'il n'y avait pas de souci d'ouverture de ce formulaire sous Chrome...)
var hh=(screen.height); // c'est la taille de la fenêtre précédente
var ll=(screen.width); // crée par : affiche_comment(tag);
location.replace('/html/comments/comment.htm?tag=' + tag,'Comment',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Affiche commentaire(s)
function affiche_comment(tag) {
// réduction de la taille de cette fenêtre associée à la refonte de la fonction précédente : ouvre_comment(tag);
var hh=(screen.height)*0.80;
var ll=(screen.width)/2;
window.open('/html/comments/affiche_comments.htm?tag=' + tag,'Affcomment',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
// Affiche l'invitation commentaires
function invite_comment(date,tag) {
if ( date == "" ) {
document.write("");
} else {
document.write("" + date + "");
}
}
// Ouvre contact
function ouvre_contact() {
//var hh=(screen.height);
//var ll=(screen.width);
var hh=400;
var ll=600;
window.open('/contact/contact.htm','Contact',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + ll + ",height=" + hh + ",titlebar=0");
}
function nombre_comment(tag) {
// Récupération du nombre de commentaires pour ce topic
var xhr_object = null;
if(window.XMLHttpRequest) // Firefox
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // Internet Explorer
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else { // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
return;
}
lurl = "/html/comments/counter/" + tag + ".cnt";
// En mode synchrone
xhr_object.open("GET", lurl, false);
xhr_object.send(null);
// En mode asynchrone
//xhr_object.open("GET", lurl, true);
//xhr_object.onreadystatechange = function anonymous() {
// if(xhr_object.readyState == 4) {
// message_nbc = xhr_object.responseText + " commentaire(s)";
// // alert(xhr_object.responseText);
// }
//}
var commentTxT = " commentaires";
//alert ( escape(xhr_object.responseText) );
//alert( escape('Here is a string') );
//alert( unescape('Here%20is%20a%20string') );
if ( xhr_object.responseText == "0\n" || xhr_object.responseText == "1\n" || xhr_object.responseText == "0 \n" || xhr_object.responseText == "1 \n") commentTxT = " commentaire";
message_nbc = xhr_object.responseText + commentTxT;
xhr_object.send(null);
}
function montre(id) {
// Montre un sous-menu
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
function SetCookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if (expires) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" );
}
function GetCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function DeleteCookie( name, path, domain ) {
if ( GetCookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function SitesDesAmis() {
//document.write("");
document.write("");
//" " +
//"+ Tous les articles entrés dans la légende... |
");
//"
↓↓ Les archives ↓↓
");
}