function ea_eval(fct)
{
	try {
		eval(fct);
	} catch (e) {
		ea_alert("JS error: "+fct);
	}
}
function ea_alert(txt)
{

}
function ea_getid(id)
{
	if (!id)
		return null;
	return document.getElementById(id);
}
function ea_gettag(tag)
{
	if (!tag)
		return null;
	return document.getElementByTagName(tag);
}
function ea_gettags(tag)
{
	if (!tag)
		return null;
	return document.getElementsByTagName(tag);
}
function ea_xhrinit()
{
	if (window.XMLHttpRequest)
		var obj=new XMLHttpRequest();
	else if (window.ActiveXObject)
		var obj=new ActiveXObject("Microsoft.XMLHTTP");
	else {
		alert("Votre navigateur ne supporte pas les requêtes AJAX");
		return false;
	}
	return obj;
}
function ea_xhrsend(obj,data,content_type)
{
	if ((content_type!=null)&&(content_type!=""))
		obj.setRequestHeader("Content-type",content_type);
	else if ((data!=null)&&(data!=""))
		obj.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	obj.send(data);
}
function ea_block_uids(tag,id)
{
	elts=ea_gettags(tag);
	for(i=0;i<elts.length;i++)
		if (elts[i].id==id) {
			if (elts[i].style.display=="block")
				elts[i].style.display="none";
			else
				elts[i].style.display="block";
		}
}
function check_all(obj_check,input_name)
{
	for(i=0;i<obj_check.form.elements.length;i++)
		if ((obj_check.form.elements[i].name==input_name)||(obj_check.form.elements[i].name==obj_check.name))
			obj_check.form.elements[i].checked=obj_check.checked;
}
function ea_elt_create(container,tip,id)
{
	var elt=ea_getid(id);
	if (!elt) {
		elt=document.createElement(tip);
		elt.id=id;
		if (container==null)
			document.body.appendChild(elt);
		else
			container.appendChild(elt);
	}
	return elt;
}
function ea_elt_pos(elt)
{
 	var l=0;
	var t=0;
	var obj=elt;
	while (obj) {
		l+=obj.offsetLeft;
		t+=obj.offsetTop;
		obj=obj.offsetParent;
	}
	return [l,t];
}
function ea_elt_display_id(id,style_display,style_visibility)
{
	ea_elt_display(ea_getid(id),style_display,style_visibility);
}
function ea_elt_display(elt,style_display,style_visibility)
{
	if (!elt)
		return;
	if (style_display==true)
		style_display='block';
	else if (style_display==false)
		style_display='none';
	if (style_visibility==true)
		style_visibility='visible';
	else if (style_visibility==false)
		style_visibility='hidden';
	elt.style.display=style_display;
	elt.style.visibility=style_visibility;
	return;
}
function ea_elt_get_from_event(event)
{
	if (!event)
		event=window.event;
	if (event.target)
		var elt=event.target;
	else if (event.srcElement)
		var elt=event.srcElement;
	if (elt.nodeType==3)	// bug Safari
		elt=elt.parentNode;
	return elt;
}
function ea_elt_getstyle_int(div,prop)
{
	try {
		var s=ea_elt_getstyle(div,prop);
	} catch (e) {
		return 0;
	}
	val=parseInt(s);
	if (isNaN(val))
		return 0;
	return val;
}
function ea_elt_getstyle(div,prop)
{
	try {
		val=div.currentStyle[prop];
	} catch (e) {
		s=prop.replace("T","-t");
		s=s.replace("B","-b");
		s=s.replace("L","-l");
		s=s.replace("R","-r");
		s=s.replace("W","-w");
		try {
			val=document.defaultView.getComputedStyle(div,"").getPropertyValue(s);
		} catch (e) {
			val=0;
		}
	}
	return val;
}
function ea_elt_getclass(elt,tag)
{
	var obj=elt;
	while (obj) {
		if (obj.tagName.toLowerCase()==tag.toLowerCase())
			return obj.className;
		obj=obj.parentNode;
	}
	return "";
}
function ea_elt_setclass(elt,tag,cl)
{
	var obj=elt;
	while (obj) {
		if (obj.tagName.toLowerCase()==tag.toLowerCase()) {
			obj.className=cl;
			break;
		}
		obj=obj.parentNode;
	}
}
function ea_elt_insize(div)
{
	var size=new Array();

	if (div) {
		size[0]=div.clientWidth-ea_elt_getstyle_int(div,"paddingLeft")-ea_elt_getstyle_int(div,"paddingRight");
		size[1]=div.clientHeight-ea_elt_getstyle_int(div,"paddingTop")-ea_elt_getstyle_int(div,"paddingBottom");
	} else {
		div=document.body;
		if (div.clientWidth) {
			size[0]=div.clientWidth-ea_elt_getstyle_int(div,"paddingLeft")-ea_elt_getstyle_int(div,"paddingRight");
			size[1]=div.clientHeight-ea_elt_getstyle_int(div,"paddingTop")-ea_elt_getstyle_int(div,"paddingBottom");
		} else {
			size[0]=window.innerWidth;
			size[1]=window.innerHeight;
		}
	}

	return size;
}
function ea_elt_width(div)
{

	var val=div.scrollWidth;
	if (val==0)
		val=div.offsetWidth;
	val+=ea_elt_getstyle_int(div,"marginLeft")+ea_elt_getstyle_int(div,"marginRight");
	return val;

}
function ea_elt_height(div)
{

	var val=div.scrollHeight;
	if (val==0)
		val=div.offsetHeight;
	val+=ea_elt_getstyle_int(div,"marginTop")+ea_elt_getstyle_int(div,"marginBottom");
	return val;

}
function ea_setif_height(div,val)
{
	if (div.ea_h||(ea_elt_getcss_int(div,"height")==0)) {
		ea_set_height(div,val);
		div.ea_h=val;
	}
}
function ea_setif_width(div,val)
{
	if (div.ea_w||(ea_elt_getcss_int(div,"width")==0)) {
		ea_set_width(div,val);
		div.ea_w=val;
	}
}
function ea_set_width(div,val)
{

	val-=(ea_elt_getstyle_int(div,"marginLeft")+ea_elt_getstyle_int(div,"marginRight")+ea_elt_getstyle_int(div,"borderLeftWidth")+ea_elt_getstyle_int(div,"borderRightWidth")+ea_elt_getstyle_int(div,"paddingLeft")+ea_elt_getstyle_int(div,"paddingRight"));

	if (val<0)
		val=0;
	div.style.width=val+"px";
}
function ea_set_height(div,val)
{

	val-=(ea_elt_getstyle_int(div,"marginTop")+ea_elt_getstyle_int(div,"marginBottom")+ea_elt_getstyle_int(div,"borderTopWidth")+ea_elt_getstyle_int(div,"borderBottomWidth")+ea_elt_getstyle_int(div,"paddingTop")+ea_elt_getstyle_int(div,"paddingBottom"));

	if (val<0)
		val=0;
	div.style.height=val+"px";
}
function ea_js_log_elt(id)
{
	var div=ea_getid(id);
	ea_js_log(id+":top="+div.style.top+",left="+div.style.left+",height="+ea_elt_height(div)+",width="+ea_elt_width(div));
	ea_js_log("H="+div.style.height+",W="+div.style.width);
}
function ea_js_log(txt)
{

}
function ea_radio_set(elt,name,val)
{
	list=document.getElementsByTagName("input");
	for (i=0;i<list.length;i++) {
		if (list[i].name==name)
			list[i].value=val;
		if (list[i].name.substr(0,name.length+1)==name+"_")
			if (list[i]!=elt)
				list[i].className="cl_radio_inactive";
	}
	elt.className="cl_radio_active";
	return false;
}
function ea_elts_height(tb,set1,set2)
{
	var	height=0;
	for(var i=0;i<tb.length;i++) {
		var obj=ea_getid(tb[i]);
		if (obj) {
			if (set1!=false)
				obj.style.height=set1;
			var h=ea_elt_height(obj);
			if (set2)
				ea_set_height(obj,h);
			height+=h;
		}
	}
	return height;
}
function ea_elts_width(tb,set1,set2)
{
	var	width=0;
	for(var i=0;i<tb.length;i++) {
		var obj=ea_getid(tb[i]);
		if (obj) {
			if (set1!=false)
				obj.style.width=set1;
			var w=ea_elt_width(obj);
			if (set2)
				ea_set_width(obj,w);
			width+=w;
		}
	}
	return width;
}
function ea_wait_process(wait)
{
	ea_elt_display_id("wait_LINK",wait,wait);
	obj=ea_getid("wait_ICON");
	if (obj) {
		if (wait==true)
			obj.style.visibility="visible";
		else
			obj.style.visibility="hidden";
	}
}
function ea_focus_save(id)
{
	var elt=ea_getid(id);
	if (!elt)
		return;
	if (elt.tagName=="IFRAME")
		elt.contentWindow.focus();
}
function ea_focus_restore(id)
{
	var elt=ea_getid(id);
	if (elt) {
	if (elt.tagName=="IFRAME")
		elt.contentWindow.focus();
	}
}
function ea_focus(id)
{
	var elt=ea_getid(id);
	if (elt) {
		if (elt.tagName=="IFRAME") {
			setTimeout("ea_getid('"+id+"').contentWindow.focus()",200);
			return;
		}
  		elt.focus();
		if (elt.tagName=="TEXTAREA") {
			if (elt.setSelectionRange) {
				elt.setSelectionRange(0,0);
			} else if (document.selection) {
				var range=elt.createTextRange();
				range.moveStart("character",1);
				range.moveEnd("character",-elt.value.length+1);
				range.select();
			}
		}
	}
}
function ea_addslashes(str)
{
	return str.replace("\\","\\\\").replace("'","\\'").replace("\"","\\\"");
}
function ea_elt_getcss(div,info)
{
	var val=div.style[info];
	if ((val!=null)&&(val!='')&&(val!='undefined'))
		return val;
	var id="#"+div.id;
	for (var i=0;i<document.styleSheets.length;i++) {
		if ((document.styleSheets[i].href.indexOf("://")!=-1)&&(document.styleSheets[i].href.indexOf("w-5.netcourrier.com")==-1))
			continue;
		if (!document.styleSheets[i].cssRules)
			continue;
		for (var j=0;j<document.styleSheets[i].cssRules.length;j++)
			if (document.styleSheets[i].cssRules[j].selectorText==id) {
				val=document.styleSheets[i].cssRules[j].style[info];
				if ((val!=null)&&(val!='')&&(val!='undefined'))
					return val;
			}
	}
	return '';
}
function ea_elt_getcss_int(div,prop)
{
	try {
		var s=ea_elt_getcss(div,prop);
	} catch (e) {
		return 0;
	}
	val=parseInt(s);
	if (isNaN(val))
		return 0;
	return val;
}
function ea_prevent_selection(e,target)
{
	elt=ea_elt_get_from_event(e);
	if (elt) {

	}
	return false;
}
function ea_opacity(id,val)
{
	var obj=ea_getid(id);
	if (obj) {
		obj.style.opacity=val/100;
	}
}
function ea_form_setval(form,elt,value)
{
	for (var i=0;i<form.elements.length;i++)
		if (form.elements[i].name==elt) {
			ea_elt_setval(form.elements[i],value);
			return;
		}
}
function ea_id_setval(id,value)
{
	ea_elt_setval(ea_getid(id),value);
}
function ea_elt_setval(elt,value)
{
	if (!elt)
		return;
	if ((elt.type=="hidden")||(elt.type=="text")||(elt.type=="textarea")||(elt.type=="password")) {
		elt.value=value;
		return;
	}
	if (elt.type=="select-one")
		for(i=0;i<elt.options.length;i++)
			if (elt.options[i].value==value) {
				elt.selectedIndex=i;
				return;
			}
}
function ea_id_getval(id)
{
	return ea_elt_getval(ea_getid(id));
}
function ea_elt_getval(elt)
{
	if (elt) {
		if ((elt.type=="hidden")||(elt.type=="text")||(elt.type=="textarea")||(elt.type=="password"))
			return elt.value;
		if (elt.type=="select-one")
			return elt.options[elt.selectedIndex].value;
	}
	return '';
}
function ea_id_setval_all(id,value)
{
	ea_elt_setval(ea_getid(id),value);
	for(var i=0;;i++) {
		var obj=ea_getid(id+"_"+i);
		if (!obj)
			return;
		ea_elt_setval(obj,value);
	}
}
function ea_date(y,m,d,h,mn)
{
	if (m<10)
		var m0="0"+m;
	else
		var m0=m;
	if (d<10)
		var d0="0"+d;
	else
		var d0=d;
	if (mn<10)
		var mn0="0"+mn;
	else
		var mn0=mn;

	var s=d0+"/"+m0+"/"+y;

	if (h<10)
		var h0="0"+h;
	else
		var h0=h;
	s+=" "+h0+"h"+mn0+"";

	return s;
}
function ea_setclock()
{
	ea_setclock_1();
	var timeout=60000;
	var d=new Date();
	var s=d.getSeconds();
	if (s!=0)
		timeout=(60-s)*1000;
	setTimeout("ea_setclock()",timeout);
}
function ea_setclock_1()
{
	var obj_hour=ea_getid("id_hour");
	var obj_date=ea_getid("id_date");
	if (!obj_hour&&!obj_date)
		return;
	var d=new Date();
	var day_id=d.getDay();
	var month_id=d.getMonth();
	var month=month_id+1;
	if (month<10)
		month="0"+eval(month_id+1);
	var yyyy=d.getFullYear();
	var yy=yyyy%100;
	if (yy<10)
		yy="0"+yy;
	var tab_day=new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
	var tab_month=new Array("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre");
	if (obj_hour) {
		obj_hour.innerHTML="";

	}
	if (obj_date) {
		obj_date.innerHTML="";

	}
}
function ea_elt_change_name(id,name)
{
	var obj=ea_getid(id);
	if (obj&&(obj.name))
		obj.name=name;
}
function ea_select_all(id)
{
	var obj=ea_getid(id);
	if (obj) {
		if (obj.checked)
			obj.checked=false;
		else
			obj.checked=true;
		obj.onclick();
	}
}
function ea_display_1block(elt,block,label,cl1,cl2)
{
	var i=1;
	while (1) {
		var obj=ea_getid(block+i);
		if (!obj)
			break;
		ea_elt_display(obj,false,false);
		var obj=ea_getid(label+i);
		if (obj) {
			if (i==elt)
				obj.className=cl1;
			else
				obj.className=cl2;
		}
		i++;
	}
	ea_elt_display_id(block+elt,true,true);
}
function ea_swap(id1,id2)
{
	var obj1=ea_getid(id1);
	var obj2=ea_getid(id2);
	if (obj1 && obj2 && (obj1.type==obj2.type)) {
		if ((obj1.type=="hidden")||(obj1.type=="text")||(obj1.type=="textarea")||(obj1.type=="password")) {
			var tmp=obj1.value;
			ea_id_setval(id1,obj2.value);
			ea_id_setval(id2,tmp);
		} else if (obj1.type=="select-one") {
			tmp=obj1.options[obj1.selectedIndex].value;
			for (i=0;i<obj1.options.length;i++) {
				if (obj1.options[i].value==obj2.options[obj2.selectedIndex].value) {
					obj1.selectedIndex=i;
					break;
				}
			}
			for (i=0;i<obj2.options.length;i++) {
				if (obj2.options[i].value==tmp) {
					obj2.selectedIndex=i;
					break;
				}
			}
		}
	}
}

function ea_textarea_size(elt,min,max)
{
	var m=0;
	if (elt.value=="") {
/*		if (elt.rows!=min) {
			elt.rows=min;
			m=1;
		} */
	} else {
		while (elt.scrollHeight>elt.clientHeight) {
			if (elt.rows>=max)
				break;
			(elt.rows)++;
			m=1;
		}
	}
	if (m==1)
		ea_screen_in();
}
function ea_elt_sound(id,file,hidid)
{
	var obj=ea_getid(id);
	var hidden=ea_getid(hidid);
	if (obj) {
		if (obj.tagName.toLowerCase()=="bgsound") {
			if (hidden)
				obj.src=hidden.value;
			else
				obj.src=file;
		} else if (obj.tagName.toLowerCase()=="object") {
			if (obj.type=="audio/mpeg") {
				if (hidden)
					obj.data=hidden.value;
				else
					obj.data=file;
			} else if (obj.type=="application/x-shockwave-flash") {
				if (hidden)
					obj.dewset(hidden.value);
				else
					obj.dewset(file);
				obj.dewplay();
			}
		}
	}
}
function ea_icon_doc(filename)
{
	var pt=filename.lastIndexOf('.');
	var ext=filename.substr(pt);
	var src='';
	var alt='';
	if (ext=='.txt') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_txt.gif';
		alt='txt';
	} else if ((ext=='.doc')||(ext=='.docx')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_doc.gif';
		alt='doc';
	} else if (ext=='.xls') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_xls.gif';
		alt='xls';
	} else if (ext=='.pdf') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_pdf.gif';
		alt='pdf';
	} else if ((ext=='.gif')||(ext=='.jpg')||(ext=='.jpeg')||(ext=='.tiff')||(ext=='.psp')||(ext=='.psd')||(ext=='.ico')||(ext=='.png')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_img.gif';
		alt='gif';
	} else if ((ext=='.au')||(ext=='.vid')||(ext=='.avi')||(ext=='.mpg')||(ext=='.mpeg')||(ext=='.wmv')||(ext=='.ram')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_vid.gif';
		alt='vid';
	} else if ((ext=='.wav')||(ext=='.mp3')||(ext=='.aif')||(ext=='.al')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_snd.gif';
		alt='wav';
	} else if ((ext=='.zip')||(ext=='.z')||(ext=='.gz')||(ext=='.tar')||(ext=='.rar')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_zip.gif';
		alt='zip';
	} else if (ext=='.ppt') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_ppt.gif';
		alt='ppt';
	} else if (ext=='.pps') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_pps.gif';
		alt='pps';
	} else if ((ext=='.exe')||(ext=='.bat')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_exe.gif';
		alt='exe';
	} else if ((ext=='.html')||(ext=='.htm')) {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_html.gif';
		alt='html';
	} else if (ext=='.chm') {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc_hlp.gif';
		alt='hlp';
	} else {
		src='http://images.mailobj.net/img-20100602/netcourrier/fr/include/web2/doctype/icon_doc.gif';
		alt='';
	}
	var html='<img src='+src+' alt='+alt+' border="0" style="vertical-align: middle" />';
	return html;
}
function ea_get_dom_line_start(refNode)
{
	var node=refNode.previousSibling;
	while (node) {
		if ((node.nodeName=="BR")||(node.nodeName=="P")||(node.nodeName=="DIV"))
			break;
		node=node.previousSibling;
	}
	return node;
}
function ea_get_dom_line_end(nodeRef)
{
	var node=nodeRef.nextSibling;
	while (node) {
		if ((node.nodeName=="BR")||(node.nodeName=="P")||(node.nodeName=="DIV"))
			break;
		node=node.nextSibling;
	}
	return node;
}
function ea_url_addparam(url,param)
{
	if (url.indexOf("?")>0)
		url=url.concat("&");
	else
		url=url.concat("?");
	return url.concat(param);
}
var ea_link_intern=0;
var ea_link_alert=null;
var ea_link_alert_tst=new Array();
var ea_link_screen="";
function ea_link_isintern(msg)
{
	if (ea_link_intern==1)
		return true;
	return false;
}
function ea_link_msg_set(msg)
{
	ea_link_alert=msg;
}
function ea_link_msg_tst(tst)
{
	for(var i=0;i<ea_link_alert_tst.length;i++)
		if (ea_link_alert_tst[i]==tst)
			return;
	ea_link_alert_tst.push(tst);
}
function ea_link_msg_get()
{
	for(var i=0;i<ea_link_alert_tst.length;i++)
		ea_eval(ea_link_alert_tst[i]);
	return ea_link_alert;
}


function ea_link(url,target,msg)
{
	ea_timeout_lastclick();
	if (msg!=null)
		if (!confirm(msg))
			return;
	var msg2=ea_link_msg_get();
	if (msg2) {
		if (!confirm(msg2))
			return false;
		ea_link_msg_set(null);
	}
	ea_link_intern=1;
	var res=ea_link_(url,target,null);
	ea_link_intern=0;

	return res;
}

function ea_link_js(url,target,fct)
{
	ea_timeout_lastclick();
	ea_link_intern=1;
	var res=ea_link_(url,target,fct);
	ea_link_intern=0;
	return res;
}

function ea_link_direct(url,target,fct)
{
	ea_timeout_lastclick();
	ea_link_intern=1;
	res=ea_link_(url,target,fct);
	ea_link_intern=0;
	return res;
}

function ea_link_(url,target,fct)
{
	if (target=="div_IN_PREVIEW") {
		var div=ea_getid(target);
		if (!div||(ea_elt_getstyle_int(div,"width")<10)||(ea_elt_getstyle_int(div,"height")<10)||(div.style.visibility=="hidden"))
			target="";
	}
	if (target=="saveas") {
		var div=ea_getid("ea_saveas");
		div.src=url;
		if (fct)
			ea_eval(fct);
		return;
	}
	if (target=="win") {
		window.location.href=url;
		if (fct)
			ea_eval(fct);
		return;
	}
	if (target=="top") {
		top.location.href=url;
		if (fct)
			ea_eval(fct);
		return;
	}
	if ((target=="visu")||(target.substr(0,1)=="_")) {
		window.open(url,target);
		if (fct)
			ea_eval(fct);
		return;
	}

	if (target.substr(0,5)=="popup") {
		window.open(url,target,"dependant=yes,toolbar=no,menubar=no,location=no,resizable=yes");
		if (fct)
			ea_eval(fct);
		return;
	}
	if (target.substr(0,6)=="window") {
		var tab=target.split("/");
		window.open(url,tab[0],ea_win_params(tab));
		if (fct)
			ea_eval(fct);
		return;
	}
	if (target=="refresh") {
		var xhr_obj=ea_xhrinit();
		if (!xhr_obj)
			return;
		xhr_obj.open("GET",url,true);
		xhr_obj.onreadystatechange=function _ea_refresh_process() {
			if (xhr_obj.readyState==4) {
				try {
//					ea_eval(xhr_obj.responseText);
				} catch (e) {
				}
				if (fct)
					ea_eval(fct);
				return true;
			}
		}
		ea_xhrsend(xhr_obj,null,null);
		return;
	}
	document.location.href=url;
	if (fct)
		ea_eval(fct);

}
function ea_win_params(tab)
{
	var param="";
	for(var i=1;i<tab.length;i++) {
		if (param!="")
			param+=",";
		if (tab[i]=="landscape")
			param+="width=900,height=500";
		else if (tab[i]=="letter")
			param+="width=700,height=700";
		else if (tab[i]=="bars")
			param+="location=1,toolbar=1,personalbar=1,menubar=1";
		else
			param+=tab[i];
	}
	param=ea_win_param(param,"width","600");
	param=ea_win_param(param,"height","500");
	param=ea_win_param(param,"status","0");
	param=ea_win_param(param,"location","0");
	param=ea_win_param(param,"toolbar","0");
	param=ea_win_param(param,"personalbar","0");
	param=ea_win_param(param,"menubar","0");
	param=ea_win_param(param,"resizable","1");
	param=ea_win_param(param,"scrollbars","1");
	return param;
}
function ea_win_param(param,par,val)
{
	if (param.indexOf(par)!=-1)
		return param;
	if (param!="")
		param+=",";
	return param+par+"="+val;
}
function ea_link_done()
{
	var obj=ea_getid("div_PAGE_PRINT");
	if (!obj)
		ea_screen_in();
	div=ea_getid("div_IN");
	if (div)
		div.style.visibility="visible";
	div=ea_getid("wait_IN");
	if (div)
		div.style.display="none";
}
var ea_timeout_id=null;
function ea_link_click(url,target,msg)
{
	if (ea_timeout_id) {
		clearTimeout(ea_timeout_id);
		ea_timeout_id=null;
	}
	var fct="ea_timeout_id=null;ea_link(";
	if (url==null)
		fct+="null";
	else
		fct+="'"+url+"'";
	fct+=",";
	if (target==null)
		fct+="null";
	else
		fct+="'"+target+"'";
	fct+=",";
	if (msg==null)
		fct+="null";
	else
		fct+="'"+msg+"'";
	fct+=")";
	ea_timeout_id=setTimeout(fct,500);
}
function ea_link_dblclick(url,target,msg)
{
	if (ea_timeout_id) {
		clearTimeout(ea_timeout_id);
		ea_timeout_id=null;
	}
	ea_link_intern=1;
	ea_link(url,target,msg);
	ea_link_intern=0;
}
function ea_if_not_link()
{
	if (ea_timeout_id)
		return false;
	return true;
}

function ea_form(button,target,msg)
{
	ea_timeout_lastclick();
	if (msg!=null)
		if (!confirm(msg))
			return false;
	var msg2=ea_link_msg_get();
	if (msg2) {
		if (!confirm(msg2))
			return false;
		ea_link_msg_set(null);
	}
	return ea_form_(button,target,null,0)
}
function ea_form_async(button,target,msg)
{
	return ea_form_(button,target,msg,1)
}
function ea_form_direct(button,target)
{
	return ea_form_(button,target,null,0)
}
function ea_form_(button,target,msg,async)
{
	if (msg!=null)
		if (!confirm(msg))
			return false;
	button.form.target='';
	if ((target=="top")||(target.substr(0,1)=='_')) {
		button.form.target=target;
		return true;
	}
	var form=ea_getform(button);
	if (!form)
		return false;

	if ((button.tagName=="INPUT")&&((button.type=="submit")||(button.type=="image")))
		return true;
	return form.submit();

}
function ea_form_elt_display(form,name,style_display,style_visibility)
{
	for (var i=0;i<form.elements.length;i++) {
		var elt=form.elements[i];
		if (elt.name==name)
			ea_elt_display(elt,style_display,style_visibility);
	}
}
function ea_form_select_value(id,value,label)
{
	var obj=ea_getid("id_select_hidden_"+id);
	if (obj)
		obj.value=value;
	obj=ea_getid("id_select_label_"+id);
	if (obj)
		obj.innerHTML=label;
}
function ea_getform(elt)
{
	var obj=elt;
	while (obj) {
		if (obj.tagName=="FORM")
			return obj;
		obj=obj.parentNode;
	}
	return null;
}
function ea_list_test(button,input_name,msg_0)
{
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			return true;
	alert(msg_0);
	return false;
}
function ea_list_test_1(button,input_name,msg_1)
{
	var ok=0;
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			ok++;
	if (ok!=1) {
		alert(msg_1);
		return false;
	}
	return true;
}
function ea_list_test_01(button,input_name,msg_01)
{
	var ok=0;
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			ok++;
	if (ok>1) {
		alert(msg_01);
		return false;
	}
	return true;
}
function ea_list(button,target,input_name,msg_0,msg)
{
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			return ea_form(button,target,msg);
	alert(msg_0);
	return false;
}
function ea_list_1(button,target,input_name,msg_1,msg)
{
	var ok=0;
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			ok++;
	if (ok!=1) {
		alert(msg_1);
		return false;
	}
	return ea_form(button,target,msg);
}
function ea_list_01(button,target,input_name,msg_01,msg)
{
	var ok=0;
	for(var i=0;i<button.form.elements.length;i++)
		if ((button.form.elements[i].name==input_name)&&(button.form.elements[i].checked==true))
			ok++;
	if (ok>1) {
		alert(msg_01);
		return false;
	}
	return ea_form(button,target,msg);
}
var ea_list_checked=0;
function ea_list_checkval(value)
{
	if (ea_list_checked==0)
		ea_list_checked=value;
}
function ea_list_checkline(e,name,value,down)
{
	if (ea_list_checked==2) {
		ea_list_checked=0;
		return false;
	}
	if (ea_list_checked==1) {
		ea_list_checked=0;
		var elts=ea_gettags("input");
		for(var i=0;i<elts.length;i++) {
			if ((elts[i].type!="checkbox")||(elts[i].name!=name))
				continue;
			if (elts[i].value!=value)
				continue;
			ea_list_checkinput(e,elts[i]);
			break;
		}
		return false;
	}
	var already=0;
	var found=0;
	var next=new Array();
	var elts=ea_gettags("input");
	var del_other=true;
	if ((down==1)&&(!e.ctrlKey)&&(!e.shiftKey))
		for(var i=0;i<elts.length;i++) {
			elt=elts[i];
			if ((elt.type=="checkbox")&&(elt.name==name)&&(elt.value==value)) {
				if (elt.checked)
					del_other=false;
				break;
			}
		}
	for(var i=0;i<elts.length;i++) {
		elt=elts[i];
		if ((elt.type!="checkbox")||(elt.name!=name))
			continue;
		if (elt.value!=value) {
			if (e.ctrlKey)
				continue;
			if (!e.shiftKey) {
				if (del_other)
					ea_list_selectline(elt,false);
				continue;
			}
			if (found==0) {
				if (already==1)
					ea_list_selectline(elt,true);
				else if (elt.checked)
					already=1;
				continue;
			}
			if (elt.checked) {
				for(var j=0;j<next.length;j++)
					ea_list_selectline(next[j],true);
				next=new Array();
			} else
				next.push(elt);
			continue;
		}
		if (e.ctrlKey&&elt.checked)
			ea_list_selectline(elt,false);
		else
			ea_list_selectline(elt,true);
		found=1;
	}
	if ((e.ctrlKey||e.shiftKey))
		return false;
	return true;
}
function ea_list_checkline1(e,name,value)
{
	if (ea_list_checked==2) {
		ea_list_checked=0;
		return false;
	}
	if (e.shiftKey||e.ctrlKey)
		return false;
	var elts=ea_gettags("input");
	var nb=0;
	var ee=null;
	for(var i=0;i<elts.length;i++) {
		elt=elts[i];
		if ((elt.type!="checkbox")||(elt.name!=name))
			continue;
		if (elt.value!=value) {
			if (elt.checked) {
				ea_list_selectline(elt,false);
				nb++;
			}
			continue;
		}
		var ee=elt;
	}
	if ((ee!=null)&&(!ee.checked)) {
		ea_list_selectline(elt,true);
		return true;
	}
	if (nb>0)
		return true;
	return false;
}
function ea_list_link(e,url,target)
{
	if (ea_list_checked!=0) {
		ea_list_checked=0;
		return false;
	}
	if ((e.ctrlKey||e.shiftKey))
		return false;
	ea_link(url,target,null);
}
function ea_list_checkline_link(e,name,value,url,target)
{
	if (ea_list_checkline(e,name,value))
		ea_link(url,target,null);
}
function ea_list_checkinput(e,obj)
{
	var already=0;
	var found=0;
	var next=new Array();
	if (!obj.checked) {
		ea_list_selectline(obj,false);
		return false;
	}
	for(var i=0;i<obj.form.elements.length;i++) {
		elt=obj.form.elements[i];
		if ((elt.type!="checkbox")||(elt.name!=obj.name))
			continue;
		if (elt.value!=obj.value) {
			if (e.ctrlKey)
				continue;
			if (!e.shiftKey)
				continue;
			if (found==0) {
				if (already==1)
					ea_list_selectline(elt,true);
				else if (elt.checked)
					already=1;
				continue;
			}
			if (elt.checked) {
				for(var j=0;j<next.length;j++)
					ea_list_selectline(next[j],true);
				next=new Array();
			} else
				next.push(elt);
			continue;
		}
		ea_list_selectline(elt,true);
		found=1;
	}
	return false;
}

function ea_list_selectline(checkbox,checked)
{
	checkbox.checked=checked;
	if (checked==true)
		ea_elt_setclass(checkbox,"tr","checked");
	else 
		ea_elt_setclass(checkbox,"tr","click");
}

function ea_list_check_all(obj_check,input_name,uncheck_fn)
{
	for(var i=0;i<obj_check.form.elements.length;i++)
		if ((obj_check.form.elements[i].name==input_name)||(obj_check.form.elements[i].name==obj_check.name))
			ea_list_selectline(obj_check.form.elements[i],obj_check.checked);
	if (!obj_check.checked)
		ea_eval(uncheck_fn);
}
function ea_menu_open(obj,id)
{
	var div=ea_getid(id);
	if (div) {
		var pos=ea_elt_pos(obj);
		div.style.left=pos[0]+"px";
		div.style.top=(pos[1]+15)+"px";
		div.style.display="block";
	}
}
var ea_screen_value=new Array();
var ea_screen_value_link=null;
function ea_screen_value_new(pos,label,value)
{
	this.pos=pos;
	this.label=label;
	this.value=value;
}
function ea_screen_value_set(pos,label,value)
{
	if (ea_screen_value_set0(pos,label,value)==0)
		return;
	if (ea_screen_value_link) {
		var txt='';
		for(var i=0; i<ea_screen_value.length;i++) {
			if (txt!='')
				txt+='|';
			txt+=ea_screen_value[i].pos+"/"+ea_screen_value[i].label+"/"+ea_screen_value[i].value;
		}
		if (txt!='')
			ea_link_direct(ea_screen_value_link+txt,'nodiv_in',null);
	}
}
function ea_screen_value_set0(pos,label,value)
{
	for(var i=0; i<ea_screen_value.length;i++)
		if ((ea_screen_value[i].pos==pos)&&(ea_screen_value[i].label==label)) {
			if (ea_screen_value[i].value==value)
				return 0;
			ea_screen_value[i].value=value;
			return 1;
		}
	ea_screen_value.push(new ea_screen_value_new(pos,label,value));
	return 1;
}
function ea_screen_value_get(pos,label)
{
	for(var i=0; i<ea_screen_value.length;i++)
		if ((ea_screen_value[i].pos==pos)&&(ea_screen_value[i].label==label))
			return ea_screen_value[i].value;
	return 0;
}
function ea_screen_value_setlink(link)
{
	ea_screen_value_link=link;
}
function ea_screen_fill(main,tb)
{
	if (main) {
		if (main=="parent") {
			var	div_main=null;
			for(var i=0;i<tb.length;i++) {
				var info=tb[i].split("/");
				var div=ea_getid(info[0]);
				if (div) {
					div_main=div.parentNode;
					break;
				}
			}
		} else
			var div_main=ea_getid(main);
		if (!div_main)
			return;
		var avail=ea_elt_insize(div_main);
		var left=ea_elt_getstyle_int(div_main,"paddingLeft");
		var right=ea_elt_getstyle_int(div_main,"paddingRight");
		var top=ea_elt_getstyle_int(div_main,"paddingTop");
		var bottom=ea_elt_getstyle_int(div_main,"paddingBottom");
	} else {
		var avail=ea_elt_insize(null);
		var left=0;
		var right=0;
		var top=0;
		var bottom=0;
	}
	for(var i=0;i<tb.length;i++) {
		var info=tb[i].split("/");
		var position=info[1];
		if (info[0]=="") {
			var val=Number(info[2]);
			if (val>0) {
				if (position=="top") {
					top+=val;
					avail[1]-=val;
				} else if (position=="bottom") {
					bottom+=val;
					avail[1]-=val;
				} else if (position=="left") {
					left+=val;
					avail[0]-=val;
				} else if (position=="right") {
					right+=val;
					avail[0]-=val;
				}
			}
			continue;
		}
		var div=ea_getid(info[0]);
		if (!div)
			continue;
		div.style.position="absolute";
		if (position=="fill") {
			div.style.left=left+"px";
			div.style.top=top+"px";
			div.style.bottom="";
			div.style.right="";
			ea_set_width(div,avail[0]);
			ea_set_height(div,avail[1]);
			break;
		}
		if ((position=="left")||(position=="right")) {
			div.style.top=top+"px";
			if (div.ea_h||(ea_elt_getcss_int(div,"height")==0)) {
				ea_set_height(div,avail[1]);
				div.ea_h=avail[1];
			}
			if (position=="left") {
				div.style.left=left+"px";
				div.style.right="";
			} else {
				div.style.left="";
				div.style.right=right+"px";
			}
			if (div.ea_w)
				var width=0;
			else
				var width=ea_elt_getcss_int(div,"width");
			if ((width==0)||div.ea_w) {
				width=Number(info[2]);
				if (width==-1)
					width=ea_screen_value_get("width",div.id);
				if (width<=0)
					width=ea_elt_width(div);
				var min_ratio=Number(info[3]);
				if ((min_ratio>0)&&(width<avail[0]*min_ratio/100))
					width=Math.floor(avail[0]*min_ratio/100);
				var max_ratio=Number(info[4]);
				if ((max_ratio>0)&&(width>avail[0]*max_ratio/100))
					width=Math.floor(avail[0]*max_ratio/100);
				ea_set_width(div,width);
				div.ea_w=width;
			} else
				width+=ea_elt_getstyle_int(div,"marginLeft")+ea_elt_getstyle_int(div,"marginRight")+ea_elt_getstyle_int(div,"borderLeftWidth")+ea_elt_getstyle_int(div,"borderRightWidth")+ea_elt_getstyle_int(div,"paddingLeft")+ea_elt_getstyle_int(div,"paddingRight");
			if (position=="left")
				left+=width;
			else
				right+=width;
			avail[0]-=width;
		} else if ((position=="top")||(position=="bottom")) {
			div.style.left=left+"px";
			var w=0;
			if (div.ea_w||(ea_elt_getcss_int(div,"width")==0)) {
				w=ea_elt_width(div);
				if (w>=avail[0])
					w=0;
				ea_set_width(div,avail[0]);
				div.ea_w=avail[0];
			}
			if (position=="top") {
				div.style.top=top+"px";
				div.style.bottom="";
			 }
			if (div.ea_h)
				var height=0;
			else
				var height=ea_elt_getcss_int(div,"height");
			if ((height==0)||div.ea_h) {
				height=Number(info[2]);
				if (height==-1)
					height=ea_screen_value_get("height",div.id);
				if (height<=0) {
					if (w>0)
						ea_set_height(div,5);
					height=ea_elt_height(div);
				}
				var min_ratio=Number(info[3]);
				if ((min_ratio>0)&&(height<avail[1]*min_ratio/100))
					height=Math.floor(avail[1]*min_ratio/100);
				var max_ratio=Number(info[4]);
				if ((max_ratio>0)&&(height>avail[1]*max_ratio/100))
					height=Math.floor(avail[1]*max_ratio/100);
				ea_set_height(div,height);
				div.ea_h=height;
			} else
				height+=ea_elt_getstyle_int(div,"marginTop")+ea_elt_getstyle_int(div,"marginBottom")+ea_elt_getstyle_int(div,"borderTopWidth")+ea_elt_getstyle_int(div,"borderBottomWidth")+ea_elt_getstyle_int(div,"paddingTop")+ea_elt_getstyle_int(div,"paddingBottom");
			if (position=="bottom") {
				div.style.top=(top+avail[1]-height)+"px";
				div.style.bottom="";
				bottom+=height;
			} else
				top+=height;
			avail[1]-=height;
		} else if (position=="hide") {
			div.style.visibility="hidden";
		}
	}
}
function ea_screen_in()
{

}
function ea_screen_divmodal()
{
	var div=ea_getid("divmodal");
	var div_sub=ea_getid("divmodal_sub");
	var div_in=ea_getid("divmodal_in");
	if (!div||!div_sub||!div_in)
		return;
	div.style.display="block";
	div_in.style.width="10px";
	var avail=ea_elt_insize(null);
	var width=ea_elt_width(div_in);
	if (width>avail[0]*4/5)
		width=avail[0]*4/5;
	if (width<300)
		width=300;
	width=Math.floor(width)+15;
	ea_set_width(div_in,width);
	if (ea_getid("divmodal_MAIN"))
		var height=ea_elts_height(new Array("divmodal_tabs","divmodal_msg","divmodal_TOP","divmodal_MAIN","divmodal_BOTTOM"),false,false)+ea_elt_getstyle_int(div_in,"marginTop")+ea_elt_getstyle_int(div_in,"marginBottom")+ea_elt_getstyle_int(div_in,"borderTopWidth")+ea_elt_getstyle_int(div_in,"borderBottomWidth")+ea_elt_getstyle_int(div_in,"paddingTop")+ea_elt_getstyle_int(div_in,"paddingBottom");
	else
		var height=ea_elts_height(new Array("divmodal_tabs","divmodal_msg","divmodal_in"),false,true);
	if (height>avail[1]*5/6)
		height=avail[1]*5/6;
	if (height<150)
		height=150;
	div_sub.style.width=Math.floor(width+15)+"px";
	div_sub.style.height=Math.floor(height)+"px";
	if (div.style.visibility!="visible") {
		div_sub.style.left=Math.floor((avail[0]-width)/2)+"px";
		div_sub.style.top=Math.floor((avail[1]-height)*2/5)+"px";
		var obj=ea_getid("divmodal_close");
		if (obj)
			ea_elt_display(obj,true,true);
	}
	ea_divmodal_resize();
	div.style.visibility="visible";
}
function ea_divmodal_resize()
{
	var tb=new Array("divmodal_tabs/top/-1/0/100","divmodal_msg/top/0/0/100","divmodal_in/fill");
	ea_screen_fill("divmodal_sub",tb);
}
function ea_divmodal_center(id)
{
	var div=ea_getid(id);
	if (div) {
		var avail=ea_elt_insize(null);
		var height=ea_elt_height(div);
		var width=ea_elt_width(div);
		div.style.left=Math.floor((avail[0]-width)/2)+"px";
		div.style.top=Math.floor((avail[1]-height)*2/5)+"px";
	}
}
function ea_screen_columns(tb,main,colminwidth)
{
	var div=ea_getid(main);
	if (!div)
		return;
	var avail=ea_elt_insize(div)[0];
	var cols=tb.length;
	if ((colminwidth>0)&&(cols*colminwidth>avail))
		cols=1;
	var width=Math.floor(100/cols);
	var top=0;
	for(var i=0;i<tb.length;i++) {
		if (i<cols) {
			top=0;
			var wr=i;
		} else
			var wr=0;
		for(var j=0;j<tb[i].length;j++) {
			var div=ea_getid(tb[i][j]);
			if (!div)
				continue;
			div.style.display="block";
			div.style.position="absolute";
			div.style.left=(width*wr)+"%";
			div.style.left=(width*wr)+"%";
			div.style.width=width+"%";
			div.style.top=top+"px";
			var height=ea_elt_height(div);
			top+=height;
			div.style.visibility="visible";
		}
	}



}
function ea_iframe_resize(id)
{
	var i=ea_getid(id);
	if (!i)
		return;
	if (i.contentDocument)
		var d=i.contentDocument;
	else if (i.contentWindow)
		var d=i.contentWindow.document;
	else
		var d=window.frames[i.name].document;
	var h=d.body.scrollHeight;
	if (h>0)
		i.style.height=(h+20)+"px";

}
function ea_hotkey_global(code,shi,ctr,param)
{
	var elt=new Array();
	elt.code=code;
	elt.param=param;
	elt.shi=shi;
	elt.ctr=ctr;
	ea_hotkeys_global.push(elt);
}
function ea_hotkey_local_init()
{
	ea_hotkeys_local=new Array();
}
function ea_hotkey_local(code,shi,ctr,param)
{
	var elt=new Array();
	elt.code=code;
	elt.param=param;
	elt.shi=shi;
	elt.ctr=ctr;
	ea_hotkeys_local.push(elt);
}
var ea_hotkeys_global=new Array();
var ea_hotkeys_local=new Array();
var ea_hotkeys_enabled=1;
function ea_hotkeys(e)
{
	if (!e)
		var e=window.event;
	var obj=ea_elt_get_from_event(e);
	if ((obj.type=="textarea")||(obj.type=="select-one")||(obj.type=="select-multiple")) {
		if (code==8)
			return false;
		return true;
	}
	var code=(e.charCode)?e.charCode:(e.which?e.which:e.keyCode);
	if ((obj.type=="text")||(obj.type=="password")) {
		if (code==13) {
			for (var i=0;i<obj.form.elements.length;i++) {
				var elt=obj.form.elements[i];
				if (elt.name=="_ok") {
					ea_eval(elt.value);
					break;
				}
			}
			return false;
		}
		return true;
	}
	if (code==13)
		return false;
	if (!ea_hotkeys_enabled) {
		if (code==8)
			return false;
		return true;
	}
	for(var i=0; i<ea_hotkeys_global.length; i++)
		if (ea_hotkey_ok(ea_hotkeys_global[i],code,e)) { 
			ea_eval(ea_hotkeys_global[i].param);
			return false;
		}
	for(var i=0; i<ea_hotkeys_local.length; i++)
		if (ea_hotkey_ok(ea_hotkeys_local[i],code,e)) { 
			ea_eval(ea_hotkeys_local[i].param);
			return false;
		}
	if ((code==1)||(code==8))
		return false;
	return true;
}
function ea_hotkey_ok(hk,code,e)
{
	if (hk.code!=code)
		return false;
	if (hk.shi==0) {
		if (e.shiftKey)
			return false;
	} else if (hk.shi==1) {
		if (!(e.shiftKey))
			return false;
	}
	if (hk.ctr==0) {
		if (e.ctrlKey)
			return false;
	} else if (hk.ctr==1) {
		if (!(e.ctrlKey))
			return false;
	}
	return true;
}
function ea_hotkeys_enable()
{
	ea_hotkeys_enabled=1;
}
function ea_hotkeys_disable()
{
	ea_hotkeys_enabled=0;
}
function ea_hotkeys_execIDval(id)
{
	var obj=ea_getid(id);
	if (obj)
		ea_eval(obj.value);
}
function ea_hotkeys_exec(id,val,fct)
{
	if (id!=null) {
		var obj=ea_getid(id);
		if (!obj)
			return;
		if (value!=null)
			obj.velue=val;
	}
	if (fct!=null)
		ea_eval(fct);
}
function ea_request_res(res,fct)
{
	if (typeof fct=="function")
		fct(res.substr(0,1),res.substr(1));
	else {
		var res2=res.substr(1).replace(/\\/g,"\\\\").replace(/'/g,"\\'");
		ea_eval(fct+"('"+res.substr(0,1)+"','"+res2+"')");
	}
}
function ea_request(url,param_fct,fct,param_list)
{
	var xhr_obj=ea_xhrinit();
	if (!xhr_obj)
		return;
	xhr_obj.open("POST",url,true);
	xhr_obj.onreadystatechange=function _ea_request_process() {
		if (xhr_obj.readyState==4) {
			if (fct!=null)
				ea_request_res(xhr_obj.responseText,fct);
		}
	}
	var data="fct="+param_fct;
	for(var i=0;i<param_list.length;i++)
		data=data.concat("&param_"+i+"="+encodeURIComponent(param_list[i]));
	ea_xhrsend(xhr_obj,data,null);
}
var ea_logged_out=0;
var ea_lastclick=0;
var ea_refresh_url="";
var ea_refresh_tmpurl=null;
var ea_refresh_tmpjs=null;
function ea_refresh_seturl(url)
{
	ea_refresh_url=url;
}
function ea_refresh_settmpurl(url)
{
	ea_refresh_tmpurl=url;
	ea_refresh_tmpjs=null;
}
function ea_refresh_settmpjs(js)
{
	ea_refresh_tmpjs=js;
	ea_refresh_tmpurl=null;
}
function ea_timeout_lastclick()
{
	var d=new Date();
	ea_lastclick=d.getTime();
}
function ea_cookie_gettime()
{
	if (document.cookie!="") {
		cookies=document.cookie.split(/;/);
		for(i=0;i<cookies.length;i++) {
			cookie_info=cookies[i].split(/=/);
			if (cookie_info.length==2)
				if (((cookie_info[0]).replace(/ /g,""))=="l")
					return(cookie_info[1]);
		}
	}
}
function ea_timeout_refresh(timeout)
{
	if (ea_logged_out==1)
		return;
	var d=new Date();
	var now=d.getTime();
	if (now<ea_lastclick+timeout) {
		setTimeout("ea_timeout_refresh("+timeout+")",ea_lastclick+timeout-now);
		return;
	}
	setTimeout("ea_timeout_refresh("+timeout+")",timeout);
	if (ea_refresh_tmpjs) {
		ea_eval(ea_refresh_tmpjs);
		return;
	}
	if (ea_refresh_tmpurl)
		var url=ea_refresh_tmpurl;
	else if (ea_refresh_url)
		var url=ea_refresh_url;
	else
		return;
	if (url.indexOf("?")==-1)
		var url2=url+"?ea_auto=1";
	else
		var url2=url+"&ea_auto=1";
	ea_link_(url2,"refresh",null);
}
function ea_timeout_logged_out()
{
	ea_logged_out=1;
}
function ea_timeout_logout(url,msg,timeout_alert,timeout)
{
	if (ea_logged_out==1)
		return;
	var d=new Date();
	var now=d.getTime();
	var obj=ea_getid("ea_timeout_off");
	if (obj)
		ea_lastclick=now;
	if (now>ea_lastclick+timeout) {
		setTimeout("ea_timeout_logout('"+url+"','"+msg+"',"+timeout_alert+","+timeout+")",60000);
		if (url.indexOf("?")==-1)
			var url2=url+"?ea_auto=1";
		else
			var url2=url+"&ea_auto=1";
		ea_link_msg_set(null);
		ea_link_(url2,"top",ea_timeout_logged_out);
		return;
	}
	if (now>ea_lastclick+timeout-timeout_alert) {
		ea_timeout_setmsg(msg);
		window.focus();
		setTimeout("ea_timeout_logout('"+url+"','"+msg+"',"+timeout_alert+","+timeout+")",ea_lastclick+timeout-now);
		return;
	}
	setTimeout("ea_timeout_logout('"+url+"','"+msg+"',"+timeout_alert+","+timeout+")",ea_lastclick+timeout-now-timeout_alert);
}
function ea_timeout_setmsg(msg)
{
	var obj=ea_getid("div_MESSAGE");
	if (obj)
		obj.innerHTML="<ul><li>"+msg+"</li></ul>";

}
function ea_dual_list_cmp(a,b) 
{ 
	if (a==null) {
		if (b==null)
			return 0;
		return 1;
	} else if (b==null)
		return -1;
	return strcmp(a.text,b.text);
}
function ea_dual_list_move(obj_src,obj_dest,moveAll,alpha) 
{
	for(var i=obj_src.options.length-1;i>=0;i--) {
		if (!obj_src.options[i].selected&&(moveAll==false))
			continue;
		var opt=document.createElement('option');
		opt.text=obj_src.options[i].text;
		opt.value=obj_src.options[i].value;
		opt.defaultSelected=obj_src.options[i].defaultSelected;
		opt.selected=obj_src.options[i].selected;
		opt.style.backgroundImage=obj_src.options[i].style.backgroundImage;
		var done=0;
		if (alpha==1)
			for(var j=0;j<obj_dest.options.length;j++)
				if (obj_dest.options[j].text>opt.text) {
					obj_dest.add(opt,obj_dest.options[j]);
					done=1;
					break;
				}
		if (done==0) {
			obj_dest.add(opt,null);
		}
		obj_src.remove(i);
	}
}
function ea_dual_list_valid(obj,max,msg)
{
	if (!obj)
		return;
	if ((max>0)&&(obj.options.length>max)) {
		alert(msg);
		return false;
	}
	for(var i=0;i<obj.options.length;i++)
		obj.options[i].selected=true;
	return true;
}
var ea_cur_context_menu=null;
var ea_last_context_menu_elt=null;
var ea_last_context_menu_time=0;
function ea_context_menu(elt,e,id,url)
{
	if (e) {
		obj=ea_elt_get_from_event(e);
		if ((obj)&&((obj.type=="text")||(obj.type=="textarea")))
			return true;
	}
	if ((elt!=null)&&(elt==ea_last_context_menu_elt)) {
		var d=new Date();
		if (d.getTime()-ea_last_context_menu_time<400)
			return false;
	}
	var context_menu=ea_getid(id);
	if (!context_menu)
		return false;
	if (ea_cur_context_menu) {
		if (elt==ea_last_context_menu_elt)
			return false;
		ea_context_menu_close();
	}
	ea_last_context_menu_elt=elt;
	var relative=0;
	if (context_menu.parentNode!=document.body) {
		if (context_menu.tagName=="IFRAME") {
			ea_cur_context_menu=context_menu;
			relative=1;
		} else {
			var c=ea_getid("div_contextmenu");
			if (!c)
				return false;
			c.innerHTML=context_menu.innerHTML;
			ea_cur_context_menu=c;
		}
	} else if (context_menu.tagName!="IFRAME")
		ea_cur_context_menu=context_menu;
	ea_elt_display(ea_cur_context_menu,true,false);
	if (elt!=null) {
		var pos=ea_elt_pos(elt);

		var left=pos[0];

		if (elt.scrollHeight>elt.offsetHeight)
			var top=pos[1]+elt.scrollHeight;
		else
			var top=pos[1]+elt.offsetHeight;
	} else {

		var left=e.clientX;

		var top=e.clientY;
	}
	if (relative==1) {

		ea_cur_context_menu.style.left="0px";

		ea_cur_context_menu.style.top="0px";
		var pos0=ea_elt_pos(ea_cur_context_menu);

		ea_cur_context_menu.style.left=(left-pos0[0])+"px";

		ea_cur_context_menu.style.top=(top-pos0[1])+"px";
	} else {

		ea_cur_context_menu.style.left=left+"px";

		ea_cur_context_menu.style.top=top+"px";
	}
	if (url!=null) {
		ea_cur_context_menu.innerHTML="";

		ea_cur_context_menu.style.left=left+"px";

		ea_cur_context_menu.style.top=top+"px";
		var xhr_obj=ea_xhrinit();
		if (!xhr_obj)
			return;
		xhr_obj.open("GET",url,true);
		xhr_obj.onreadystatechange=function _ea_context_menu_process() {
			if (xhr_obj.readyState==4) {
				ea_wait_process(false);
				ea_parse_res(xhr_obj.responseText,"contextmenu",null);
			}
		}
		ea_xhrsend(xhr_obj,null,null);
		ea_wait_process(true);
	} else {
		if (context_menu.tagName!="IFRAME")
			ea_screen_contextmenu(ea_cur_context_menu);
		ea_elt_display(ea_cur_context_menu,true,true);
	}
	ea_hotkeys_disable();

	document.oncontextmenu=function(e) {
		return false;
	}
	document.onmousedown=function(e) {
		var elt=ea_elt_get_from_event(e);
		do {
			if (elt==ea_cur_context_menu)
				return true;
			elt=elt.parentNode;
		} while (elt.parentNode);
		ea_context_menu_close();
		var d=new Date();
		ea_last_context_menu_time=d.getTime();
		return false;
	}
	return false;
}
function ea_context_menu_close()
{
	ea_hotkeys_enable();
	if (ea_cur_context_menu!=null) {
		ea_elt_display(ea_cur_context_menu,false,false);
		ea_cur_context_menu=null;
		document.onmousedown=function(e) {
			return true;
		}
		document.oncontextmenu=function(e) {
			return true;
		}
	}
}
function ea_context_menu_link(url,target,msg)
{
	ea_context_menu_close();
	ea_link(url,target,msg);
}
function ea_context_menu_form(button,target,msg,val)
{
	button.form.act.value=val;
	ea_context_menu_close();
	ea_form(button,target,msg);
}
function ea_context_menu_js(fn,obj,val)
{
	if (obj)
		obj.value=decodeURIComponent(val);
	ea_context_menu_close();
	ea_eval(fn);
}
function ea_select_value(id,value,label)
{
	var obj=ea_getid("id_select_hidden_"+id);
	if (obj)
		obj.value=value;
	obj=ea_getid("id_select_label_"+id);
	if (obj)
		obj.innerHTML=label;
	ea_context_menu_close();
}
function ea_select_value_multi(sel,name,dft)
{
	var	txt="";
	var sel2=ea_getid("id_select_hdn_"+name);
	for(var i=0; i<sel.options.length;i++) {
		if (sel2)
			for(var j=0; j<sel2.options.length;j++)
				if (sel.options[i].value==sel2.options[j].value)
					sel2.options[j].selected=sel.options[i].selected;
		if (sel.options[i].selected) {
			if (txt!="")
				txt=txt+", ";
			txt=txt+sel.options[i].value;
		}
	}
	if (txt=="")
		txt=dft;
	var elt=ea_getid("id_select_label_"+name);
	if (elt)
		elt.innerHTML=txt;
}
function ea_screen_contextmenu(obj)
{
	obj.style.height="";
	obj.style.width="";
	obj.style.overflow="visible";
	var width=ea_elt_width(obj);
	var height=ea_elt_height(obj);
	var avail=ea_elt_insize(null);
	var pos=ea_elt_pos(obj);
	if ((pos[0]<0)||(pos[0]+width>avail[0])) {
		pos[0]=avail[0]-width;

		obj.style.left=pos[0]+"px";

	}
	if (pos[1]+height>avail[1]) {
		pos[1]=avail[1]-height;
		if (pos[1]<0) {
			pos[1]=0;
			height=avail[1];
			ea_set_height(obj,height);
			ea_set_width(obj,width+20);
			obj.style.overflow="auto";
		}
		obj.style.top=pos[1]+"px";
	}
}
function ea_context_menu_list(elt,e,id,url,name)
{
	var elts=ea_gettags("input");
	var param='';
	for(var i=0;i<elts.length;i++) {
		if ((elts[i].type!="checkbox")||(elts[i].name!=name))
			continue;
		if (elts[i].checked)
			continue;
		if (param=='')
			param+="form="+elts[i].form.name;
		param+="&"+name+"="+elts[i].value;
		break;
	}
	if (param=='')
		return false;
	return ea_context_menu(elt,e,id,url)
}