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 ) );
}

function OpenSlideshow( id, texte )
{
	if( gid( 'slideshowviewer' ) ) return;
	var DestinationBox = document.createElement('DIV');
	DestinationBox.className = 'SlideshowViewer';
	DestinationBox.id = 'slideshowviewer';
	//DestinationBox.onclick = function() { document.body.removeChild( gid( 'slideshowviewer' ) ); };
	document.body.appendChild( DestinationBox );
	var fo = new SWFObject("viewer.swf", "viewer", "100%", "95%", "8", "#FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.addVariable( "xmlDataPath", "viewerslide.php?ssid=" + id );
	fo.write("slideshowviewer");
	DestinationBox.innerHTML += '<span style="background-color:black;cursor:pointer;padding:2px 8px;" onClick="document.body.removeChild( gid( \'slideshowviewer\' ) );" >' + texte + '</span>';
}

function fbs_click()
{
	u = location.href;
	t = document.title;
	window.open( 'http://www.facebook.com/sharer.php?u='+encodeURIComponent( u ) + '&t=' + encodeURIComponent(t), 'sharer','toolbar=0,status=0,width=626,height=436' );
	return false;
}

/************************************************************************************************************
(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 */