 function Clear(theText) {
     if (document.getElementById(theText).value == document.getElementById(theText).defaultValue) {
         document.getElementById(theText).value = "";
		 document.getElementById(theText).style.color="black";
     }
 }
 
  function Restore(theText) {
     if (document.getElementById(theText).value == "") {
         document.getElementById(theText).value = document.getElementById(theText).defaultValue;
		 document.getElementById(theText).style.color="grey";
     }
	 if (document.getElementById(theText).value == "Titre") {
		 document.getElementById(theText).style.color="grey";
     }
 }
 
  function sgClear(theText) {
     if (document.getElementById(theText).value == document.getElementById(theText).defaultValue) {
         document.getElementById(theText).value = "";
		 document.getElementById(theText).style.color="#000";
     }
 }
 
  function sgRestore(theText) {
     if (document.getElementById(theText).value == "") {
         document.getElementById(theText).value = document.getElementById(theText).defaultValue;
		 document.getElementById(theText).style.color="#999";
     }
	 if (document.getElementById(theText).value == "Qu'avez-vous en tête actuellement ?") {
		 document.getElementById(theText).style.color="#999";
     }
 }
 
   function repClear(theText) {
     if (document.getElementById(theText).value == document.getElementById(theText).defaultValue) {
         document.getElementById(theText).value = "";
		 document.getElementById(theText).style.color="#000";
     }
 }
 
  function repRestore(theText) {
     if (document.getElementById(theText).value == "") {
         document.getElementById(theText).value = document.getElementById(theText).defaultValue;
		 document.getElementById(theText).style.color="#999";
     }
	 if (document.getElementById(theText).value == "Répondre...") {
		 document.getElementById(theText).style.color="#999";
     }
 } 
   function superClear(theText) {
     if (document.getElementById(theText).value == document.getElementById(theText).defaultValue) {
         document.getElementById(theText).value = "";
		 document.getElementById(theText).style.color="#000";
     }
 }
 
  function superRestore(theText,defText) {
     if (document.getElementById(theText).value == "") {
         document.getElementById(theText).value = document.getElementById(theText).defaultValue;
		 document.getElementById(theText).style.color="#999";
     }
	 if (document.getElementById(theText).value == defText) {
		 document.getElementById(theText).style.color="#999";
     }
 }
 
 
function tClear(theText) {
     if (document.getElementById(theText).innerHTML == 'Composez votre message ici') {
         document.getElementById(theText).innerHTML = "";
		 document.getElementById(theText).style.color="#000";
     }
 }
 
 function repClear(theText) {
     if (document.getElementById(theText).innerHTML == 'Répondre...') {
         document.getElementById(theText).innerHTML = "";
		 document.getElementById(theText).style.color="#000";
     }
 }
 
 function cDispText(string)
 {
	 document.getElementById('dispbox').innerHTML = "<div class='blackbox'>&raquo; "+string+"</div>";
 }
 
 function cHideText(string)
 {
	 //document.getElementById('dispbox').innerHTML = "<div style='background:#fff; order:solid 3px #fff; -moz-border-radius:5px;	-webkit-border-radius:5px; padding:4px; color:#FFF; font-weight:bold;'>&nbsp;</div>";
	 document.getElementById('dispbox').innerHTML = "";
 }
 
 function showHidden(id)
 {
	 document.getElementById(id).style.display = "inline";
 }
 
 function hideHidden(id)
 {
	 document.getElementById(id).style.display = "none";
 }
 
 function speedLog(user)
 {
	 document.getElementById('username').value = user;
	 document.getElementById('password').focus();
 }
 
 function countStatus()
 {
	 var val = document.getElementById("sgmessage").value;
	 var len = val.length;
	 
	 var count = 250 - len;
	 
	 if (count < 0)
	 {
		 count = 0;
	 }
	 
	 if (count <= 60 && count > 30)
	 {
		 document.getElementById('sgcounter').style.color = "#900";
	 } else if (count <= 30) {
		 document.getElementById('sgcounter').style.color = "#f00";
	 } else {
		 document.getElementById('sgcounter').style.color = "#000";
	 }
	 
	 document.getElementById("sgcounter").innerHTML = count;
 }
