function changeLang(i, lang)
{
	frEL = document.getElementById('msgFR'+i)
	enEL = document.getElementById('msgEN'+i)
	frIM = document.getElementById('imgFR'+i)
	enIM = document.getElementById('imgEN'+i)
	
	if(lang==1)
	{
		// eng
		if(frEL) frEL.style.display='none'
		if(enEL) enEL.style.display='block'
		if(enIM) enIM.className='sel'
		if(frIM) frIM.className='not'
	}
	else
	{
		// fr
		if(frEL) frEL.style.display='block'
		if(enEL) enEL.style.display='none'
		if(enIM) enIM.className='not'
		if(frIM) frIM.className='sel'
	}
}

// counter
count_iteration = 0;
function count_pe(pe)
{
	total=Math.ceil (counter_current*100.0*count_iteration/(counter_max*10));
	if(total>100) total=100;
	if((total==100)&&(counter_current<counter_max)) total=99;
	if(total==100)
	{
		$('percent').style.width='140px';
		$('counter').style.height='75px';
		$('percent').innerHTML=total+'% Completed !';
	}
	else $('percent').innerHTML=total+'%';
	$('count').style.width=Math.ceil (total*135.0/100)+'px';
	count_iteration++;
	if(count_iteration==11) pe.stop();
}




// Statistics

pageCode=''

function QueryString(param)
{
	var strParam = new String(param)
	var position = window.location.search.indexOf('&' + strParam + '=')
	if (position==-1) position = window.location.search.indexOf('?' + strParam + '=')
	if (position==-1) return ''
	return (window.location.search.indexOf('&', position + strParam.length + 2)==-1) ? window.location.search.substr(position + strParam.length + 2) : window.location.search.substr(position + strParam.length + 2, window.location.search.indexOf('&', position + strParam.length + 2) - (position + strParam.length + 2))
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}

