
var lecteur1 = "Laurent Suply";
var lecteur2 = "Hub";
var lecteur3 = "Foguenne";
var lecteur4 = "Poilu";
var lecteur5 = "chonchon";

lecteur1 = lecteur1.toUpperCase();
lecteur2 = lecteur2.toUpperCase();
lecteur3 = lecteur3.toUpperCase();
lecteur4 = lecteur4.toUpperCase();
lecteur5 = lecteur5.toUpperCase();

var rand1 = 0;
var userand = 0;

images = new Array;
images[1] = new Image();
images[1].src = "http://christophe.josset.googlepages.com/SplusC-coeurs.gif";
images[2] = new Image();
images[2].src = "http://christophe.josset.googlepages.com/SplusC-flingues.gif";
images[3] = new Image();
images[3].src = "http://christophe.josset.googlepages.com/SplusC-gateau.gif";
images[4] = new Image();
images[4].src = "http://christophe.josset.googlepages.com/SplusC-telephone.gif";




function iframecomments(blogid,postid) {
document.write('<iframe height="255px" frameborder="0" width="510px" scrolling="no" src="http://www.blogger.com/comment-iframe.g?blogID='+blogid+'&postID='+postid+'" allowtransparency="true"></iframe>');
}



function affichediv(id) {
document.getElementById(id).style.display = "block";
}
function cachediv(id) {
document.getElementById(id).style.display = "none";
}


function checktest1() { 
var m=0; 
var checked=0;
for (i=1;i<4;i++) { 
if (document.forms.test1.un[i-1].checked==true) { 
checked++;
if (i==1) m=m-1;
if (i==2) m=m+1;
} 
if (document.forms.test1.deux[i-1].checked==true) { 
checked++;
if (i==2) m=m+1;
if (i==3) m=m-1;
} 
if (document.forms.test1.trois[i-1].checked==true) { 
checked++;
if (i==1) m=m-1;
if (i==3) m=m+1;
} 
if (document.forms.test1.quatre[i-1].checked==true) { 
checked++;
if (i==1) m=m-1;
if (i==2) m=m+1;
} 
if (document.forms.test1.cinq[i-1].checked==true) { 
checked++;
if (i==1) m=m-1;
if (i==3) m=m+1;
} 
if (document.forms.test1.six[i-1].checked==true) { 
checked++;
if (i==1) m=m+1;
if (i==3) m=m-1;
} 
} 

if (checked==6) {
for (i=1;i<4;i++) { 
document.forms.test1.un[i-1].disabled = true; 
document.forms.test1.deux[i-1].disabled = true; 
document.forms.test1.trois[i-1].disabled = true; 
document.forms.test1.quatre[i-1].disabled = true; 
document.forms.test1.cinq[i-1].disabled = true; 
document.forms.test1.six[i-1].disabled = true; 
}
if (m>2) {
affichediv("t1p1");
cachediv("t1p2");
cachediv("t1p3");}
else if (m<-2) {
cachediv("t1p1");
affichediv("t1p2");
cachediv("t1p3");}
else {
cachediv("t1p1");
cachediv("t1p2");
affichediv("t1p3");}
}
}


function resettest1() {

for (i=1;i<4;i++) { 
document.forms.test1.un[i-1].disabled = false; 
document.forms.test1.deux[i-1].disabled = false; 
document.forms.test1.trois[i-1].disabled = false; 
document.forms.test1.quatre[i-1].disabled = false; 
document.forms.test1.cinq[i-1].disabled = false; 
document.forms.test1.six[i-1].disabled = false; 
document.forms.test1.un[i-1].checked = false; 
document.forms.test1.deux[i-1].checked = false; 
document.forms.test1.trois[i-1].checked = false; 
document.forms.test1.quatre[i-1].checked = false; 
document.forms.test1.cinq[i-1].checked = false; 
document.forms.test1.six[i-1].checked = false; 
}
cachediv("t1p1");
cachediv("t1p2");
cachediv("t1p3");
}



function checktest2() { 
var checked=0;
for (i=1;i<11;i++) { 
if (document.forms.test2.portraitspolitiques[i-1].checked==true) { 
for (ii=1;ii<11;ii++) { 
if (document.forms.test2.phrasespolitiques[ii-1].checked==true) { 
if ((i==1 && ii==10) || (i==2 && ii==8) || (i==3 && ii==1) || (i==4 && ii==7) || (i==5 && ii==3) || (i==6 && ii==4) || (i==7 && ii==6) || (i==8 && ii==2) || (i==9 && ii==9) || (i==10 && ii==5)) {
document.forms.test2.portraitspolitiques[i-1].disabled = true;
document.forms.test2.phrasespolitiques[ii-1].disabled = true;
document.forms.test2.portraitspolitiques[i-1].checked = false;
document.forms.test2.phrasespolitiques[ii-1].checked = false;
alert("Bonne reponse!");
}
else {
document.forms.test2.portraitspolitiques[i-1].checked = false;
document.forms.test2.phrasespolitiques[ii-1].checked = false;
}
} 
}
} 
} 
for (i=1;i<11;i++) { 
if (document.forms.test2.portraitspolitiques[i-1].disabled==true) checked++;
}
if (checked == 10) affichediv("submitpolitique");
}


function checktest7() { 

if (checkQ2(document.getElementById("q71"))==1 && checkQ2(document.getElementById("q72"))==1 && checkQ2(document.getElementById("q73"))==1 && checkQ2(document.getElementById("q74"))==1 && checkQ2(document.getElementById("q75"))==1 && checkQ2(document.getElementById("q76"))==1) affichediv("submitquizlogo");
}





function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}


function flash(tag) {
document.write(tag);
} 


function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if ( 
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
} 

  
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
}      


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}


function swappic() {
var imgnum = images.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == userand);
userand = rand1;
document.SplusC.src = images[userand].src;
}




function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("Lecteur");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last Name");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "Votre nom" || obj.value == "Votre pseudo" || obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
    var alertMsg = "Vous avez oublie de donner votre nom ou pseudo!\n";
		alert(alertMsg);
		return false;
	}
}




function showcomments(jsonn) {

  var lastguy = "";
  // start a loop
  // in this loop we get the entry from the feed and parse it
  for (var i = limposts - 1 ; i > -1; i--) {
   
    var again = "";
    // get entry i from feed
    var entry = jsonn.feed.entry[i];
    // get the posttitle
    var posttitle = entry.title.$t;
    // get the post url
    // check all links for the link with rel = alternate
    var posturl;
    if (i == jsonn.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }
    }
    // get the postdate, take only the first 10 characters
postdate = givepostdate(entry);


  //msg en fct de heure de post
    var varmsgtime = "";
  var commentdate = entry.published.$t;
     var cdtime1 = commentdate.substring(11,13);
   var cdtime2 = commentdate.substring(14,16);
    var heure = parseInt(cdtime1,10);
    var minutes = parseInt(cdtime2,10);

    msgtime = messageheure(varmsgtime, heure, minutes);



    // get the post author
    var postauthor = entry.author[0].name.$t;
    var authorurl = "";
    if (typeof(entry.author[0].uri) != "undefined") {
    authorurl = entry.author[0].uri.$t;
    }
    if (postauthor == lastguy) {
    again = " (bis)";
    }

    lastguy = postauthor;

    // get the post author
    var desc = "";
    // get the postcontent
    // if the Blogger-feed is set to FULL, then the content is in the content-field
    // if the Blogger-feed is set to SHORT, then the content is in the summary-field
    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";
    var sizecontent = postcontent.length;
    if (sizecontent > 999) {
    sizecontent = "Waouh, "+ sizecontent + " signes!";
    } else {
      if (sizecontent < 21) {
      sizecontent = "Seulement "+ sizecontent + " signes?";
      } else {
        if (sizecontent%100 == 0) {
        sizecontent = "Bravo, "+ sizecontent + " signes pile-poil!";
        } else {
          sizecontent = sizecontent + " signes";
          }
        }
    }
    // strip off all html-tags
    //var re = /<\S[^>]*>/g; 
    //postcontent = postcontent.replace(re, "");
    // changer url du commentaire pour un affichage plus rapide
    posturl = posturl.replace(/#c.*/gi, "#commentaires");




//smileys
postcontent = smileys(postcontent);


    // reduce postcontent to limchar characters
    if (postcontent.length > limchars) postcontent = postcontent.substring(0,limchars);

    // display the results
    document.write('<div class="comment-');

    if (postauthor == "Christophe") {
      document.write('Christophe');
      authorurl = "http://www.SplusC.fr";
      desc = ", auteur";
    } else {
      if (postauthor == "Stephanie") {
      document.write('Stephanie');
      authorurl = "http://www.SplusC.fr";
      desc = ", auteur";
      } else {
        if (postauthor.toUpperCase() == lecteur1 || postauthor.toUpperCase() == lecteur2 || postauthor.toUpperCase() == lecteur3 || postauthor.toUpperCase() == lecteur4 || postauthor.toUpperCase() == lecteur5) {
        document.write('medal');
        desc = ", lecteur actif";
        } else {
          document.write('others');
          }
        }
      }
      document.write('"><a title=\'Visiter son site\' href="'+ authorurl +'"><strong>'+ postauthor +'</strong></a><em><span style="color:#999999">'+ again + desc +', '+ postdate +'... '+ msgtime +'</span></em><br><div class="commenttext">'+ postcontent +'</div><div class="comment-signes"><em><span style="color:#999999">('+ sizecontent +') </em></span></div></div>');
  }
}





function showrecentcomments(jsonn) {
  // start a loop
  // in this loop we get the entry from the feed and parse it
  for (var i = 0 ; i < maxposts; i++) {
    // get entry i from feed
    var entry = jsonn.feed.entry[i];
    // get the posttitle
    var posttitle = entry.title.$t;
    // get the post url
    // check all links for the link with rel = alternate
    var posturl;
    if (i == jsonn.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }
    }
    // get the postdate, take only the first 10 characters
    
postdate = givepostdate(entry);

    // get the post author
    var postauthor = entry.author[0].name.$t;
    var authorurl = "";
    if (typeof(entry.author[0].uri) != "undefined") {
    authorurl = entry.author[0].uri.$t;
    }
    // get the postcontent
    // if the Blogger-feed is set to FULL, then the content is in the content-field
    // if the Blogger-feed is set to SHORT, then the content is in the summary-field
    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";

    // remplacer les BR par des espaces
    postcontent = postcontent.replace(/<br\/>/gi, " ");
    // strip off all html-tags
    var re = /<\S[^>]*>/g; 
    postcontent = postcontent.replace(re, "");
    // changer url du commentaire pour un affichage plus rapide
    posturl = posturl.replace(/#c.*/gi, "#commentaires");



    // reduce postcontent to maxchar characters
    if (postcontent.length > maxchars) postcontent = postcontent.substring(0,maxchars);

    // display the results
    document.write('<div class="comment-');

    if (postauthor == "Christophe") {
      document.write('Christophe');
      authorurl = "http://www.SplusC.fr";
    } else {
      if (postauthor == "Stephanie") {
      document.write('Stephanie');
      authorurl = "http://www.SplusC.fr";
      } else {
        if (postauthor.toUpperCase() == lecteur1 || postauthor.toUpperCase() == lecteur2 || postauthor.toUpperCase() == lecteur3 || postauthor.toUpperCase() == lecteur4 || postauthor.toUpperCase() == lecteur5) {
        document.write('medal');
        } else {
          document.write('others');
          }
        }
      }
      document.write('"><strong><a title=\'Visiter son site\' href="'+ authorurl +'">'+ postauthor +'</a></strong><em><span style="color:#999999;">, '+ postdate +'</em></span><br><a title=\'Lire la suite de ce commentaire\' href="'+ posturl +'">'+ postcontent +' ... <em>(lire)</em></a><br><br></div>');
 
  }
}


function writediv(postauthor) {
    if (postauthor == "Christophe") {
      document.write('<div class="comment-Christophe">');
    } else {
      if (postauthor == "Stephanie") {
      document.write('<div class="comment-Stephanie">');
      } else {
        if (postauthor.toUpperCase() == lecteur1 || postauthor.toUpperCase() == lecteur2 || postauthor.toUpperCase() == lecteur3 || postauthor.toUpperCase() == lecteur4 || postauthor.toUpperCase() == lecteur5) {
        document.write('<div class="comment-medal">');
        } else {
          document.write('<div class="comment-others">');
          }
        }
      }
}


function writedivauteur(postauthor) {
    if (postauthor == "Christophe") {
      document.write('<div class="chris">');
    } else {
      if (postauthor == "Stephanie") {
      document.write('<div class="steph">');
      } else {
      document.write('<div class="guest">');
        }
      }
}



function writelinkauteur(postauthor) {
    if (postauthor == "Christophe") {
      document.write('<a href="/search/label/.C?max-results=5" title="Lire ses articles">Christophe</a>');
    } else {
      if (postauthor == "Stephanie") {
      document.write('<a href="/search/label/.S?max-results=5" title="Lire ses articles">Stephanie</a>');
      } else {
      document.write('<a href="/search/label/.G?max-results=5" title="Lire ses articles">un invite</a>');
        }
      }
}


function writefindiv() {
      document.write('</div>');
}



function showcomments2(jsonn) {
  var lastguy = "";
  // start a loop
  // in this loop we get the entry from the feed and parse it
var i = numcom;
   
    var again = "";
    // get entry i from feed
    var entry = jsonn.feed.entry[i];
    // get the posttitle
    var posttitle = entry.title.$t;
    // get the post url
    // check all links for the link with rel = alternate
    var posturl;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }
    }
    // get the postdate, take only the first 10 characters
    // var postdate = entry.published.$t.substring(8,10)+"/"+entry.published.$t.substring(5,7);

 postdate = givepostdate(entry);

  //msg en fct de heure de post


  var commentdate = entry.published.$t;
     var cdtime1 = commentdate.substring(11,13);
   var cdtime2 = commentdate.substring(14,16);
    var varmsgtime = "";
    var heure = parseInt(cdtime1,10);
    var minutes = parseInt(cdtime2,10);

    msgtime = messageheure(varmsgtime, heure, minutes);


    // get the post author
    var postauthor = entry.author[0].name.$t;
    var authorurl = "";
    if (typeof(entry.author[0].uri) != "undefined") {
    authorurl = entry.author[0].uri.$t;
    }
    if (postauthor == lastguy) {
    again = " (bis)";
    }

    lastguy = postauthor;

    // get the post author
    var desc = "";
    // get the postcontent
    // if the Blogger-feed is set to FULL, then the content is in the content-field
    // if the Blogger-feed is set to SHORT, then the content is in the summary-field
    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";
    var sizecontent = postcontent.length;
    if (sizecontent > 999) {
    sizecontent = "Waouh, "+ sizecontent + " signes!";
    } else {
      if (sizecontent < 21) {
      sizecontent = "Seulement "+ sizecontent + " signes?";
      } else {
        if (sizecontent%100 == 0) {
        sizecontent = "Bravo, "+ sizecontent + " signes pile-poil!";
        } else {
          sizecontent = sizecontent + " signes";
          }
        }
    }
    // strip off all html-tags
    //var re = /<\S[^>]*>/g; 
    //postcontent = postcontent.replace(re, "");


//smileys
postcontent = smileys(postcontent);



    // reduce postcontent to limchar characters
    if (postcontent.length > limchars) postcontent = postcontent.substring(0,limchars);

    // display the results


    if (postauthor == "Christophe") {
      desc = ", auteur";
    } else {
      if (postauthor == "Stephanie") {
        desc = ", auteur";
      } else {
        if (postauthor.toUpperCase() == lecteur1 || postauthor.toUpperCase() == lecteur2 || postauthor.toUpperCase() == lecteur3) {
        desc = ", lecteur actif";
        } else {
          
          }
        }
      }
      document.write('<em><span style="color:#999999">'+ desc +', '+ postdate +'... '+ msgtime +'</span></em><br><div class="commenttext">'+ postcontent +'</div><div class="comment-signes"><em><span style="color:#999999">('+ sizecontent +') </em></span></div>');
  
}




function givepostdate(entry) {


  var commentdate = entry.published.$t;
   var cdyear = commentdate.substring(0,4);
   var cdmonth = commentdate.substring(5,7);
   var cdday = commentdate.substring(8,10);
   var cdtime1 = commentdate.substring(11,13);
   var cdtime2 = commentdate.substring(14,16);
   var monthnames = new Array();
   monthnames[1] = "janvier";
   monthnames[2] = "f&#233;vrier";
   monthnames[3] = "mars";
   monthnames[4] = "avril";
   monthnames[5] = "mail";
   monthnames[6] = "juin";
   monthnames[7] = "juillet";
   monthnames[8] = "ao&#251;t";
   monthnames[9] = "septembre";
   monthnames[10] = "octobre";
   monthnames[11] = "novembre";
   monthnames[12] = "d&#233;cembre";
   var postdate = "le "+ cdday +" "+ monthnames[parseInt(cdmonth,10)] +" "+ cdyear +" &#224; "+ cdtime1 +"h"+ cdtime2;

var currentTime = new Date();
var todaymonth = currentTime.getMonth() + 1;
var todayday = currentTime.getDate();
var todayyear = currentTime.getFullYear();
var todayhours = currentTime.getHours();
var todayminutes = currentTime.getMinutes();
var depuisminutes = todayhours - parseInt(cdtime1,10);
depuisminutes = depuisminutes*60 + todayminutes - parseInt(cdtime2,10);

 if (todayday == parseInt(cdday,10)) {
 if (todayyear == parseInt(cdyear,10)) {
 if (todaymonth == parseInt(cdmonth,10)) {

var postdate = "aujourd&#146;hui &#224; "+ cdtime1 +"h"+ cdtime2;

if (depuisminutes < 60 && depuisminutes > 5) {
var postdate = "<strong><span style='color:#000000;background:#FFFF99'>il y a "+ depuisminutes +" minutes</span></strong>";
  }
if (depuisminutes < 6 && depuisminutes > -1) {
var postdate = "<strong><span style='color:#000000;background:#FFFF99'>&#224; l&#146;instant</span></strong>";
  }

}}}

 if (todayday == parseInt(cdday,10)+1) {
 if (todayyear == parseInt(cdyear,10)) {
 if (todaymonth == parseInt(cdmonth,10)) {

var postdate = "hier &#224; "+ cdtime1 +"h"+ cdtime2;

}}}

return(postdate);
}





function smileys(postcontent) {
postcontent = postcontent.replace(/:\-*\)+/gi, '<img alt=":)" align="top" src="http://christophe.josset.googlepages.com/smiley-happy.gif"/>');
postcontent = postcontent.replace(/\s=\)+/gi, ' <img alt="=)" align="top" src="http://christophe.josset.googlepages.com/smiley-happy.gif"/>');
postcontent = postcontent.replace(/:\-*\]+/gi, '<img alt=":]" align="top" src="http://christophe.josset.googlepages.com/smiley-yup.gif"/>');
postcontent = postcontent.replace(/\s=\]+/gi, ' <img alt="=]" align="top" src="http://christophe.josset.googlepages.com/smiley-yup.gif"/>');
postcontent = postcontent.replace(/:o\)+/gi, '<img alt=":o)" align="top" src="http://christophe.josset.googlepages.com/smiley-clown.gif"/>');
postcontent = postcontent.replace(/:o\]+/gi, '<img alt=":o]" align="top" src="http://christophe.josset.googlepages.com/smiley-clown.gif"/>');
postcontent = postcontent.replace(/\s=o\)+/gi, ' <img alt="=o)" align="top" src="http://christophe.josset.googlepages.com/smiley-clown.gif"/>');
postcontent = postcontent.replace(/:\-*o*\(+/gi, '<img alt=":(" align="top" src="http://christophe.josset.googlepages.com/smiley-sad.gif"/>');
postcontent = postcontent.replace(/\s=o*\(+/gi, ' <img alt="=(" align="top" src="http://christophe.josset.googlepages.com/smiley-sad.gif"/>');
postcontent = postcontent.replace(/:\'+\(+/gi, '<img alt=":\'(" align="top" src="http://christophe.josset.googlepages.com/smiley-vsad.gif"/>');
postcontent = postcontent.replace(/\s=\'+\(+/gi, ' <img alt="=\'(" align="top" src="http://christophe.josset.googlepages.com/smiley-vsad.gif"/>');
postcontent = postcontent.replace(/:\'+\)+/gi, '<img alt=":\')" align="top" src="http://christophe.josset.googlepages.com/smiley-happy-cry.gif"/>');
postcontent = postcontent.replace(/\s=\'+\)+/gi, ' <img alt="=\')" align="top" src="http://christophe.josset.googlepages.com/smiley-happy-cry.gif"/>');
postcontent = postcontent.replace(/:\-*p+/gi, '<img alt=":p" align="top" src="http://christophe.josset.googlepages.com/smiley-tongue.gif"/>');
postcontent = postcontent.replace(/\s=\-*p+/gi, ' <img alt="=p" align="top" src="http://christophe.josset.googlepages.com/smiley-tongue.gif"/>');
postcontent = postcontent.replace(/:o+p+/gi, '<img alt=":op" align="top" src="http://christophe.josset.googlepages.com/smiley-wink-tongue.gif"/>');
postcontent = postcontent.replace(/\s=o+p+/gi, ' <img alt="=op" align="top" src="http://christophe.josset.googlepages.com/smiley-wink-tongue.gif"/>');
postcontent = postcontent.replace(/;\-*\)+/gi, '<img alt=";)" align="top" src="http://christophe.josset.googlepages.com/smiley-wink.gif"/>');
postcontent = postcontent.replace(/;\-*\]+/gi, '<img alt=";]" align="top" src="http://christophe.josset.googlepages.com/smiley-wink.gif"/>');
postcontent = postcontent.replace(/;o\)+/gi, '<img alt=";o)" align="top" src="http://christophe.josset.googlepages.com/smiley-wink.gif"/>');
postcontent = postcontent.replace(/;o\]+/gi, '<img alt=";o]" align="top" src="http://christophe.josset.googlepages.com/smiley-wink.gif"/>');
postcontent = postcontent.replace(/:\-*o*D+/gi, '<img alt=":D" align="top" src="http://christophe.josset.googlepages.com/smiley-vhappy.gif"/>');
postcontent = postcontent.replace(/xD+/gi, '<img alt="xD" align="top" src="http://christophe.josset.googlepages.com/smiley-vhappy.gif"/>');
postcontent = postcontent.replace(/\s=\-*o*D+/gi, ' <img alt="=D" align="top" src="http://christophe.josset.googlepages.com/smiley-vhappy.gif"/>');
postcontent = postcontent.replace(/\s:\-*o*\//gi, ' <img alt=":/" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-gauche.gif"/>');
postcontent = postcontent.replace(/\s=\//gi, ' <img alt="=/" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-gauche.gif"/>');
postcontent = postcontent.replace(/:\-*o*\/\s/gi, '<img alt=":/" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-gauche.gif"/> ');
postcontent = postcontent.replace(/\s=\/\s/gi, ' <img alt="=/" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-gauche.gif"/> ');
postcontent = postcontent.replace(/:\-*o*\\/gi, '<img alt=":\\" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-droite.gif"/>');
postcontent = postcontent.replace(/\s=\\/gi, ' <img alt="=\\" align="top" src="http://christophe.josset.googlepages.com/smiley-humf-droite.gif"/>');
postcontent = postcontent.replace(/:\-*x+/gi, '<img alt=":X" align="top" src="http://christophe.josset.googlepages.com/smiley-shut.gif"/>');
postcontent = postcontent.replace(/\s=x+/gi, ' <img alt="=X" align="top" src="http://christophe.josset.googlepages.com/smiley-shut.gif"/>');
postcontent = postcontent.replace(/:\-*o*s+/gi, '<img alt=":S" align="top" src="http://christophe.josset.googlepages.com/smiley-glups.gif"/>');
postcontent = postcontent.replace(/\s=o*s+/gi, ' <img alt="=S" align="top" src="http://christophe.josset.googlepages.com/smiley-glups.gif"/>');
postcontent = postcontent.replace(/\^_*\^/gi, '<img alt="^^" align="top" src="http://christophe.josset.googlepages.com/smiley-nippon.gif"/>');
postcontent = postcontent.replace(/:\-*o*\|+/gi, '<img alt=":|" align="top" src="http://christophe.josset.googlepages.com/smiley-neutral.gif"/>');
postcontent = postcontent.replace(/\s=\|+/gi, ' <img alt="=|" align="top" src="http://christophe.josset.googlepages.com/smiley-neutral.gif"/>');
postcontent = postcontent.replace(/\-_*\-/gi, '<img alt="-_-" align="top" src="http://christophe.josset.googlepages.com/smiley-bored.gif"/>');
postcontent = postcontent.replace(/\s8\-*o*D+/gi, ' <img alt="8)" align="top" src="http://christophe.josset.googlepages.com/smiley-sunglasses.gif"/>');
postcontent = postcontent.replace(/\sB\-+D+/g, ' <img alt="8)" align="top" src="http://christophe.josset.googlepages.com/smiley-sunglasses.gif"/>');
postcontent = postcontent.replace(/\sB\o+D+/g, ' <img alt="8)" align="top" src="http://christophe.josset.googlepages.com/smiley-sunglasses.gif"/>');
postcontent = postcontent.replace(/\s8\-*o*\)+/gi, ' <img alt="8)" align="top" src="http://christophe.josset.googlepages.com/smiley-sunglasses.gif"/>');
postcontent = postcontent.replace(/\sB\-*o*\)+/g, ' <img alt="8)" align="top" src="http://christophe.josset.googlepages.com/smiley-sunglasses.gif"/>');
postcontent = postcontent.replace(/:\-*o*\$+/gi, '<img alt=":$" align="top" src="http://christophe.josset.googlepages.com/smiley-embarrassed.gif"/>');
postcontent = postcontent.replace(/\s=o*\$/gi, ' <img alt="=$" align="top" src="http://christophe.josset.googlepages.com/smiley-embarrassed.gif"/>');
postcontent = postcontent.replace(/\<3/gi, ' <img alt="\<3" align="top" src="http://christophe.josset.googlepages.com/smiley-love.gif"/>');
postcontent = postcontent.replace(/:up:/gi, ' <img alt=":up:" align="top" src="http://christophe.josset.googlepages.com/smiley-love.gif"/>');

postcontent = postcontent.replace(/o\.o/g, '<img alt="o.o" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/o_o/g, '<img alt="o_o" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/\soo\s+/g, ' <img alt="oo" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/> ');
postcontent = postcontent.replace(/O\.O/g, '<img alt="O.O" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/O_O/g, '<img alt="O_O" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/\sOO\s+/g, ' <img alt="OO" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/> ');

postcontent = postcontent.replace(/0\.0/g, '<img alt="o.o" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/0_0/g, '<img alt="o_o" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/\s00\s+/g, ' <img alt="oo" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/> ');
postcontent = postcontent.replace(/0\.0/g, '<img alt="O.O" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/0_0/g, '<img alt="O_O" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/>');
postcontent = postcontent.replace(/\s00\s+/g, ' <img alt="OO" align="top" src="http://christophe.josset.googlepages.com/smiley-surprised.gif"/> ');

postcontent = postcontent.replace(/o\.O/g, '<img alt="o.O" align="top" src="http://christophe.josset.googlepages.com/smiley-err2.gif"/>');
postcontent = postcontent.replace(/o_O/g, '<img alt="o_O" align="top" src="http://christophe.josset.googlepages.com/smiley-err2.gif"/>');
postcontent = postcontent.replace(/\soO\s+/g, ' <img alt="oO" align="top" src="http://christophe.josset.googlepages.com/smiley-err2.gif"/> ');
postcontent = postcontent.replace(/O\.o/g, '<img alt="O.o" align="top" src="http://christophe.josset.googlepages.com/smiley-err.gif"/>');
postcontent = postcontent.replace(/O_o/g, '<img alt="O_o" align="top" src="http://christophe.josset.googlepages.com/smiley-err.gif"/>');
postcontent = postcontent.replace(/\sOo\s+/g, ' <img alt="Oo" align="top" src="http://christophe.josset.googlepages.com/smiley-err.gif"/> ');


return(postcontent);
}


function messageheure(msgtime, heure, minutes) {

    if (minutes == 0) {
    msgtime = "Exactement. Quelle ponctualit&#233;!";
    } else {
    if (heure >= 1 && heure <= 3) {
    msgtime = "Z'&#234;tes pas encore au lit?";
    } else {
    if (heure == 4) {
    msgtime = "ZzzZzZZzzZzz... ZZz...";
    } else {
    if (heure >= 5 && heure <= 6) {
    msgtime = "C'est bien matinal...";
    } else {
    if (heure >= 7 && heure <= 8) {
    msgtime = "Pas de grasse mat' aujourd'hui?";
    } else {
    if (heure >= 9 && heure <= 11) {
    msgtime = "Commentaire du matin, entrain.";
    } else {
    if (heure >= 12 && heure <= 13) {
    msgtime = "J'ai un petit creux, pas vous?";
    } else {
    if (heure >= 14 && heure <= 15) {
    msgtime = "Devriez pas travailler, plut&#244;t?";
    } else {
    if (heure == 16) {
    msgtime = "Enfin l'heure du go&#251;ter!";
    } else {
    if (heure >= 17 && heure <= 18) {
    msgtime = "A 18h, les deux aiguilles s'opposent.";
    } else {
    if (heure >= 19 && heure <= 20) {
    msgtime = "Ce f&#251;t une dure journee.";
    } else {
    if (heure >= 21 && heure <= 22) {
    msgtime = "Rien a la TV? Quelle surprise...";
    } else {
    if (heure >= 23 || heure <= 0) {
    msgtime = "Commentaire du soir, espoir.";
    } else {

    }}}}}}}}}}}}}
return(msgtime);

}

