var ua = navigator.userAgent.toLowerCase();
var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); 

_uacct = "UA-1889987-1";
urchinTracker();

function verifMail(email)
	{
	var maReg = new RegExp ( "^\\w[\\w+\.\-]*@[\\w\-]+\.\\w[\\w+\.\-]*\\w$", "gi" ) ;
	 
	if ( email.search( maReg ) == -1 )
		return false;
	else
		return true;
	}

function HTMLDecode ( text )
	{
	if ( typeof( text ) != "string" )
		text = text.toString() ;

	text = text.replace(
		/&amp;/g, "&").replace(
		/&quot;/g, '"').replace(
		/&lt;/g, "<").replace(
		/&gt;/g, ">");

	return text ;
	}

function HTMLEncode ( text )
	{
	if ( typeof( text ) != "string" )
		text = text.toString() ;

	text = text.replace(
		/&/g, "&amp;").replace(
		/"/g, "&quot;").replace(
		/</g, "&lt;").replace(
		/>/g, "&gt;") ;
		
	return text ;
	}

//creation de noeuds (XML et Html)
//d = objet de destination (id de la div...)
//t = type
//a = attributs exemple: ((attName1,attVal1),(attName2,attVal2),(...),...)
//v = value
function NodeCreator(d,t,a,v){
	
	//création de la nouvelle balise
	var ce = document.createElement(t);
	
	//init des valeurs
	var cv;
	
	//si valeurs
	if (v != null && v != "" && v != "undefined")
		{
		//création de la valeure (txt)
		var cv = document.createTextNode(v);
		//assignation de la valeure
		ce.appendChild(cv);
		}
	
	if (a != null && typeof(a) == "object" && a[0] != null)
		{
		//assignation des attributs
		for (var i=0; i<a.length; i++)
			{
			if (a[i][0] != null || a[i][0] != "")
				{
				var tmpAttName = a[i][0];
				var tmpAttVal = a[i][1];

				var ca = document.createAttribute(tmpAttName);
				ca.nodeValue = tmpAttVal;
				ce.setAttributeNode(ca);
				}
			}
		}
	
	if (d != null)
		{
		if (typeof(d) != "object")
			{
			d = document.getElementById(d);
			}

		//assignation du champ
		d.appendChild(ce);
		}
	
	return ce;
	}

// find X et Y pos
function findPosX(o)
	{
	var curLeft = 0;
	
	if (o.offsetParent)
		{
		while (o.offsetParent)
			{
			curLeft += o.offsetLeft;
			o = o.offsetParent;
			}
		}
	else
		{
		curLeft += o.offsetLeft;
		}

	return curLeft;
	}

function findPosY(o)
	{
	var curTop = 0;
	
	if (o.offsetParent)
		{
		while (o.offsetParent)
			{
			curTop += o.offsetTop;
			o = o.offsetParent;
			}
		}
	else
		{
		curTop += o.offsetTop;
		}

	return curTop;
	}