
function findPosX(obj)
{
	var curleft = 0;

	if (obj.x) curleft += obj.x;
	else if (obj.offsetParent)
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}

	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;

	if (obj.y) curtop += obj.y;
	else if (obj.offsetParent)
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}

	return curtop;
}



function displayMotif( mysrc, myref )
{
	var mymotif = document.getElementById('mymotif') ;
	var mymotifpict = document.getElementById('mymotifpict') ;
	var x = 0;
	var y = 0;

	x = findPosX(myref) ;
	y = findPosY(myref) ;

	mymotif.style.left = x-0 + 'px' ;
	mymotif.style.top = y-80 + 'px' ;
	document.getElementById('mymotifpict').src = mysrc ;
	mymotif.style.display = 'block' ;
	mymotifpict.style.display = 'block' ;
}

function hideMotif()
{
	var mymotif = document.getElementById('mymotif') ;
	var mymotifpict = document.getElementById('mymotifpict') ;

	mymotif.style.display = 'none' ;
	mymotifpict.style.display = 'none' ;
}


function setPict( mypictID, mysrc )
{
	var mypict = document.getElementById(mypictID) ;
	mypict.src = mysrc ;
}



// www.utilsfr.fr.fm 
// Retrouvez des centaines de scripts et bien plus...

/*
Flashing form element Script- © Dynamic Drive (www.dynamicdrive.com)
*/

/*
if( document.all&&document.all.flashit )
{
	var flashelement=document.all.flashit
	if (flashelement.length==null)
		flashelement[0]=document.all.flashit //lwf

	function changecolor(which)
	{
		if (flashelement[which].style.color=='')
			flashelement[which].style.color="red"
		else
			flashelement[which].style.color=""
	}

	if (flashelement.length==null)
		setInterval("changecolor(0)",1000)
	else
		for (i=0;i<flashelement.length;i++)
		{
			var tempvariable='setInterval("changecolor('+i+')",'+'1000)'
			eval(tempvariable)
		}
}
*/


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

function setCookie( c_name, value, exdays, path, domain )
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);

	var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()) + ( (path) ? ";path=" + path : "" ) + ( (domain) ? ";domain="  + domain : "" ) ;

//	var c_value = value + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
//	alert('c_value ' + c_value);
	document.cookie=c_name + "=" + c_value;
}



function getCookie(c_name)
{
	var i, x, y;

	var ARRcookies = document.cookie.split(";");

	for (i=0;i<ARRcookies.length;i++)
	{
		x = ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y = ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x = x.replace(/^\s+|\s+$/g,"");

		if( x == c_name) return unescape(y);
	}
	return '' ;
}


