/*
	Concepteur : Simon Lecours
  Date de création: 2005-07-14
	Fichier : fonctions.js 
*/

<!--
	var images_name=new Array(10);
	var images_out=new Array(10);
	var images_over=new Array(10);
	var preload_flag=false;
	
	function preload_images(root) 
	{
		if(document.images) 
		{
			images_name[0]="header_hm_accueil";
			images_name[1]="header_hm_20_ans";
			images_name[2]="header_hm_plan_site";
			images_name[3]="header_hm_contact";
			images_name[4]="header_mm_organisme";
			images_name[5]="header_mm_services_activites";
			images_name[6]="header_mm_calendrier";
			images_name[7]="header_mm_documentation";
			images_name[8]="header_mm_liens";
			images_name[9]="header_mm_liens_admin";
			for(var i=0;i<10;i++)
			{
				images_out[i]=new Image();
				images_out[i].src=root+"/images/"+images_name[i]+"_out.gif";
				images_over[i]=new Image();
				images_over[i].src=root+"/images/"+images_name[i]+"_over.gif";
			}
			preload_flag = true;
		}
	}		

	function change_image(no,over) 
	{
		if(document.images&&preload_flag) 
		{
			if(over)
			{
				document.images[images_name[no]].src=images_over[no].src;
			}
			else
			{
				document.images[images_name[no]].src=images_out[no].src;
			}
		}
	}
	
	var win=-1;
	
	function openImage(root,url,width,height) 
	{	
		if(width!=0&&height!=0)
		{
			var left=(screen.availWidth-10-width)/2;
		  	var top=(screen.availHeight-20-height)/2;
	
			var features="width="+(width+160)+",height="+(height+150)+",left="+left+",top="+top+",";
		}
		else
		{
			var features="";
		}
		features+="directories=no,location=no,menubar=no,resizable=no,";
		features+="scrollbars=no,status=no,toolbar=no";
		
		win=window.open("","Imageagrandie",features);
		win.document.writeln("<html>");
		win.document.writeln("	<head>");
		win.document.writeln("		<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
		win.document.writeln("		<title>Image - Élixir</title>");
		win.document.writeln("		<style type='text/css'>@import url(css/styles.css);</style>");
		win.document.writeln("	</head>");
		win.document.writeln("	<body background='images/background_pattern.gif'>");
		win.document.writeln("		<table border='0px' cellpadding='0px' cellspacing='0px'><tr><td>");
		win.document.writeln("		<table border='0px' cellpadding='0px' cellspacing='0px' style='width:100%'>");
		win.document.writeln("			<tr>");
		win.document.writeln("				<td width='15px' height='30px'><img src='images/body_tab_title_l.gif'></td>");
		win.document.writeln("				<td width='85%' height='30px' background='images/body_tab_title_repeat_1.gif'>");
		win.document.writeln("					<span class='ct_title'></span>");
		win.document.writeln("				</td>");
		win.document.writeln("				<td width='37px' height='30px'><img src='images/body_tab_title_end.gif'></td>");
		win.document.writeln("				<td width='100%' height='30px' background='images/body_tab_title_repeat_2.gif'></td>");
		win.document.writeln("				<td width='8px' height='30px'><img src='images/body_tab_border_end.gif'></td>");
		win.document.writeln("			</tr>");
		win.document.writeln("		</table>");
		win.document.writeln("		<table bgcolor='#F5E8E0' border='0px' cellpadding='0px' cellspacing='0px' style='width:100%'>");
		win.document.writeln("			<tr>");
		win.document.writeln("				<td width='8px' height='8px'><img src='images/body_tab_border_top_l.gif'></td>");
		win.document.writeln("				<td width='100%'></td>");
		win.document.writeln("				<td width='8px' height='8px'><img src='images/body_tab_border_top_r.gif'></td>");
		win.document.writeln("			</tr>");
		win.document.writeln("			<tr>");
		win.document.writeln("				<td width='8px' height='100%' background='images/body_tab_border_repeat_l.gif'></td>");
		win.document.writeln("				<td>");
		win.document.writeln("					<table align='center' border='0px' cellpadding='0px' cellspacing='0px'>");
		win.document.writeln("						<tr align='center'>");
		win.document.writeln("							<td valign='middle'><a href='javascript: return false;' class='thumb'><img src='"+url+"' width='"+width+"' height='"+height+"' onclick='self.close();' class='thumb'></a></td>");
		win.document.writeln("						</tr>");
		win.document.writeln("					</table>");
		win.document.writeln("				</td>");
		win.document.writeln("				<td width='8px' height='100%' background='images/body_tab_border_repeat_r.gif'></td>");
		win.document.writeln("			</tr>");
		win.document.writeln("		</table>");
		win.document.writeln("		<table bgcolor='#F5E8E0' border='0px' cellpadding='0px' cellspacing='0px' style='width:100%'>");
		win.document.writeln("			<tr>");
		win.document.writeln("				<td width='8px' height='38px'><img src='images/body_tab_border_bottom_l_bt.gif'></td>");
		win.document.writeln("				<td width='100%' background='images/body_tab_border_repeat_b_bt.gif'></td>");
		win.document.writeln("				<td width='60px' height='38px'><a href='javascript: return false;' onclick='self.close();'><img src='images/body_tab_border_bottom_r_close_bt.gif' border='0' alt='Fermer la fenêtre'></a></td>");
		win.document.writeln("			</tr>");
		win.document.writeln("		</table>");
		win.document.writeln("		</td></tr></table>");
		win.document.writeln("	</body>");
		win.document.writeln("</html>");
		win.document.close();
		
		return win;
	}
	
	function closeImage(win)
	{
		if(win!=-1)
		{
			if(win.open&&!win.closed)
			{
				win.close();
				win=-1;
			}
		}	
	}
	
	function ordre_effacer()
	{
		for(i=0;i<document.forms['admin_form_ordonner'].elements.length;i++)
		{
			if(document.forms['admin_form_ordonner'].elements[i].type=='text')
			{
				document.forms['admin_form_ordonner'].elements[i].value='';
			}
		}
	}
	
	function ordre_defaut()
	{
		for(i=0;i<document.forms['admin_form_ordonner'].elements.length;i++)
		{
			if(document.forms['admin_form_ordonner'].elements[i].type=='text')
			{
				document.forms['admin_form_ordonner'].elements[i].value='-1';
			}
		}
	}
// -->
