function fixed_top(select,offS){
		return Number(offS+document.documentElement.scrollTop+document.body.scrollTop)+'px';
	}
function fixed_left(select,offS){
	return Number(offS+document.documentElement.scrollLeft+document.body.scrollLeft)+'px';
}
function fixed_bottom(select,offS){
	return Number(-offS+document.documentElement.clientHeight-select.offsetHeight+document.documentElement.scrollTop+document.body.scrollTop)+'px';
}
function fixed_right(select,offS){
	return Number(-offS+document.documentElement.clientWidth-select.offsetWidth+document.documentElement.scrollLeft+document.body.scrollLeft)+'px';
}
function ie_top(select){
		return Number(document.documentElement.scrollTop+document.body.scrollTop)+'px';
	}

function masqueSelect()
{
	// masquage des SELECT pour IE
	Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6

	if(Prototype.Browser.IE6)
	{
		lstsel = document.getElementsByTagName('select');
		for(i=0;i<lstsel.length;i++)
		{
			if(lstsel[i].className == 'donthide')
			{ lstsel[i].style.visibility = 'visible'; }
			else
			{ lstsel[i].style.visibility = 'hidden'; }
		}
	}

}	
	
function validIdentification()
{

	// afficha ge popup erreur
	ddvf = document.getElementById('pop_mc_fond_id');
	ddvf.style.display = 'block';
	ddv = document.getElementById('pop_mc_id');
	ddv.style.display = 'block';
	
	
	var target = $('pop_id');
	var fx = new Fx.Styles(target, {duration: 1, wait: false});
	var box = $(ddv);
 
	box.setStyles({
		'top': target.getTop(),
		'left': target.getLeft()
	});

	//var myOpac = $(ddv).effect('opacity', {duration: 500});
	//myOpac.start(0, 1);
	new Effect.Opacity($(ddv), {duration:0.5, from:0.0, to:0.999999});
	
}
function popupClose(v1,v2)
{
	document.getElementById(v1).style.display='none';
	
	//var myOpac = $(document.getElementById(v2)).effect('opacity', {duration: 500});
	//myOpac.start(1, 0);
	new Effect.Opacity($(document.getElementById(v2)), {duration:0.5, from:1.0, to:0.0});
	document.getElementById(v2).style.display='none';

	Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6

	if(Prototype.Browser.IE6)
	{
		lstsel = document.getElementsByTagName('select');
		for(i=0;i<lstsel.length;i++)
		{
			if(lstsel[i].className=='donthide')
			{ lstsel[i].style.visibility = 'hidden'; }
			else
			{ lstsel[i].style.visibility = 'visible'; }
			
		}
	}	
}
function alertErr(obj,msgmain,msgdetail)
{

	masqueSelect();
	
	document.getElementById('almsgmain').innerHTML = msgmain;
	document.getElementById('almsgdetail').innerHTML = msgdetail;
	
	ddvf = document.getElementById('pop_al_fond_id');
	ddvf.style.display = 'block';
	
	ddv = document.getElementById('pop_al_id');
	ddv.style.display = 'block';
	
	var target = obj;
	var fx = new Fx.Styles(target, {duration: 1, wait: false});
	var box = $(ddv);

	box.setStyles({
		'top': target.getTop(),
		'left': target.getLeft()
	});

	//var myOpac = $(ddv).effect('opacity', {duration: 500});
	//myOpac.start(0, 1);
	new Effect.Opacity($(ddv), {duration:0.5, from:0.0, to:0.999999});
	
}
function popupErr()
{
	masqueSelect();
	
	// fond bleu
	fond = document.getElementById('popMain_fond_id');
	fond.style.display = 'block';
	//var myOpacFond = $(fond).effect('opacity', {duration: 500});
	//myOpacFond.start(0, .78);
	new Effect.Opacity($(fond), {duration:0.5, from:0.0, to:0.78});


	// création popup
	
	popup = document.getElementById('popMain_id');
	popup.style.display = 'block';
	//var myOpacPopup = $(popup).effect('opacity', {duration: 500});
	//myOpacPopup.start(0, 1);
	
	/* Modif PNG24  */
	new Effect.Opacity($(popup), {duration:0.5, from:0.0, to:0.999999});
	$(popup).style.filter = "";
	/* Fin  Modif PNG24  */
}

function popupCarteDetail()
{
	masqueSelect();
	
	// fond bleu
	fond = document.getElementById('popCarte_fond_id');
	fond.style.display = 'block';
	//var myOpacFond = $(fond).effect('opacity', {duration: 500});
	//myOpacFond.start(0, .78);
	new Effect.Opacity($(fond), {duration:0.5, from:0.0, to:0.78});


	// création popup
	
	popup = document.getElementById('popCarte_id');
	popup.style.display = 'block';
	//var myOpacPopup = $(popup).effect('opacity', {duration: 500});
	//myOpacPopup.start(0, 1);
	new Effect.Opacity($(popup), {duration:0.5, from:0.0, to:0.999999});
	
}
function popAide(obj,msg)
{
	masqueSelect();
	
	ddvf = document.getElementById('pop_ai_fond_id');
	ddvf.style.display = 'block';

	ddv = document.getElementById('pop_ai_id');
	ddv.style.display = 'block';
	
	document.getElementById('bai_in_det').innerHTML = msg;
	
	var target = obj;
	var fx = new Fx.Styles(target, {duration: 1, wait: false});
	var box = $(ddv);

	box.setStyles({
		'top': target.getTop(),
		'left': target.getLeft()
	});

	//var myOpac = $(ddv).effect('opacity', {duration: 500});
	//myOpac.start(0, 1);
	new Effect.Opacity($(ddv), {duration:0.5, from:0.0, to:0.999999});
	
}

function popInfo(obj,popup)
{
	masqueSelect();
	
	// fond bleu
	fond = document.getElementById(popup+'_fond_id');
	fond.style.display = 'block';
	//var myOpacFond = $(fond).effect('opacity', {duration: 500});
	//myOpacFond.start(0, .78);
	new Effect.Opacity($(fond), {duration:0.5, from:0.0, to:0.78});


	// création popup
	
	popup = document.getElementById(popup+'_id');
	popup.style.display = 'block';
	//var myOpacPopup = $(popup).effect('opacity', {duration: 500});
	//myOpacPopup.start(0, 1);
	new Effect.Opacity($(popup), {duration:0.5, from:0.0, to:0.999999});

}
function popSusp(obj,popup)
{
	if(document.getElementById('lb_susp_'+obj).className == 'mc_det_susp_din')
	{
		masqueSelect();
		// fond bleu
		fond = document.getElementById(popup+'_fond_id');
		fond.style.display = 'block';
		//var myOpacFond = $(fond).effect('opacity', {duration: 500});
		//myOpacFond.start(0, .78);
		new Effect.Opacity($(fond), {duration:0.5, from:0.0, to:0.78});


		// création popup
		
		popup = document.getElementById(popup+'_id');
		popup.style.display = 'block';
		//var myOpacPopup = $(popup).effect('opacity', {duration: 500});
		//myOpacPopup.start(0, 1);
		new Effect.Opacity($(popup), {duration:0.5, from:0.0, to:0.999999});

		defaultForm = document.getElementById('suspForm');
		document.getElementById('suspForm').action = "javascript:popSuspValid('"+obj+"')";
	}
	else
	{
		defaultForm ='';
		popSuspValid(obj);
		document.getElementById('suspForm').action = "#1";
	}

}
function popSuspValid(obj)
{
	defaultForm ='';
	if(document.getElementById('lb_susp_'+obj).className == 'mc_det_susp')
	{
		document.getElementById('lb_susp_'+obj).className = 'mc_det_susp_din';
		document.getElementById('img_susp_'+obj).style.display = 'block';
		document.getElementById('img_suspann_'+obj).style.display = 'none';
	}
	else
	{
		document.getElementById('lb_susp_'+obj).className = 'mc_det_susp';
		document.getElementById('img_susp_'+obj).style.display = 'none';
		document.getElementById('img_suspann_'+obj).style.display = 'block';
		popupClose('popSusp_fond_id','popSusp_id');
		document.getElementById('alerte_cal_id').value = obj;
		document.getElementById('suspForm').action = urlActionPopupSuspension;
		document.getElementById('suspForm').submit();
	}
}

