// start element retrievers
function getById(id)
{
	return document.getElementById(id);
}
function getByName(name)
{
	return document.getElementsByName(name);
}
function getByTagName(tagName)
{
	return document.getElementsByTagName(tagName);
}
function getByClass(oElm, strTagName, strClassName)
{
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++)
	{
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className))
		{
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
// end element retrievers

function changeStyle(objectID, propertyName, propertyValue)
{
	$(objectID).style[propertyName] = propertyValue;
}

function changeProperty(objectID, propertyName, propertyValue)
{
	$(objectID)[propertyName] = propertyValue;
}

function getStyleValue(objectID, propertyName)
{
	return $(objectID).style[propertyName];
}

function getPropertyValue(objectID, propertyName)
{
	return $(objectID)[propertyName];
}

// start client detections
function isIE()
{
	if(navigator.appVersion.indexOf('MSIE') != -1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isIE6()
{
	if(navigator.appVersion.indexOf('MSIE 6.0') != -1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isGecko()
{
	if(navigator.userAgent.indexOf('Gecko') != -1)
	{
		return true;
	}
	else
	{
		return false;
	}
}
// end client detections
function getCookieVal(offset)
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom)
{
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) break;

	}
	return null;
}
function inArray(array,value)
{
	for (var i=0;i<array.length;i++)
	{
		if (array[i] == value)
		{
			return true;
		}
	}
	return false;
}

function sliceString(string,length)
{
	if(string.length > length)
	{
		return string.slice(0,length) + '...';
	}
	else
	{
		return string;
	}
}