function gid( id )
{
	return document.getElementById( id );
}

function CheckChampIdentifiant( element )
{
	var nonlegit = /\W/;
	if(  nonlegit.test( element.value.charAt( element.value.length -1 ) ) )
		element.value = element.value.substr(0, ( element.value.length - 1 ) );
}

function CheckChampChiffres( element )
{
	var nonlegit = /\D/;
	if(  nonlegit.test( element.value.charAt( element.value.length -1 ) ) )
		element.value = element.value.substr(0, ( element.value.length - 1 ) );
}

function CheckChampNoTags( element )
{
	var nonlegit = /[<>]/;
	if(  nonlegit.test( element.value.charAt( element.value.length -1 ) ) )
		element.value = element.value.substr(0, ( element.value.length - 1 ) );
}

/************************************************************************************************************
(C) www.dhtmlgoodies.com, March 2005

This is a script by Stefan Born(http://home.arcor.de/xbo/title-to-note/) featured at www.dhtmlgoodies.com.
You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/

var titleToNote = {
 // Define which elements should be affected:
 elements : ['a', 'img', 'span', 'tr', 'td'],
 setup : function(){
 if(!document.getElementById || !document.createElement) return;
   // create note
   var div = document.createElement("div");
   div.setAttribute("id", "title2note");
   document.getElementsByTagName("body")[0].appendChild(div);
   document.getElementById("title2note").style.display = "none";
   // attach events
   for(j=0;j<titleToNote.elements.length;j++){
     for(i=0;i<document.getElementsByTagName(titleToNote.elements[j]).length;i++){
       var el = document.getElementsByTagName(titleToNote.elements[j])[i];
       if(el.getAttribute("tooltip") && el.getAttribute("tooltip") != ""){
         el.onmouseover = titleToNote.showNote;
         el.onmouseout = titleToNote.hideNote;
         el.className = "title2note_el";
       }
     }
   }
 },
 showNote : function()
 {
   document.getElementById("title2note").innerHTML = this.getAttribute("tooltip");
   this.setAttribute("tooltip", "");
   
   	
	//document.getElementById("title2note").style.left = leftPos + 'px';
	//document.getElementById("title2note").style.top = topPos + 'px';

   document.getElementById("title2note").style.display = "block";
 },
 hideNote : function()
 {
   this.setAttribute("tooltip", document.getElementById("title2note").innerHTML);
   document.getElementById("title2note").innerHTML = "";
   document.getElementById("title2note").style.display = "none";
 }
}

var oldonload=window.onload;if(typeof window.onload!='function'){
window.onload=titleToNote.setup;
}else{window.onload=function(){oldonload();
titleToNote.setup();}}

 /* End Title To Note */