function fullwin()
{
	var limit=screensize;	var largeur=(navigator.appName != 'Microsoft Internet Explorer')? window.innerWidth:document.body.clientWidth;
	if (largeur>=limit)
	{	var ajout=((largeur-limit)/2);	var tmp="";var obj="";
		for(var i=0;i<div_to_move.length;i++)
		{	obj=div_to_move[i].split('|');tmp=document.getElementById(obj[0]);
			if (tmp!=null) tmp.style.left=(parseInt(obj[1])+ajout)+"px";			
}}}

function activate(obj,comp,ext) {obj.src="./img/"+comp+obj.name+"_."+ext;}

function normal_size(obj,comp,ext) {obj.src="./img/"+comp+obj.name+"."+ext;}

function valid_note(obj) 
{
	var val=document.getElementById("note").value;
	if (val!='NULL') document.getElementById(val).style.border="0px";
	obj.style.border="1px dashed white";
	document.getElementById("note").value=obj.id;
}

function addText(instext)
{
    var mess = document.formulaire.message;
        //IE support
        if (document.selection) {
            mess.focus();
            sel = document.selection.createRange();
            sel.text = instext;
            document.guestbook.focus();
        }
        //MOZILLA/NETSCAPE support
        else if (mess.selectionStart || mess.selectionStart == "0") {
            var startPos = mess.selectionStart;	var endPos = mess.selectionEnd;	var chaine = mess.value;
			mess.value = chaine.substring(0, startPos) + instext + chaine.substring(endPos, chaine.length);
			mess.selectionStart = startPos + instext.length;
            mess.selectionEnd = endPos + instext.length;
            mess.focus();
        } else {mess.value += instext; mess.focus();}
}

function position(event,obj,rep,ext)
{
	activate(obj,rep,ext);
	var tomove=document.getElementById("block_"+obj.name);
	//position souris
	var x = event.clientX;	var y = event.clientY-125;	var largeur=tomove.style.width;	var hauteur=tomove.style.height;
	tomove.style.display="block";
	tomove.style.top= y - hauteur / 2 + 'px';
	tomove.style.left= x - largeur / 2 + 'px';
}

function efface_position(obj,rep,ext) {document.getElementById("block_"+obj.name).style.display="none";normal_size(obj,rep,ext);}

function show_nav(){document.getElementById("navigation").style.visibility="visible";}

function show_diapo(){var tmp=document.getElementById("diaporama_wait");if (tmp!= undefined) tmp.style.display="none";document.getElementById("diaporama").style.display="block";}

function show_mark(nbpv){if (nbpv>2) document.getElementById("mark").style.display="block";}

function favoris(fav,trt) 
{
	if ( navigator.appName != 'Microsoft Internet Explorer' )
	{ window.sidebar.addPanel(trt,fav,""); }
	else { window.external.AddFavorite(fav,trt); } 
}

function add_click(url){document.getElementById('imgclick').src=('./pages/PHP/visites.php?action=click&url='+url); }
